diff --git a/services/autorust/codegen/src/codegen.rs b/services/autorust/codegen/src/codegen.rs index 971acbc56d..be6d4e1c70 100644 --- a/services/autorust/codegen/src/codegen.rs +++ b/services/autorust/codegen/src/codegen.rs @@ -29,9 +29,25 @@ pub struct CodeGen<'a> { optional_properties: HashSet, fix_case_properties: HashSet<&'a str>, invalid_types: HashSet, + + union_types: HashSet, } impl<'a> CodeGen<'a> { + pub fn add_union_type(&mut self, type_name: String) { + self.union_types.insert(type_name); + } + + pub fn is_union_type(&self, type_name: &TypeNameCode) -> bool { + self.union_types.contains(&type_name.type_path.to_token_stream().to_string()) + } + + pub fn set_if_union_type(&self, type_name: &mut TypeNameCode) { + if self.is_union_type(type_name) { + type_name.union(true); + } + } + pub fn new( crate_config: &'a CrateConfig, box_properties: HashSet, @@ -47,6 +63,7 @@ impl<'a> CodeGen<'a> { optional_properties, fix_case_properties, invalid_types, + union_types: HashSet::new(), }) } @@ -115,7 +132,7 @@ pub fn parse_query_params(uri: &str) -> Result> { pub struct TypeNameCode { type_path: TypePath, force_value: bool, - pub optional: bool, + optional: bool, vec_count: i32, impl_into: bool, allow_impl_into: bool, @@ -123,6 +140,7 @@ pub struct TypeNameCode { qualify_models: bool, allow_qualify_models: bool, type_name: Option, + union: bool, } impl TypeNameCode { @@ -180,6 +198,9 @@ impl TypeNameCode { self.optional = optional; self } + pub fn union(&mut self, union: bool) { + self.union = union; + } pub fn incr_vec_count(mut self) -> Self { self.vec_count += 1; self @@ -210,6 +231,12 @@ impl TypeNameCode { fn to_type(&self) -> Type { let mut tp = self.type_path.clone(); + if self.union { + if let Some(last) = tp.path.segments.last_mut() { + last.ident = Ident::new(&format!("{}Union", last.ident), last.ident.span()); + } + } + if self.allow_qualify_models && self.qualify_models { tp.path.segments.insert(0, id_models().into()); } @@ -246,6 +273,13 @@ impl TypeNameCode { } tp } + + pub fn is_optional(&self) -> bool { + self.optional + } + pub fn is_union(&self) -> bool { + self.union + } } impl ToString for TypeNameCode { @@ -291,6 +325,7 @@ impl From for TypeNameCode { qualify_models: false, allow_qualify_models: false, type_name: None, + union: false, } } } @@ -503,4 +538,12 @@ mod tests { assert_eq!("bytes :: Bytes", tp.to_string()); Ok(()) } + + #[test] + fn test_with_union() -> Result<()> { + let mut tp = TypeNameCode::try_from("farm::Animal")?; + tp.union(true); + assert_eq!("farm :: AnimalUnion", tp.to_string()); + Ok(()) + } } diff --git a/services/autorust/codegen/src/codegen_models.rs b/services/autorust/codegen/src/codegen_models.rs index 4458e3cf56..ebd4802784 100644 --- a/services/autorust/codegen/src/codegen_models.rs +++ b/services/autorust/codegen/src/codegen_models.rs @@ -1,7 +1,7 @@ use crate::{ codegen::TypeNameCode, identifier::{CamelCaseIdent, SnakeCaseIdent}, - spec::{self, get_schema_array_items, get_type_name_for_schema, get_type_name_for_schema_ref, TypeName}, + spec::{self, get_schema_array_items, get_type_name_for_schema, get_type_name_for_schema_ref}, CodeGen, PropertyName, ResolvedSchema, Spec, }; use crate::{Error, ErrorKind, Result}; @@ -139,8 +139,10 @@ impl SchemaGen { ) } - fn type_name(&self) -> Result { - get_type_name_for_schema(&self.schema.common) + pub fn type_name(&self, cg: &CodeGen) -> Result { + let mut type_name = TypeNameCode::new(&get_type_name_for_schema(&self.schema.common)?)?; + cg.set_if_union_type(&mut type_name); + Ok(type_name) } fn required(&self) -> HashSet<&str> { @@ -194,6 +196,14 @@ impl SchemaGen { } true } + + fn discriminator(&self) -> Option<&str> { + self.schema.discriminator.as_deref() + } + + fn discriminator_value(&self) -> Option<&str> { + self.schema.x_ms_discriminator_value.as_deref() + } } fn resolve_schema_properties( @@ -362,9 +372,10 @@ pub fn all_schemas_resolved(spec: &Spec) -> Result> { pub enum ModelCode { Struct(StructCode), - Enum(StructFieldCode), + Enum(NamedTypeCode), VecAlias(VecAliasCode), TypeAlias(TypeAliasCode), + Union(UnionCode), } impl ToTokens for ModelCode { @@ -374,6 +385,7 @@ impl ToTokens for ModelCode { ModelCode::Enum(enum_code) => enum_code.to_tokens(tokens), ModelCode::VecAlias(vec_alias_code) => vec_alias_code.to_tokens(tokens), ModelCode::TypeAlias(type_alias_code) => type_alias_code.to_tokens(tokens), + ModelCode::Union(union_code) => union_code.to_tokens(tokens), } } } @@ -405,7 +417,7 @@ impl ToTokens for ModelsCode { } } -pub fn create_models(cg: &CodeGen) -> Result { +pub fn create_models(cg: &mut CodeGen) -> Result { let mut pageable_response_names: HashMap = HashMap::new(); for operation in cg.spec.operations()? { if let Some(pageable) = operation.pageable.as_ref() { @@ -437,7 +449,17 @@ pub fn create_models(cg: &CodeGen) -> Result { let mut models = Vec::new(); let mut schema_names = IndexMap::new(); - for (ref_key, schema) in &all_schemas_resolved(&cg.spec)? { + let all_schemas = &all_schemas_resolved(&cg.spec)?; + + // add union types + for (_ref_key, schema) in all_schemas { + if schema.discriminator().is_some() { + let name = schema.name()?.to_camel_case_id(); + cg.add_union_type(name); + } + } + + for (ref_key, schema) in all_schemas { let doc_file = &ref_key.file_path; let schema_name = &ref_key.name; // println!("schema_name: {}", schema_name); @@ -452,7 +474,7 @@ pub fn create_models(cg: &CodeGen) -> Result { let enum_code = create_enum(None, schema, schema_name, false)?; models.push(ModelCode::Enum(enum_code)); } else if schema.is_basic_type() { - let alias = create_basic_type_alias(schema_name, schema)?; + let alias = create_basic_type_alias(cg, schema_name, schema)?; models.push(ModelCode::TypeAlias(alias)); } else { let pageable_name = format!("{}", schema_name.to_camel_case_ident()?); @@ -463,6 +485,10 @@ pub fn create_models(cg: &CodeGen) -> Result { pageable_response_names.get(&pageable_name), HashSet::new(), )?)); + // create union if discriminator + if let Some(tag) = schema.discriminator() { + models.push(ModelCode::Union(UnionCode::from_schema(tag, schema_name, ref_key, all_schemas)?)); + } } } Ok(ModelsCode { @@ -471,6 +497,76 @@ pub fn create_models(cg: &CodeGen) -> Result { }) } +pub struct UnionCode { + pub tag: String, + pub name: TypeNameCode, + pub values: Vec, +} + +impl UnionCode { + fn from_schema(tag: &str, schema_name: &str, ref_key: &RefKey, all_schemas: &Vec<(RefKey, SchemaGen)>) -> Result { + let mut values = Vec::new(); + for (child_ref_key, child_schema) in all_schemas { + if child_schema + .all_of() + .iter() + .any(|all_of_schema| all_of_schema.ref_key.as_ref() == Some(ref_key)) + { + if let Some(tag) = child_schema.discriminator_value() { + let name = tag.to_camel_case_ident()?; + let type_name = TypeNameCode::from(child_ref_key.name.to_camel_case_ident()?); + values.push(UnionValueCode { + tag: tag.to_string(), + name, + type_name, + }); + } + } + } + let mut name = TypeNameCode::from(schema_name.to_camel_case_ident()?); + name.union(true); + Ok(Self { + tag: tag.to_string(), + name, + values, + }) + } +} + +impl ToTokens for UnionCode { + fn to_tokens(&self, tokens: &mut TokenStream) { + let UnionCode { tag, name, values } = self; + tokens.extend(quote! { + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] + #[serde(tag = #tag)] + pub enum #name { + #(#values)* + } + }); + } +} + +pub struct UnionValueCode { + pub tag: String, + pub name: Ident, + pub type_name: TypeNameCode, +} + +impl ToTokens for UnionValueCode { + fn to_tokens(&self, tokens: &mut TokenStream) { + let UnionValueCode { tag, name, type_name } = self; + let serde = if tag != &name.to_string() { + Some(SerdeCode::rename(tag)) + } else { + None + }; + tokens.extend(quote! { + #serde + #name(#type_name), + }); + } +} + pub struct TypeAliasCode { pub id: Ident, pub value: TypeNameCode, @@ -486,9 +582,9 @@ impl ToTokens for TypeAliasCode { } } -fn create_basic_type_alias(property_name: &str, property: &SchemaGen) -> Result { +fn create_basic_type_alias(cg: &CodeGen, property_name: &str, property: &SchemaGen) -> Result { let id = property_name.to_camel_case_ident()?; - let value = TypeNameCode::new(&property.type_name()?)?; + let value = property.type_name(cg)?; Ok(TypeAliasCode { id, value }) } @@ -506,12 +602,7 @@ fn add_schema_refs(resolved: &mut IndexMap, spec: &Spec, doc_ Ok(()) } -fn create_enum( - namespace: Option<&Ident>, - property: &SchemaGen, - property_name: &str, - lowercase_workaround: bool, -) -> Result { +fn create_enum(namespace: Option<&Ident>, property: &SchemaGen, property_name: &str, lowercase_workaround: bool) -> Result { let enum_values = property.enum_values(); let id = &property_name.to_camel_case_ident()?; @@ -651,7 +742,7 @@ fn create_enum( }; let type_name = TypeNameCode::from(vec![namespace, Some(id)]); - Ok(StructFieldCode { + Ok(NamedTypeCode { type_name, code: Some(TypeCode::Enum(code)), }) @@ -769,13 +860,14 @@ fn create_struct( for schema in schema.all_of() { let schema_name = schema.name()?; - let type_name = schema_name.to_camel_case_ident()?; + let mut type_name = TypeNameCode::from(schema_name.to_camel_case_ident()?); + type_name.union(false); let field_name = schema_name.to_snake_case_ident()?; props.push(StructPropCode { doc_comments: Vec::new(), serde: SerdeCode::flatten(), field_name: field_name.clone(), - field_type: type_name.clone().into(), + field_type: type_name.clone(), }); if schema.implement_default() { new_fn_body.extend(quote! { #field_name: #type_name::default(), }); @@ -802,7 +894,7 @@ fn create_struct( let lowercase_workaround = cg.should_workaround_case(); - let StructFieldCode { + let NamedTypeCode { mut type_name, code: field_code, } = create_struct_field_code( @@ -836,43 +928,47 @@ fn create_struct( type_name = type_name.optional(true); } - let mut serde_attrs: Vec = Vec::new(); + let mut serde = SerdeCode::default(); if field_name != property_name { if property.xml_attribute() { let as_attribute = format!("@{}", property_name); - serde_attrs.push(quote! { rename = #as_attribute }); + serde.add_rename(&as_attribute); } else { - serde_attrs.push(quote! { rename = #property_name}); + serde.add_rename(property_name); } } #[allow(clippy::collapsible_else_if)] if is_required { if type_name.is_date_time() { - serde_attrs.push(quote! { with = "azure_core::date::rfc3339"}); + serde.add_with("azure_core::date::rfc3339"); } else if type_name.is_date_time_rfc1123() { - serde_attrs.push(quote! { with = "azure_core::date::rfc1123"}); + serde.add_with("azure_core::date::rfc1123"); } } else { if type_name.is_date_time() { // Must specify `default` when using `with` for `Option` - serde_attrs.push(quote! { default, with = "azure_core::date::rfc3339::option"}); + serde.add_default(); + serde.add_with("azure_core::date::rfc3339::option"); } else if type_name.is_date_time_rfc1123() { // Must specify `default` when using `with` for `Option` - serde_attrs.push(quote! { default, with = "azure_core::date::rfc1123::option"}); + serde.add_default(); + serde.add_with("azure_core::date::rfc1123::option"); } else if type_name.is_vec() { - serde_attrs.push(quote! { default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty"}); + serde.add_default(); + serde.add_deserialize_with("azure_core::util::deserialize_null_as_default"); + serde.add_skip_serializing_if("Vec::is_empty"); } else { - serde_attrs.push(quote! { default, skip_serializing_if = "Option::is_none"}); + serde.add_default(); + serde.add_skip_serializing_if("Option::is_none"); } } if property.schema.is_local_enum() { if lowercase_workaround { - serde_attrs.push(quote! { deserialize_with = "case_insensitive_deserialize"}); + serde.add_deserialize_with("case_insensitive_deserialize"); } else if cg.has_xml() { - serde_attrs.push(quote! { with = "azure_core::xml::text_content"}); + serde.add_with("azure_core::xml::text_content"); } } - let serde = SerdeCode::new(serde_attrs); // see if a field should be wrapped in a Box if cg.should_box_property(prop_nm) { @@ -1061,17 +1157,60 @@ impl ToTokens for StructPropCode { #[derive(Default)] pub struct SerdeCode { - pub attributes: Vec, + attributes: Vec, } impl SerdeCode { - pub fn new(attributes: Vec) -> Self { - Self { attributes } - } pub fn flatten() -> Self { - Self { - attributes: vec![quote! { flatten }], - } + let mut serde = Self::default(); + serde.add_flatten(); + serde + } + pub fn tag(tag: &str) -> Self { + let mut serde = Self::default(); + serde.add_tag(tag); + serde + } + pub fn rename(rename: &str) -> Self { + let mut serde = Self::default(); + serde.add_rename(rename); + serde + } + pub fn add_tag(&mut self, tag: &str) { + self.attributes.push(quote! { tag = #tag }); + } + pub fn add_flatten(&mut self) { + self.attributes.push(quote! { flatten }); + } + pub fn add_rename(&mut self, rename: &str) { + self.attributes.push(quote! { rename = #rename }); + } + pub fn add_alias(&mut self, alias: &str) { + self.attributes.push(quote! { alias = #alias }); + } + pub fn add_skip_serializing_if(&mut self, skip_serializing_if: &str) { + self.attributes.push(quote! { skip_serializing_if = #skip_serializing_if }); + } + pub fn add_default(&mut self) { + self.attributes.push(quote! { default }); + } + pub fn add_default_value(&mut self, default: &str) { + self.attributes.push(quote! { default = #default }); + } + pub fn add_with(&mut self, with: &str) { + self.attributes.push(quote! { with = #with }); + } + pub fn add_deserialize_with(&mut self, deserialize_with: &str) { + self.attributes.push(quote! { deserialize_with = #deserialize_with }); + } + pub fn add_serialize_with(&mut self, serialize_with: &str) { + self.attributes.push(quote! { serialize_with = #serialize_with }); + } + pub fn add_remote(&mut self, remote: &str) { + self.attributes.push(quote! { remote = #remote }); + } + pub fn add_skip_deserializing(&mut self) { + self.attributes.push(quote! { skip_deserializing }); } } @@ -1117,12 +1256,12 @@ impl ToTokens for DocCommentCode { } } -pub struct StructFieldCode { +pub struct NamedTypeCode { type_name: TypeNameCode, code: Option, } -impl ToTokens for StructFieldCode { +impl ToTokens for NamedTypeCode { fn to_tokens(&self, tokens: &mut TokenStream) { if let Some(code) = &self.code { code.to_tokens(tokens) @@ -1173,14 +1312,12 @@ fn create_struct_field_code( property_name: &str, lowercase_workaround: bool, needs_boxing: HashSet, -) -> Result { +) -> Result { match &property.ref_key { Some(ref_key) => { - let tp = ref_key.name.to_camel_case_ident()?; - Ok(StructFieldCode { - type_name: tp.into(), - code: None, - }) + let mut type_name = TypeNameCode::from(ref_key.name.to_camel_case_ident()?); + cg.set_if_union_type(&mut type_name); + Ok(NamedTypeCode { type_name, code: None }) } None => { if property.is_local_enum() { @@ -1189,7 +1326,7 @@ fn create_struct_field_code( let id = property_name.to_camel_case_ident()?; let type_name = TypeNameCode::from(vec![namespace.clone(), id]); let code = create_struct(cg, property, property_name, None, needs_boxing)?; - Ok(StructFieldCode { + Ok(NamedTypeCode { type_name, code: Some(TypeCode::Struct(code)), }) @@ -1202,15 +1339,15 @@ fn create_struct_field_code( .unwrap_or_else(|| id.clone()); let code = XmlWrappedCode { struct_name: struct_name.clone(), - type_name: TypeNameCode::new(&property.type_name()?)?, + type_name: property.type_name(cg)?, }; - Ok(StructFieldCode { + Ok(NamedTypeCode { type_name: TypeNameCode::from(vec![namespace.clone(), struct_name]), code: Some(TypeCode::XmlWrapped(code)), }) } else { - Ok(StructFieldCode { - type_name: TypeNameCode::new(&property.type_name()?)?, + Ok(NamedTypeCode { + type_name: property.type_name(cg)?, code: None, }) } diff --git a/services/autorust/codegen/src/codegen_operations.rs b/services/autorust/codegen/src/codegen_operations.rs index a2766c0b6e..792af3b47c 100644 --- a/services/autorust/codegen/src/codegen_operations.rs +++ b/services/autorust/codegen/src/codegen_operations.rs @@ -454,7 +454,7 @@ impl ToTokens for SetRequestParamsCode { }) }; if let Some(query_body) = query_body { - if !param.optional() || is_vec { + if !param.is_optional() || is_vec { tokens.extend(quote! { let #param_name_var = &this.#param_name_var; #query_body @@ -471,7 +471,7 @@ impl ToTokens for SetRequestParamsCode { ParamKind::Header => { // always use lowercase header names let header_name = param_name.to_lowercase(); - if !param.optional() || is_vec { + if !param.is_optional() || is_vec { if param.is_string() { tokens.extend(quote! { req.insert_header(#header_name, &this.#param_name_var); @@ -505,7 +505,7 @@ impl ToTokens for SetRequestParamsCode { quote! {} }; - if !param.optional() || is_vec { + if !param.is_optional() || is_vec { tokens.extend(quote! { #set_content_type let req_body = azure_core::to_json(&this.#param_name_var)?; @@ -546,7 +546,7 @@ impl ToTokens for SetRequestParamsCode { // Create code for the web operation fn create_operation_code(cg: &CodeGen, operation: &WebOperationGen) -> Result { - let parameters = &FunctionParams::new(operation)?; + let parameters = &FunctionParams::new(cg, operation)?; let verb = operation.0.verb.clone(); let auth = AuthCode {}; @@ -574,7 +574,7 @@ fn create_operation_code(cg: &CodeGen, operation: &WebOperationGen) -> Result Result { + fn new(cg: &CodeGen, operation: &WebOperationGen, produces: String) -> Result { let success_responses = operation.success_responses(); let status_responses = success_responses .iter() .map(|(status_code, rsp)| { Ok(StatusResponseCode { status_code_name: get_status_code_ident(status_code)?, - response_type: create_response_type(rsp)?, + response_type: create_response_type(cg, rsp)?, }) }) .collect::>>()?; @@ -1368,8 +1368,8 @@ impl FunctionParam { fn is_vec(&self) -> bool { self.type_name.is_vec() } - fn optional(&self) -> bool { - self.type_name.optional + fn is_optional(&self) -> bool { + self.type_name.is_optional() } fn is_string(&self) -> bool { self.type_name.is_string() @@ -1383,7 +1383,7 @@ struct FunctionParams { has_x_ms_version: bool, } impl FunctionParams { - fn new(operation: &WebOperationGen) -> Result { + fn new(cg: &CodeGen, operation: &WebOperationGen) -> Result { let parameters = operation.0.parameters(); let has_api_version = parameters.iter().any(|p| p.name() == API_VERSION); let has_x_ms_version = parameters.iter().any(|p| p.name() == X_MS_VERSION); @@ -1397,9 +1397,10 @@ impl FunctionParams { let name = param.name().to_owned(); let description = param.description().clone(); let variable_name = name.to_snake_case_ident()?; - let type_name = TypeNameCode::new(¶m.type_name()?)? + let mut type_name = TypeNameCode::new(¶m.type_name()?)? .qualify_models(true) .optional(!param.required()); + cg.set_if_union_type(&mut type_name); let kind = ParamKind::from(param.type_()); let collection_format = param.collection_format().clone(); params.push(FunctionParam { @@ -1422,10 +1423,10 @@ impl FunctionParams { self.params.iter().collect() } fn required_params(&self) -> Vec<&FunctionParam> { - self.params.iter().filter(|p| !p.type_name.optional).collect() + self.params.iter().filter(|p| !p.type_name.is_optional()).collect() } fn optional_params(&self) -> Vec<&FunctionParam> { - self.params.iter().filter(|p| p.type_name.optional).collect() + self.params.iter().filter(|p| p.type_name.is_optional()).collect() } #[allow(dead_code)] fn params_of_kind(&self, kind: &ParamKind) -> Vec<&FunctionParam> { @@ -1755,11 +1756,11 @@ impl ToTokens for RequestBuilderSettersCode { } } -pub fn create_response_type(rsp: &Response) -> Result> { +pub fn create_response_type(cg: &CodeGen, rsp: &Response) -> Result> { if let Some(schema) = &rsp.schema { - Ok(Some( - TypeNameCode::new(&get_type_name_for_schema_ref(schema)?)?.qualify_models(true), - )) + let mut type_name = TypeNameCode::new(&get_type_name_for_schema_ref(schema)?)?.qualify_models(true); + cg.set_if_union_type(&mut type_name); + Ok(Some(type_name)) } else { Ok(None) } diff --git a/services/autorust/codegen/src/lib.rs b/services/autorust/codegen/src/lib.rs index 5d901676e1..6f6432a670 100644 --- a/services/autorust/codegen/src/lib.rs +++ b/services/autorust/codegen/src/lib.rs @@ -99,7 +99,7 @@ pub fn run<'a>(crate_config: &'a CrateConfig, package_config: &'a PackageConfig) let fix_case_properties: HashSet<&'a str> = package_config.properties.fix_case.iter().map(AsRef::as_ref).collect(); let invalid_types: HashSet = package_config.properties.invalid_type.iter().map(to_property_name).collect(); - let cg = CodeGen::new( + let mut cg = CodeGen::new( crate_config, box_properties, optional_properties, @@ -109,7 +109,7 @@ pub fn run<'a>(crate_config: &'a CrateConfig, package_config: &'a PackageConfig) // create models from schemas if crate_config.should_run(&Runs::Models) { - let models = codegen_models::create_models(&cg)?; + let models = codegen_models::create_models(&mut cg)?; let models_path = io::join(&crate_config.output_folder, "models.rs")?; write_file(models_path, &models.to_token_stream(), crate_config.print_writing_file())?; } diff --git a/services/mgmt/agrifood/src/package_preview_2023_06/models.rs b/services/mgmt/agrifood/src/package_preview_2023_06/models.rs index 338edb8e27..6a8f5d99a0 100644 --- a/services/mgmt/agrifood/src/package_preview_2023_06/models.rs +++ b/services/mgmt/agrifood/src/package_preview_2023_06/models.rs @@ -70,6 +70,12 @@ impl AuthCredentials { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AuthCredentialsUnion { + ApiKeyAuthCredentials(ApiKeyAuthCredentials), + OAuthClientCredentials(OAuthClientCredentials), +} #[doc = "Enum for different types of AuthCredentials supported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AuthCredentialsKind")] @@ -228,10 +234,10 @@ impl DataConnectorListResponse { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataConnectorProperties { #[doc = "AuthCredentials abstract base class for Auth Purpose."] - pub credentials: AuthCredentials, + pub credentials: AuthCredentialsUnion, } impl DataConnectorProperties { - pub fn new(credentials: AuthCredentials) -> Self { + pub fn new(credentials: AuthCredentialsUnion) -> Self { Self { credentials } } } diff --git a/services/mgmt/alertsmanagement/src/package_preview_2021_08/models.rs b/services/mgmt/alertsmanagement/src/package_preview_2021_08/models.rs index d4935c09cf..a02c6cc14a 100644 --- a/services/mgmt/alertsmanagement/src/package_preview_2021_08/models.rs +++ b/services/mgmt/alertsmanagement/src/package_preview_2021_08/models.rs @@ -55,6 +55,12 @@ pub mod action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum ActionUnion { + AddActionGroups(AddActionGroups), + RemoveAllActionGroups(RemoveAllActionGroups), +} #[doc = "Add action groups to alert processing rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddActionGroups { @@ -102,7 +108,7 @@ pub struct AlertProcessingRuleProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub schedule: Option, #[doc = "Actions to be applied."] - pub actions: Vec, + pub actions: Vec, #[doc = "Description of alert processing rule."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, @@ -111,7 +117,7 @@ pub struct AlertProcessingRuleProperties { pub enabled: Option, } impl AlertProcessingRuleProperties { - pub fn new(scopes: Scopes, actions: Vec) -> Self { + pub fn new(scopes: Scopes, actions: Vec) -> Self { Self { scopes, conditions: None, @@ -483,6 +489,13 @@ pub mod recurrence { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "recurrenceType")] +pub enum RecurrenceUnion { + Daily(DailyRecurrence), + Monthly(MonthlyRecurrence), + Weekly(WeeklyRecurrence), +} #[doc = "Indicates if all action groups should be removed."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RemoveAllActionGroups { @@ -530,7 +543,7 @@ pub struct Schedule { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub recurrences: Vec, + pub recurrences: Vec, } impl Schedule { pub fn new() -> Self { @@ -713,7 +726,7 @@ impl AlertsList { pub struct AlertsMetaData { #[doc = "alert meta data property bag"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AlertsMetaData { pub fn new() -> Self { @@ -770,6 +783,9 @@ pub mod alerts_meta_data_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "metadataIdentifier")] +pub enum AlertsMetaDataPropertiesUnion {} #[doc = "Summary of alerts based on the input filters and 'groupby' parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AlertsSummary { diff --git a/services/mgmt/alertsmanagement/src/package_preview_2023_05/models.rs b/services/mgmt/alertsmanagement/src/package_preview_2023_05/models.rs index 778d6ec237..a8b17031a4 100644 --- a/services/mgmt/alertsmanagement/src/package_preview_2023_05/models.rs +++ b/services/mgmt/alertsmanagement/src/package_preview_2023_05/models.rs @@ -57,6 +57,13 @@ pub mod action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum ActionUnion { + AddActionGroups(AddActionGroups), + CorrelateAlerts(CorrelateAlerts), + RemoveAllActionGroups(RemoveAllActionGroups), +} #[doc = "Add action groups to alert processing rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddActionGroups { @@ -104,7 +111,7 @@ pub struct AlertProcessingRuleProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub schedule: Option, #[doc = "Actions to be applied."] - pub actions: Vec, + pub actions: Vec, #[doc = "Description of alert processing rule."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, @@ -113,7 +120,7 @@ pub struct AlertProcessingRuleProperties { pub enabled: Option, } impl AlertProcessingRuleProperties { - pub fn new(scopes: Scopes, actions: Vec) -> Self { + pub fn new(scopes: Scopes, actions: Vec) -> Self { Self { scopes, conditions: None, @@ -539,6 +546,13 @@ pub mod recurrence { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "recurrenceType")] +pub enum RecurrenceUnion { + Daily(DailyRecurrence), + Monthly(MonthlyRecurrence), + Weekly(WeeklyRecurrence), +} #[doc = "Indicates if all action groups should be removed."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RemoveAllActionGroups { @@ -586,7 +600,7 @@ pub struct Schedule { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub recurrences: Vec, + pub recurrences: Vec, } impl Schedule { pub fn new() -> Self { diff --git a/services/mgmt/appplatform/src/package_preview_2023_01/models.rs b/services/mgmt/appplatform/src/package_preview_2023_01/models.rs index 3dc79df88f..d950689577 100644 --- a/services/mgmt/appplatform/src/package_preview_2023_01/models.rs +++ b/services/mgmt/appplatform/src/package_preview_2023_01/models.rs @@ -15,6 +15,14 @@ impl AcceleratorAuthSetting { Self { auth_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum AcceleratorAuthSettingUnion { + BasicAuth(AcceleratorBasicAuthSetting), + Public(AcceleratorPublicSetting), + #[serde(rename = "SSH")] + Ssh(AcceleratorSshSetting), +} #[doc = "Auth setting for basic auth."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AcceleratorBasicAuthSetting { @@ -53,10 +61,10 @@ pub struct AcceleratorGitRepository { pub git_tag: Option, #[doc = "Auth setting payload."] #[serde(rename = "authSetting")] - pub auth_setting: AcceleratorAuthSetting, + pub auth_setting: AcceleratorAuthSettingUnion, } impl AcceleratorGitRepository { - pub fn new(url: String, auth_setting: AcceleratorAuthSetting) -> Self { + pub fn new(url: String, auth_setting: AcceleratorAuthSettingUnion) -> Self { Self { url, interval_in_seconds: None, @@ -1877,6 +1885,12 @@ pub mod certificate_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CertificatePropertiesUnion { + ContentCertificate(ContentCertificateProperties), + KeyVaultCertificate(KeyVaultCertificateProperties), +} #[doc = "Certificate resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CertificateResource { @@ -1884,7 +1898,7 @@ pub struct CertificateResource { pub proxy_resource: ProxyResource, #[doc = "Certificate resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl CertificateResource { pub fn new() -> Self { @@ -2826,12 +2840,17 @@ pub mod custom_persistent_disk_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CustomPersistentDiskPropertiesUnion { + AzureFileVolume(AzureFileVolume), +} #[doc = "Custom persistent disk resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomPersistentDiskResource { #[doc = "Custom persistent disk resource payload."] #[serde(rename = "customPersistentDiskProperties", default, skip_serializing_if = "Option::is_none")] - pub custom_persistent_disk_properties: Option, + pub custom_persistent_disk_properties: Option, #[doc = "The resource id of Azure Spring Apps Storage resource."] #[serde(rename = "storageId")] pub storage_id: String, @@ -3135,7 +3154,7 @@ impl DeploymentResourceCollection { pub struct DeploymentResourceProperties { #[doc = "Source information for a deployment"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, + pub source: Option, #[doc = "Deployment settings payload"] #[serde(rename = "deploymentSettings", default, skip_serializing_if = "Option::is_none")] pub deployment_settings: Option, @@ -5211,7 +5230,7 @@ impl PredefinedAcceleratorResourceCollection { pub struct Probe { #[doc = "The action of the probe."] #[serde(rename = "probeAction", default, skip_serializing_if = "Option::is_none")] - pub probe_action: Option, + pub probe_action: Option, #[doc = "Indicate whether the probe is disabled."] #[serde(rename = "disableProbe")] pub disable_probe: bool, @@ -5300,6 +5319,15 @@ pub mod probe_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ProbeActionUnion { + ExecAction(ExecAction), + #[serde(rename = "HTTPGetAction")] + HttpGetAction(HttpGetAction), + #[serde(rename = "TCPSocketAction")] + TcpSocketAction(TcpSocketAction), +} #[doc = "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { @@ -6316,6 +6344,11 @@ pub mod storage_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "storageType")] +pub enum StoragePropertiesUnion { + StorageAccount(StorageAccount), +} #[doc = "Storage resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageResource { @@ -6323,7 +6356,7 @@ pub struct StorageResource { pub proxy_resource: ProxyResource, #[doc = "Storage resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl StorageResource { pub fn new() -> Self { @@ -6817,6 +6850,12 @@ impl UserSourceInfo { Self { type_, version: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserSourceInfoUnion { + BuildResult(BuildResultUserSourceInfo), + Container(CustomContainerUserSourceInfo), +} #[doc = "Validate messages of the configuration service git repositories"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationMessages { diff --git a/services/mgmt/appplatform/src/package_preview_2023_03/models.rs b/services/mgmt/appplatform/src/package_preview_2023_03/models.rs index 47185d936a..ef6146d8bc 100644 --- a/services/mgmt/appplatform/src/package_preview_2023_03/models.rs +++ b/services/mgmt/appplatform/src/package_preview_2023_03/models.rs @@ -15,6 +15,14 @@ impl AcceleratorAuthSetting { Self { auth_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum AcceleratorAuthSettingUnion { + BasicAuth(AcceleratorBasicAuthSetting), + Public(AcceleratorPublicSetting), + #[serde(rename = "SSH")] + Ssh(AcceleratorSshSetting), +} #[doc = "Auth setting for basic auth."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AcceleratorBasicAuthSetting { @@ -57,10 +65,10 @@ pub struct AcceleratorGitRepository { pub git_tag: Option, #[doc = "Auth setting payload."] #[serde(rename = "authSetting")] - pub auth_setting: AcceleratorAuthSetting, + pub auth_setting: AcceleratorAuthSettingUnion, } impl AcceleratorGitRepository { - pub fn new(url: String, auth_setting: AcceleratorAuthSetting) -> Self { + pub fn new(url: String, auth_setting: AcceleratorAuthSettingUnion) -> Self { Self { url, interval_in_seconds: None, @@ -1893,6 +1901,12 @@ pub mod certificate_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CertificatePropertiesUnion { + ContentCertificate(ContentCertificateProperties), + KeyVaultCertificate(KeyVaultCertificateProperties), +} #[doc = "Certificate resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CertificateResource { @@ -1900,7 +1914,7 @@ pub struct CertificateResource { pub proxy_resource: ProxyResource, #[doc = "Certificate resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl CertificateResource { pub fn new() -> Self { @@ -2601,17 +2615,22 @@ impl ContainerRegistryCredentials { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ContainerRegistryCredentialsUnion { + BasicAuth(ContainerRegistryBasicCredentials), +} #[doc = "Container registry resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContainerRegistryProperties { #[doc = "The credential for the container registry resource."] - pub credentials: ContainerRegistryCredentials, + pub credentials: ContainerRegistryCredentialsUnion, #[doc = "State of the Container Registry."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, } impl ContainerRegistryProperties { - pub fn new(credentials: ContainerRegistryCredentials) -> Self { + pub fn new(credentials: ContainerRegistryCredentialsUnion) -> Self { Self { credentials, provisioning_state: None, @@ -2978,12 +2997,17 @@ pub mod custom_persistent_disk_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CustomPersistentDiskPropertiesUnion { + AzureFileVolume(AzureFileVolume), +} #[doc = "Custom persistent disk resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomPersistentDiskResource { #[doc = "Custom persistent disk resource payload."] #[serde(rename = "customPersistentDiskProperties", default, skip_serializing_if = "Option::is_none")] - pub custom_persistent_disk_properties: Option, + pub custom_persistent_disk_properties: Option, #[doc = "The resource id of Azure Spring Apps Storage resource."] #[serde(rename = "storageId")] pub storage_id: String, @@ -3287,7 +3311,7 @@ impl DeploymentResourceCollection { pub struct DeploymentResourceProperties { #[doc = "Source information for a deployment"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, + pub source: Option, #[doc = "Deployment settings payload"] #[serde(rename = "deploymentSettings", default, skip_serializing_if = "Option::is_none")] pub deployment_settings: Option, @@ -5430,7 +5454,7 @@ impl PredefinedAcceleratorResourceCollection { pub struct Probe { #[doc = "The action of the probe."] #[serde(rename = "probeAction", default, skip_serializing_if = "Option::is_none")] - pub probe_action: Option, + pub probe_action: Option, #[doc = "Indicate whether the probe is disabled."] #[serde(rename = "disableProbe")] pub disable_probe: bool, @@ -5519,6 +5543,15 @@ pub mod probe_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ProbeActionUnion { + ExecAction(ExecAction), + #[serde(rename = "HTTPGetAction")] + HttpGetAction(HttpGetAction), + #[serde(rename = "TCPSocketAction")] + TcpSocketAction(TcpSocketAction), +} #[doc = "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { @@ -6538,6 +6571,11 @@ pub mod storage_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "storageType")] +pub enum StoragePropertiesUnion { + StorageAccount(StorageAccount), +} #[doc = "Storage resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageResource { @@ -6545,7 +6583,7 @@ pub struct StorageResource { pub proxy_resource: ProxyResource, #[doc = "Storage resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl StorageResource { pub fn new() -> Self { @@ -7039,6 +7077,12 @@ impl UserSourceInfo { Self { type_, version: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserSourceInfoUnion { + BuildResult(BuildResultUserSourceInfo), + Container(CustomContainerUserSourceInfo), +} #[doc = "Validate messages of the configuration service git repositories"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationMessages { diff --git a/services/mgmt/appplatform/src/package_preview_2023_05/models.rs b/services/mgmt/appplatform/src/package_preview_2023_05/models.rs index 4c93fd630c..a9d628c71a 100644 --- a/services/mgmt/appplatform/src/package_preview_2023_05/models.rs +++ b/services/mgmt/appplatform/src/package_preview_2023_05/models.rs @@ -15,6 +15,14 @@ impl AcceleratorAuthSetting { Self { auth_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum AcceleratorAuthSettingUnion { + BasicAuth(AcceleratorBasicAuthSetting), + Public(AcceleratorPublicSetting), + #[serde(rename = "SSH")] + Ssh(AcceleratorSshSetting), +} #[doc = "Auth setting for basic auth."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AcceleratorBasicAuthSetting { @@ -57,10 +65,10 @@ pub struct AcceleratorGitRepository { pub git_tag: Option, #[doc = "Auth setting payload."] #[serde(rename = "authSetting")] - pub auth_setting: AcceleratorAuthSetting, + pub auth_setting: AcceleratorAuthSettingUnion, } impl AcceleratorGitRepository { - pub fn new(url: String, auth_setting: AcceleratorAuthSetting) -> Self { + pub fn new(url: String, auth_setting: AcceleratorAuthSettingUnion) -> Self { Self { url, interval_in_seconds: None, @@ -2044,6 +2052,12 @@ pub mod certificate_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CertificatePropertiesUnion { + ContentCertificate(ContentCertificateProperties), + KeyVaultCertificate(KeyVaultCertificateProperties), +} #[doc = "A reference to the certificate"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CertificateReference { @@ -2064,7 +2078,7 @@ pub struct CertificateResource { pub proxy_resource: ProxyResource, #[doc = "Certificate resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl CertificateResource { pub fn new() -> Self { @@ -2858,17 +2872,22 @@ impl ContainerRegistryCredentials { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ContainerRegistryCredentialsUnion { + BasicAuth(ContainerRegistryBasicCredentials), +} #[doc = "Container registry resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContainerRegistryProperties { #[doc = "The credential for the container registry resource."] - pub credentials: ContainerRegistryCredentials, + pub credentials: ContainerRegistryCredentialsUnion, #[doc = "State of the Container Registry."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, } impl ContainerRegistryProperties { - pub fn new(credentials: ContainerRegistryCredentials) -> Self { + pub fn new(credentials: ContainerRegistryCredentialsUnion) -> Self { Self { credentials, provisioning_state: None, @@ -3252,12 +3271,17 @@ pub mod custom_persistent_disk_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CustomPersistentDiskPropertiesUnion { + AzureFileVolume(AzureFileVolume), +} #[doc = "Custom persistent disk resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomPersistentDiskResource { #[doc = "Custom persistent disk resource payload."] #[serde(rename = "customPersistentDiskProperties", default, skip_serializing_if = "Option::is_none")] - pub custom_persistent_disk_properties: Option, + pub custom_persistent_disk_properties: Option, #[doc = "The resource id of Azure Spring Apps Storage resource."] #[serde(rename = "storageId")] pub storage_id: String, @@ -3561,7 +3585,7 @@ impl DeploymentResourceCollection { pub struct DeploymentResourceProperties { #[doc = "Source information for a deployment"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, + pub source: Option, #[doc = "Deployment settings payload"] #[serde(rename = "deploymentSettings", default, skip_serializing_if = "Option::is_none")] pub deployment_settings: Option, @@ -5905,7 +5929,7 @@ impl PredefinedAcceleratorResourceCollection { pub struct Probe { #[doc = "The action of the probe."] #[serde(rename = "probeAction", default, skip_serializing_if = "Option::is_none")] - pub probe_action: Option, + pub probe_action: Option, #[doc = "Indicate whether the probe is disabled."] #[serde(rename = "disableProbe")] pub disable_probe: bool, @@ -5994,6 +6018,15 @@ pub mod probe_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ProbeActionUnion { + ExecAction(ExecAction), + #[serde(rename = "HTTPGetAction")] + HttpGetAction(HttpGetAction), + #[serde(rename = "TCPSocketAction")] + TcpSocketAction(TcpSocketAction), +} #[doc = "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { @@ -7013,6 +7046,11 @@ pub mod storage_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "storageType")] +pub enum StoragePropertiesUnion { + StorageAccount(StorageAccount), +} #[doc = "Storage resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageResource { @@ -7020,7 +7058,7 @@ pub struct StorageResource { pub proxy_resource: ProxyResource, #[doc = "Storage resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl StorageResource { pub fn new() -> Self { @@ -7551,6 +7589,12 @@ impl UserSourceInfo { Self { type_, version: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserSourceInfoUnion { + BuildResult(BuildResultUserSourceInfo), + Container(CustomContainerUserSourceInfo), +} #[doc = "Validate messages of the configuration service git repositories"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationMessages { diff --git a/services/mgmt/appplatform/src/package_preview_2023_07/models.rs b/services/mgmt/appplatform/src/package_preview_2023_07/models.rs index ba41ecf848..9ed37f2079 100644 --- a/services/mgmt/appplatform/src/package_preview_2023_07/models.rs +++ b/services/mgmt/appplatform/src/package_preview_2023_07/models.rs @@ -15,6 +15,14 @@ impl AcceleratorAuthSetting { Self { auth_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum AcceleratorAuthSettingUnion { + BasicAuth(AcceleratorBasicAuthSetting), + Public(AcceleratorPublicSetting), + #[serde(rename = "SSH")] + Ssh(AcceleratorSshSetting), +} #[doc = "Auth setting for basic auth."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AcceleratorBasicAuthSetting { @@ -57,10 +65,10 @@ pub struct AcceleratorGitRepository { pub git_tag: Option, #[doc = "Auth setting payload."] #[serde(rename = "authSetting")] - pub auth_setting: AcceleratorAuthSetting, + pub auth_setting: AcceleratorAuthSettingUnion, } impl AcceleratorGitRepository { - pub fn new(url: String, auth_setting: AcceleratorAuthSetting) -> Self { + pub fn new(url: String, auth_setting: AcceleratorAuthSettingUnion) -> Self { Self { url, interval_in_seconds: None, @@ -2044,6 +2052,12 @@ pub mod certificate_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CertificatePropertiesUnion { + ContentCertificate(ContentCertificateProperties), + KeyVaultCertificate(KeyVaultCertificateProperties), +} #[doc = "A reference to the certificate"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CertificateReference { @@ -2064,7 +2078,7 @@ pub struct CertificateResource { pub proxy_resource: ProxyResource, #[doc = "Certificate resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl CertificateResource { pub fn new() -> Self { @@ -2153,7 +2167,7 @@ pub struct ClusterResourceProperties { pub vnet_addons: Option, #[doc = "Configuration for the planned maintenance"] #[serde(rename = "maintenanceScheduleConfiguration", default, skip_serializing_if = "Option::is_none")] - pub maintenance_schedule_configuration: Option, + pub maintenance_schedule_configuration: Option, #[doc = "Version of the Service"] #[serde(default, skip_serializing_if = "Option::is_none")] pub version: Option, @@ -2861,17 +2875,22 @@ impl ContainerRegistryCredentials { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ContainerRegistryCredentialsUnion { + BasicAuth(ContainerRegistryBasicCredentials), +} #[doc = "Container registry resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContainerRegistryProperties { #[doc = "The credential for the container registry resource."] - pub credentials: ContainerRegistryCredentials, + pub credentials: ContainerRegistryCredentialsUnion, #[doc = "State of the Container Registry."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, } impl ContainerRegistryProperties { - pub fn new(credentials: ContainerRegistryCredentials) -> Self { + pub fn new(credentials: ContainerRegistryCredentialsUnion) -> Self { Self { credentials, provisioning_state: None, @@ -3255,12 +3274,17 @@ pub mod custom_persistent_disk_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CustomPersistentDiskPropertiesUnion { + AzureFileVolume(AzureFileVolume), +} #[doc = "Custom persistent disk resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomPersistentDiskResource { #[doc = "Custom persistent disk resource payload."] #[serde(rename = "customPersistentDiskProperties", default, skip_serializing_if = "Option::is_none")] - pub custom_persistent_disk_properties: Option, + pub custom_persistent_disk_properties: Option, #[doc = "The resource id of Azure Spring Apps Storage resource."] #[serde(rename = "storageId")] pub storage_id: String, @@ -3564,7 +3588,7 @@ impl DeploymentResourceCollection { pub struct DeploymentResourceProperties { #[doc = "Source information for a deployment"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, + pub source: Option, #[doc = "Deployment settings payload"] #[serde(rename = "deploymentSettings", default, skip_serializing_if = "Option::is_none")] pub deployment_settings: Option, @@ -5326,6 +5350,11 @@ pub mod maintenance_schedule_configuration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "frequency")] +pub enum MaintenanceScheduleConfigurationUnion { + Weekly(WeeklyMaintenanceScheduleConfiguration), +} #[doc = "Managed identity properties retrieved from ARM request headers."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ManagedIdentityProperties { @@ -5957,7 +5986,7 @@ impl PredefinedAcceleratorResourceCollection { pub struct Probe { #[doc = "The action of the probe."] #[serde(rename = "probeAction", default, skip_serializing_if = "Option::is_none")] - pub probe_action: Option, + pub probe_action: Option, #[doc = "Indicate whether the probe is disabled."] #[serde(rename = "disableProbe")] pub disable_probe: bool, @@ -6046,6 +6075,15 @@ pub mod probe_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ProbeActionUnion { + ExecAction(ExecAction), + #[serde(rename = "HTTPGetAction")] + HttpGetAction(HttpGetAction), + #[serde(rename = "TCPSocketAction")] + TcpSocketAction(TcpSocketAction), +} #[doc = "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { @@ -7065,6 +7103,11 @@ pub mod storage_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "storageType")] +pub enum StoragePropertiesUnion { + StorageAccount(StorageAccount), +} #[doc = "Storage resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageResource { @@ -7072,7 +7115,7 @@ pub struct StorageResource { pub proxy_resource: ProxyResource, #[doc = "Storage resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl StorageResource { pub fn new() -> Self { @@ -7603,6 +7646,12 @@ impl UserSourceInfo { Self { type_, version: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserSourceInfoUnion { + BuildResult(BuildResultUserSourceInfo), + Container(CustomContainerUserSourceInfo), +} #[doc = "Validate messages of the configuration service git repositories"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationMessages { diff --git a/services/mgmt/appplatform/src/package_preview_2023_09/models.rs b/services/mgmt/appplatform/src/package_preview_2023_09/models.rs index 531c4f00f9..67d68500ee 100644 --- a/services/mgmt/appplatform/src/package_preview_2023_09/models.rs +++ b/services/mgmt/appplatform/src/package_preview_2023_09/models.rs @@ -15,6 +15,14 @@ impl AcceleratorAuthSetting { Self { auth_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum AcceleratorAuthSettingUnion { + BasicAuth(AcceleratorBasicAuthSetting), + Public(AcceleratorPublicSetting), + #[serde(rename = "SSH")] + Ssh(AcceleratorSshSetting), +} #[doc = "Auth setting for basic auth."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AcceleratorBasicAuthSetting { @@ -57,13 +65,13 @@ pub struct AcceleratorGitRepository { pub git_tag: Option, #[doc = "Auth setting payload."] #[serde(rename = "authSetting")] - pub auth_setting: AcceleratorAuthSetting, + pub auth_setting: AcceleratorAuthSettingUnion, #[doc = "Folder path inside the git repository to consider as the root of the accelerator or fragment."] #[serde(rename = "subPath", default, skip_serializing_if = "Option::is_none")] pub sub_path: Option, } impl AcceleratorGitRepository { - pub fn new(url: String, auth_setting: AcceleratorAuthSetting) -> Self { + pub fn new(url: String, auth_setting: AcceleratorAuthSettingUnion) -> Self { Self { url, interval_in_seconds: None, @@ -2048,6 +2056,12 @@ pub mod certificate_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CertificatePropertiesUnion { + ContentCertificate(ContentCertificateProperties), + KeyVaultCertificate(KeyVaultCertificateProperties), +} #[doc = "A reference to the certificate"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CertificateReference { @@ -2068,7 +2082,7 @@ pub struct CertificateResource { pub proxy_resource: ProxyResource, #[doc = "Certificate resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl CertificateResource { pub fn new() -> Self { @@ -2157,7 +2171,7 @@ pub struct ClusterResourceProperties { pub vnet_addons: Option, #[doc = "Configuration for the planned maintenance"] #[serde(rename = "maintenanceScheduleConfiguration", default, skip_serializing_if = "Option::is_none")] - pub maintenance_schedule_configuration: Option, + pub maintenance_schedule_configuration: Option, #[doc = "Version of the Service"] #[serde(default, skip_serializing_if = "Option::is_none")] pub version: Option, @@ -2865,17 +2879,22 @@ impl ContainerRegistryCredentials { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ContainerRegistryCredentialsUnion { + BasicAuth(ContainerRegistryBasicCredentials), +} #[doc = "Container registry resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContainerRegistryProperties { #[doc = "The credential for the container registry resource."] - pub credentials: ContainerRegistryCredentials, + pub credentials: ContainerRegistryCredentialsUnion, #[doc = "State of the Container Registry."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, } impl ContainerRegistryProperties { - pub fn new(credentials: ContainerRegistryCredentials) -> Self { + pub fn new(credentials: ContainerRegistryCredentialsUnion) -> Self { Self { credentials, provisioning_state: None, @@ -3259,12 +3278,17 @@ pub mod custom_persistent_disk_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CustomPersistentDiskPropertiesUnion { + AzureFileVolume(AzureFileVolume), +} #[doc = "Custom persistent disk resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomPersistentDiskResource { #[doc = "Custom persistent disk resource payload."] #[serde(rename = "customPersistentDiskProperties", default, skip_serializing_if = "Option::is_none")] - pub custom_persistent_disk_properties: Option, + pub custom_persistent_disk_properties: Option, #[doc = "The resource id of Azure Spring Apps Storage resource."] #[serde(rename = "storageId")] pub storage_id: String, @@ -3617,7 +3641,7 @@ impl DeploymentResourceCollection { pub struct DeploymentResourceProperties { #[doc = "Source information for a deployment"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, + pub source: Option, #[doc = "Deployment settings payload"] #[serde(rename = "deploymentSettings", default, skip_serializing_if = "Option::is_none")] pub deployment_settings: Option, @@ -5431,6 +5455,11 @@ pub mod maintenance_schedule_configuration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "frequency")] +pub enum MaintenanceScheduleConfigurationUnion { + Weekly(WeeklyMaintenanceScheduleConfiguration), +} #[doc = "Managed identity properties retrieved from ARM request headers."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ManagedIdentityProperties { @@ -6062,7 +6091,7 @@ impl PredefinedAcceleratorResourceCollection { pub struct Probe { #[doc = "The action of the probe."] #[serde(rename = "probeAction", default, skip_serializing_if = "Option::is_none")] - pub probe_action: Option, + pub probe_action: Option, #[doc = "Indicate whether the probe is disabled."] #[serde(rename = "disableProbe")] pub disable_probe: bool, @@ -6151,6 +6180,15 @@ pub mod probe_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ProbeActionUnion { + ExecAction(ExecAction), + #[serde(rename = "HTTPGetAction")] + HttpGetAction(HttpGetAction), + #[serde(rename = "TCPSocketAction")] + TcpSocketAction(TcpSocketAction), +} #[doc = "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { @@ -7170,6 +7208,11 @@ pub mod storage_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "storageType")] +pub enum StoragePropertiesUnion { + StorageAccount(StorageAccount), +} #[doc = "Storage resource payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageResource { @@ -7177,7 +7220,7 @@ pub struct StorageResource { pub proxy_resource: ProxyResource, #[doc = "Storage resource payload."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl StorageResource { pub fn new() -> Self { @@ -7751,6 +7794,12 @@ impl UserSourceInfo { Self { type_, version: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserSourceInfoUnion { + BuildResult(BuildResultUserSourceInfo), + Container(CustomContainerUserSourceInfo), +} #[doc = "Validate messages of the configuration service git repositories"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationMessages { diff --git a/services/mgmt/authorization/src/package_2020_10_01_preview/models.rs b/services/mgmt/authorization/src/package_2020_10_01_preview/models.rs index cb0b8f9ca5..a468d54c1a 100644 --- a/services/mgmt/authorization/src/package_2020_10_01_preview/models.rs +++ b/services/mgmt/authorization/src/package_2020_10_01_preview/models.rs @@ -117,7 +117,7 @@ impl AccessReviewDecisionListResult { pub struct AccessReviewDecisionProperties { #[doc = "Target of the decision."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, + pub target: Option, #[doc = "The feature- generated recommendation shown to the reviewer."] #[serde(default, skip_serializing_if = "Option::is_none")] pub recommendation: Option, @@ -334,6 +334,14 @@ pub mod access_review_decision_target { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AccessReviewDecisionTargetUnion { + #[serde(rename = "servicePrincipal")] + ServicePrincipal(ServicePrincipalDecisionTarget), + #[serde(rename = "user")] + User(UserDecisionTarget), +} #[doc = "Access Review Default Settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessReviewDefaultSettings { @@ -4591,7 +4599,7 @@ pub struct RoleManagementPolicyProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, #[doc = "The readonly computed rule applied to the policy."] #[serde( rename = "effectiveRules", @@ -4599,7 +4607,7 @@ pub struct RoleManagementPolicyProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub effective_rules: Vec, + pub effective_rules: Vec, #[serde(rename = "policyProperties", default, skip_serializing_if = "Option::is_none")] pub policy_properties: Option, } @@ -4630,6 +4638,9 @@ impl RoleManagementPolicyRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum RoleManagementPolicyRuleUnion {} #[doc = "The role management policy rule target."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleManagementPolicyRuleTarget { diff --git a/services/mgmt/authorization/src/package_2022_04_01/models.rs b/services/mgmt/authorization/src/package_2022_04_01/models.rs index 9640871e58..7f2ad6c4f5 100644 --- a/services/mgmt/authorization/src/package_2022_04_01/models.rs +++ b/services/mgmt/authorization/src/package_2022_04_01/models.rs @@ -3301,7 +3301,7 @@ pub struct RoleManagementPolicyAssignmentProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub effective_rules: Vec, + pub effective_rules: Vec, #[doc = "Expanded info of resource scope, role definition and policy"] #[serde(rename = "policyAssignmentProperties", default, skip_serializing_if = "Option::is_none")] pub policy_assignment_properties: Option, @@ -3581,7 +3581,7 @@ pub struct RoleManagementPolicyProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, #[doc = "The readonly computed rule applied to the policy."] #[serde( rename = "effectiveRules", @@ -3589,7 +3589,7 @@ pub struct RoleManagementPolicyProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub effective_rules: Vec, + pub effective_rules: Vec, #[doc = "Expanded info of resource scope"] #[serde(rename = "policyProperties", default, skip_serializing_if = "Option::is_none")] pub policy_properties: Option, @@ -3621,6 +3621,9 @@ impl RoleManagementPolicyRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum RoleManagementPolicyRuleUnion {} #[doc = "The role management policy rule target."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleManagementPolicyRuleTarget { diff --git a/services/mgmt/authorization/src/package_2022_05_01_preview/models.rs b/services/mgmt/authorization/src/package_2022_05_01_preview/models.rs index 11ddf5ab50..ff0f9b7a73 100644 --- a/services/mgmt/authorization/src/package_2022_05_01_preview/models.rs +++ b/services/mgmt/authorization/src/package_2022_05_01_preview/models.rs @@ -215,6 +215,14 @@ pub mod access_review_decision_identity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AccessReviewDecisionIdentityUnion { + #[serde(rename = "servicePrincipal")] + ServicePrincipal(AccessReviewDecisionServicePrincipalIdentity), + #[serde(rename = "user")] + User(AccessReviewDecisionUserIdentity), +} #[doc = "Access Review Decision Insight."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessReviewDecisionInsight { @@ -229,7 +237,7 @@ pub struct AccessReviewDecisionInsight { pub type_: Option, #[doc = "Details of the Insight."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AccessReviewDecisionInsight { pub fn new() -> Self { @@ -293,6 +301,12 @@ pub mod access_review_decision_insight_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AccessReviewDecisionInsightPropertiesUnion { + #[serde(rename = "userSignInInsight")] + UserSignInInsight(AccessReviewDecisionUserSignInInsightProperties), +} #[doc = "List of access review decisions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessReviewDecisionListResult { @@ -340,7 +354,7 @@ impl AccessReviewDecisionPrincipalResourceMembership { pub struct AccessReviewDecisionProperties { #[doc = "Target of the decision."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub principal: Option, + pub principal: Option, #[doc = "Target of the decision."] #[serde(default, skip_serializing_if = "Option::is_none")] pub resource: Option, @@ -1747,7 +1761,7 @@ pub struct AlertConfiguration { pub type_: Option, #[doc = "Alert configuration properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AlertConfiguration { pub fn new() -> Self { @@ -1809,6 +1823,14 @@ impl AlertConfigurationProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "alertConfigurationType")] +pub enum AlertConfigurationPropertiesUnion { + AzureRolesAssignedOutsidePimAlertConfiguration(AzureRolesAssignedOutsidePimAlertConfigurationProperties), + DuplicateRoleCreatedAlertConfiguration(DuplicateRoleCreatedAlertConfigurationProperties), + TooManyOwnersAssignedToResourceAlertConfiguration(TooManyOwnersAssignedToResourceAlertConfigurationProperties), + TooManyPermanentOwnersAssignedToResourceAlertConfiguration(TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties), +} #[doc = "Alert definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AlertDefinition { @@ -1947,7 +1969,7 @@ pub struct AlertIncident { pub type_: Option, #[doc = "Alert incident properties"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AlertIncident { pub fn new() -> Self { @@ -1991,6 +2013,14 @@ impl AlertIncidentProperties { Self { alert_incident_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "alertIncidentType")] +pub enum AlertIncidentPropertiesUnion { + AzureRolesAssignedOutsidePimAlertIncident(AzureRolesAssignedOutsidePimAlertIncidentProperties), + DuplicateRoleCreatedAlertIncident(DuplicateRoleCreatedAlertIncidentProperties), + TooManyOwnersAssignedToResourceAlertIncident(TooManyOwnersAssignedToResourceAlertIncidentProperties), + TooManyPermanentOwnersAssignedToResourceAlertIncident(TooManyPermanentOwnersAssignedToResourceAlertIncidentProperties), +} #[doc = "Alert list operation result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AlertListResult { @@ -5920,7 +5950,7 @@ pub struct RoleManagementPolicyProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, #[doc = "The readonly computed rule applied to the policy."] #[serde( rename = "effectiveRules", @@ -5928,7 +5958,7 @@ pub struct RoleManagementPolicyProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub effective_rules: Vec, + pub effective_rules: Vec, #[serde(rename = "policyProperties", default, skip_serializing_if = "Option::is_none")] pub policy_properties: Option, } @@ -5959,6 +5989,9 @@ impl RoleManagementPolicyRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum RoleManagementPolicyRuleUnion {} #[doc = "The role management policy rule target."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleManagementPolicyRuleTarget { diff --git a/services/mgmt/authorization/src/package_preview_2021_11/models.rs b/services/mgmt/authorization/src/package_preview_2021_11/models.rs index b578625422..32507c9695 100644 --- a/services/mgmt/authorization/src/package_preview_2021_11/models.rs +++ b/services/mgmt/authorization/src/package_preview_2021_11/models.rs @@ -215,6 +215,14 @@ pub mod access_review_decision_identity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AccessReviewDecisionIdentityUnion { + #[serde(rename = "servicePrincipal")] + ServicePrincipal(AccessReviewDecisionServicePrincipalIdentity), + #[serde(rename = "user")] + User(AccessReviewDecisionUserIdentity), +} #[doc = "List of access review decisions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessReviewDecisionListResult { @@ -245,10 +253,10 @@ impl AccessReviewDecisionListResult { pub struct AccessReviewDecisionProperties { #[doc = "Target of the decision."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub principal: Option, + pub principal: Option, #[doc = "Target of the decision."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, + pub resource: Option, #[doc = "The feature- generated recommendation shown to the reviewer."] #[serde(default, skip_serializing_if = "Option::is_none")] pub recommendation: Option, @@ -472,6 +480,12 @@ pub mod access_review_decision_resource { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AccessReviewDecisionResourceUnion { + #[serde(rename = "azureRole")] + AzureRole(AccessReviewDecisionResourceAzureRole), +} #[doc = "Target of the decision."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessReviewDecisionResourceAzureRole { diff --git a/services/mgmt/blueprint/src/package_2017_11_preview/mod.rs b/services/mgmt/blueprint/src/package_2017_11_preview/mod.rs index 0641885d32..04cb63c059 100644 --- a/services/mgmt/blueprint/src/package_2017_11_preview/mod.rs +++ b/services/mgmt/blueprint/src/package_2017_11_preview/mod.rs @@ -666,7 +666,7 @@ pub mod artifacts { management_group_name: impl Into, blueprint_name: impl Into, artifact_name: impl Into, - artifact: impl Into, + artifact: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -717,9 +717,9 @@ pub mod artifacts { #[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::Artifact = serde_json::from_slice(&bytes)?; + let body: models::ArtifactUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -804,8 +804,8 @@ pub mod artifacts { } } 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`."] @@ -825,9 +825,9 @@ pub mod artifacts { #[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::Artifact = serde_json::from_slice(&bytes)?; + let body: models::ArtifactUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -871,7 +871,7 @@ pub mod artifacts { pub(crate) management_group_name: String, pub(crate) blueprint_name: String, pub(crate) artifact_name: String, - pub(crate) artifact: models::Artifact, + pub(crate) artifact: models::ArtifactUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -914,8 +914,8 @@ pub mod artifacts { } } 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`."] @@ -935,9 +935,9 @@ pub mod artifacts { #[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::Artifact = serde_json::from_slice(&bytes)?; + let body: models::ArtifactUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1022,8 +1022,8 @@ pub mod artifacts { } } 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`."] @@ -1745,9 +1745,9 @@ pub mod published_artifacts { #[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::Artifact = serde_json::from_slice(&bytes)?; + let body: models::ArtifactUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1827,8 +1827,8 @@ pub mod published_artifacts { } } 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`."] diff --git a/services/mgmt/blueprint/src/package_2017_11_preview/models.rs b/services/mgmt/blueprint/src/package_2017_11_preview/models.rs index 98a9ad1368..d53a2fcb61 100644 --- a/services/mgmt/blueprint/src/package_2017_11_preview/models.rs +++ b/services/mgmt/blueprint/src/package_2017_11_preview/models.rs @@ -64,6 +64,16 @@ pub mod artifact { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ArtifactUnion { + #[serde(rename = "policyAssignment")] + PolicyAssignment(PolicyAssignmentArtifact), + #[serde(rename = "roleAssignment")] + RoleAssignment(RoleAssignmentArtifact), + #[serde(rename = "template")] + Template(TemplateArtifact), +} #[doc = "List of Blueprint artifacts"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactList { @@ -73,7 +83,7 @@ pub struct ArtifactList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next page of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/blueprint/src/package_2018_11_preview/mod.rs b/services/mgmt/blueprint/src/package_2018_11_preview/mod.rs index 747afefb27..5aa687efba 100644 --- a/services/mgmt/blueprint/src/package_2018_11_preview/mod.rs +++ b/services/mgmt/blueprint/src/package_2018_11_preview/mod.rs @@ -666,7 +666,7 @@ pub mod artifacts { resource_scope: impl Into, blueprint_name: impl Into, artifact_name: impl Into, - artifact: impl Into, + artifact: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -717,9 +717,9 @@ pub mod artifacts { #[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::Artifact = serde_json::from_slice(&bytes)?; + let body: models::ArtifactUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -804,8 +804,8 @@ pub mod artifacts { } } 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`."] @@ -825,9 +825,9 @@ pub mod artifacts { #[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::Artifact = serde_json::from_slice(&bytes)?; + let body: models::ArtifactUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -871,7 +871,7 @@ pub mod artifacts { pub(crate) resource_scope: String, pub(crate) blueprint_name: String, pub(crate) artifact_name: String, - pub(crate) artifact: models::Artifact, + pub(crate) artifact: models::ArtifactUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -914,8 +914,8 @@ pub mod artifacts { } } 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`."] @@ -935,9 +935,9 @@ pub mod artifacts { #[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::Artifact = serde_json::from_slice(&bytes)?; + let body: models::ArtifactUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1022,8 +1022,8 @@ pub mod artifacts { } } 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`."] @@ -1757,9 +1757,9 @@ pub mod published_artifacts { #[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::Artifact = serde_json::from_slice(&bytes)?; + let body: models::ArtifactUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1846,8 +1846,8 @@ pub mod published_artifacts { } } 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`."] diff --git a/services/mgmt/blueprint/src/package_2018_11_preview/models.rs b/services/mgmt/blueprint/src/package_2018_11_preview/models.rs index a8d939115e..e2465b6105 100644 --- a/services/mgmt/blueprint/src/package_2018_11_preview/models.rs +++ b/services/mgmt/blueprint/src/package_2018_11_preview/models.rs @@ -64,6 +64,16 @@ pub mod artifact { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ArtifactUnion { + #[serde(rename = "policyAssignment")] + PolicyAssignment(PolicyAssignmentArtifact), + #[serde(rename = "roleAssignment")] + RoleAssignment(RoleAssignmentArtifact), + #[serde(rename = "template")] + Template(TemplateArtifact), +} #[doc = "List of blueprint artifacts."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactList { @@ -73,7 +83,7 @@ pub struct ArtifactList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next page of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/botservice/src/package_2020_06_02/models.rs b/services/mgmt/botservice/src/package_2020_06_02/models.rs index b6b869a8cd..5499277ee0 100644 --- a/services/mgmt/botservice/src/package_2020_06_02/models.rs +++ b/services/mgmt/botservice/src/package_2020_06_02/models.rs @@ -64,7 +64,7 @@ pub struct BotChannel { pub resource: Resource, #[doc = "Channel definition"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BotChannel { pub fn new() -> Self { @@ -192,6 +192,23 @@ impl Channel { Self { channel_name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "channelName")] +pub enum ChannelUnion { + AlexaChannel(AlexaChannel), + DirectLineChannel(DirectLineChannel), + DirectLineSpeechChannel(DirectLineSpeechChannel), + EmailChannel(EmailChannel), + FacebookChannel(FacebookChannel), + KikChannel(KikChannel), + LineChannel(LineChannel), + MsTeamsChannel(MsTeamsChannel), + SkypeChannel(SkypeChannel), + SlackChannel(SlackChannel), + SmsChannel(SmsChannel), + TelegramChannel(TelegramChannel), + WebChatChannel(WebChatChannel), +} #[doc = "The list of bot service channel operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChannelResponseList { diff --git a/services/mgmt/botservice/src/package_2021_03_01/models.rs b/services/mgmt/botservice/src/package_2021_03_01/models.rs index eea76c87a2..24b2ff91f2 100644 --- a/services/mgmt/botservice/src/package_2021_03_01/models.rs +++ b/services/mgmt/botservice/src/package_2021_03_01/models.rs @@ -75,7 +75,7 @@ pub struct BotChannel { pub resource: Resource, #[doc = "Channel definition"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BotChannel { pub fn new() -> Self { @@ -378,6 +378,29 @@ impl Channel { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "channelName")] +pub enum ChannelUnion { + AcsChatChannel(AcsChatChannel), + AlexaChannel(AlexaChannel), + DirectLineChannel(DirectLineChannel), + DirectLineSpeechChannel(DirectLineSpeechChannel), + EmailChannel(EmailChannel), + FacebookChannel(FacebookChannel), + KikChannel(KikChannel), + LineChannel(LineChannel), + M365Extensions(M365Extensions), + MsTeamsChannel(MsTeamsChannel), + Omnichannel(Omnichannel), + OutlookChannel(OutlookChannel), + SearchAssistant(SearchAssistant), + SkypeChannel(SkypeChannel), + SlackChannel(SlackChannel), + SmsChannel(SmsChannel), + TelegramChannel(TelegramChannel), + TelephonyChannel(TelephonyChannel), + WebChatChannel(WebChatChannel), +} #[doc = "The list of bot service channel operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChannelResponseList { @@ -1002,7 +1025,7 @@ pub struct ListChannelWithKeysResponse { pub bot_channel: BotChannel, #[doc = "Channel definition"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, + pub resource: Option, #[doc = "Channel settings definition"] #[serde(default, skip_serializing_if = "Option::is_none")] pub setting: Option, diff --git a/services/mgmt/botservice/src/package_2022_09/models.rs b/services/mgmt/botservice/src/package_2022_09/models.rs index 61cd8135e5..4296edeff4 100644 --- a/services/mgmt/botservice/src/package_2022_09/models.rs +++ b/services/mgmt/botservice/src/package_2022_09/models.rs @@ -75,7 +75,7 @@ pub struct BotChannel { pub resource: Resource, #[doc = "Channel definition"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BotChannel { pub fn new() -> Self { @@ -387,6 +387,29 @@ impl Channel { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "channelName")] +pub enum ChannelUnion { + AcsChatChannel(AcsChatChannel), + AlexaChannel(AlexaChannel), + DirectLineChannel(DirectLineChannel), + DirectLineSpeechChannel(DirectLineSpeechChannel), + EmailChannel(EmailChannel), + FacebookChannel(FacebookChannel), + KikChannel(KikChannel), + LineChannel(LineChannel), + M365Extensions(M365Extensions), + MsTeamsChannel(MsTeamsChannel), + Omnichannel(Omnichannel), + OutlookChannel(OutlookChannel), + SearchAssistant(SearchAssistant), + SkypeChannel(SkypeChannel), + SlackChannel(SlackChannel), + SmsChannel(SmsChannel), + TelegramChannel(TelegramChannel), + TelephonyChannel(TelephonyChannel), + WebChatChannel(WebChatChannel), +} #[doc = "The list of bot service channel operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChannelResponseList { @@ -1047,7 +1070,7 @@ pub struct ListChannelWithKeysResponse { pub bot_channel: BotChannel, #[doc = "Channel definition"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, + pub resource: Option, #[doc = "Channel settings definition"] #[serde(default, skip_serializing_if = "Option::is_none")] pub setting: Option, diff --git a/services/mgmt/botservice/src/package_preview_2021_05/models.rs b/services/mgmt/botservice/src/package_preview_2021_05/models.rs index e77f8fcc8d..8dc482dc5f 100644 --- a/services/mgmt/botservice/src/package_preview_2021_05/models.rs +++ b/services/mgmt/botservice/src/package_preview_2021_05/models.rs @@ -75,7 +75,7 @@ pub struct BotChannel { pub resource: Resource, #[doc = "Channel definition"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BotChannel { pub fn new() -> Self { @@ -387,6 +387,29 @@ impl Channel { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "channelName")] +pub enum ChannelUnion { + AcsChatChannel(AcsChatChannel), + AlexaChannel(AlexaChannel), + DirectLineChannel(DirectLineChannel), + DirectLineSpeechChannel(DirectLineSpeechChannel), + EmailChannel(EmailChannel), + FacebookChannel(FacebookChannel), + KikChannel(KikChannel), + LineChannel(LineChannel), + M365Extensions(M365Extensions), + MsTeamsChannel(MsTeamsChannel), + Omnichannel(Omnichannel), + OutlookChannel(OutlookChannel), + SearchAssistant(SearchAssistant), + SkypeChannel(SkypeChannel), + SlackChannel(SlackChannel), + SmsChannel(SmsChannel), + TelegramChannel(TelegramChannel), + TelephonyChannel(TelephonyChannel), + WebChatChannel(WebChatChannel), +} #[doc = "The list of bot service channel operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChannelResponseList { @@ -1017,7 +1040,7 @@ pub struct ListChannelWithKeysResponse { pub bot_channel: BotChannel, #[doc = "Channel definition"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, + pub resource: Option, #[doc = "Channel settings definition"] #[serde(default, skip_serializing_if = "Option::is_none")] pub setting: Option, diff --git a/services/mgmt/botservice/src/package_preview_2022_06/models.rs b/services/mgmt/botservice/src/package_preview_2022_06/models.rs index 61cd8135e5..4296edeff4 100644 --- a/services/mgmt/botservice/src/package_preview_2022_06/models.rs +++ b/services/mgmt/botservice/src/package_preview_2022_06/models.rs @@ -75,7 +75,7 @@ pub struct BotChannel { pub resource: Resource, #[doc = "Channel definition"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BotChannel { pub fn new() -> Self { @@ -387,6 +387,29 @@ impl Channel { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "channelName")] +pub enum ChannelUnion { + AcsChatChannel(AcsChatChannel), + AlexaChannel(AlexaChannel), + DirectLineChannel(DirectLineChannel), + DirectLineSpeechChannel(DirectLineSpeechChannel), + EmailChannel(EmailChannel), + FacebookChannel(FacebookChannel), + KikChannel(KikChannel), + LineChannel(LineChannel), + M365Extensions(M365Extensions), + MsTeamsChannel(MsTeamsChannel), + Omnichannel(Omnichannel), + OutlookChannel(OutlookChannel), + SearchAssistant(SearchAssistant), + SkypeChannel(SkypeChannel), + SlackChannel(SlackChannel), + SmsChannel(SmsChannel), + TelegramChannel(TelegramChannel), + TelephonyChannel(TelephonyChannel), + WebChatChannel(WebChatChannel), +} #[doc = "The list of bot service channel operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChannelResponseList { @@ -1047,7 +1070,7 @@ pub struct ListChannelWithKeysResponse { pub bot_channel: BotChannel, #[doc = "Channel definition"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, + pub resource: Option, #[doc = "Channel settings definition"] #[serde(default, skip_serializing_if = "Option::is_none")] pub setting: Option, diff --git a/services/mgmt/cdn/src/package_2020_09/mod.rs b/services/mgmt/cdn/src/package_2020_09/mod.rs index faf542c1fa..fc0cd388da 100644 --- a/services/mgmt/cdn/src/package_2020_09/mod.rs +++ b/services/mgmt/cdn/src/package_2020_09/mod.rs @@ -5264,13 +5264,13 @@ pub mod custom_domains { pub(crate) endpoint_name: String, pub(crate) custom_domain_name: String, pub(crate) subscription_id: String, - pub(crate) custom_domain_https_parameters: Option, + pub(crate) custom_domain_https_parameters: Option, } impl RequestBuilder { #[doc = "The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default."] pub fn custom_domain_https_parameters( mut self, - custom_domain_https_parameters: impl Into, + custom_domain_https_parameters: impl Into, ) -> Self { self.custom_domain_https_parameters = Some(custom_domain_https_parameters.into()); self diff --git a/services/mgmt/cdn/src/package_2020_09/models.rs b/services/mgmt/cdn/src/package_2020_09/models.rs index 9b31da3f74..266754fefb 100644 --- a/services/mgmt/cdn/src/package_2020_09/models.rs +++ b/services/mgmt/cdn/src/package_2020_09/models.rs @@ -1622,6 +1622,12 @@ pub mod custom_domain_https_parameters { Tls12, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "certificateSource")] +pub enum CustomDomainHttpsParametersUnion { + Cdn(CdnManagedHttpsParameters), + AzureKeyVault(UserManagedHttpsParameters), +} #[doc = "Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next set of results."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomDomainListResult { @@ -1676,7 +1682,7 @@ pub struct CustomDomainProperties { pub custom_https_provisioning_substate: Option, #[doc = "The JSON object that contains the properties to secure a custom domain."] #[serde(rename = "customHttpsParameters", default, skip_serializing_if = "Option::is_none")] - pub custom_https_parameters: Option, + pub custom_https_parameters: Option, #[doc = "Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China."] #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] pub validation_data: Option, @@ -2157,12 +2163,12 @@ pub struct DeliveryRule { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] - pub actions: Vec, + pub actions: Vec, } impl DeliveryRule { - pub fn new(order: i64, actions: Vec) -> Self { + pub fn new(order: i64, actions: Vec) -> Self { Self { name: None, order, @@ -2234,6 +2240,18 @@ pub mod delivery_rule_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleActionUnion { + CacheExpiration(DeliveryRuleCacheExpirationAction), + CacheKeyQueryString(DeliveryRuleCacheKeyQueryStringAction), + ModifyRequestHeader(DeliveryRuleRequestHeaderAction), + ModifyResponseHeader(DeliveryRuleResponseHeaderAction), + OriginGroupOverride(OriginGroupOverrideAction), + UrlRedirect(UrlRedirectAction), + UrlRewrite(UrlRewriteAction), + UrlSigning(UrlSigningAction), +} #[doc = "Defines the cache expiration action for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCacheExpirationAction { @@ -2341,6 +2359,24 @@ pub mod delivery_rule_condition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleConditionUnion { + Cookies(DeliveryRuleCookiesCondition), + HttpVersion(DeliveryRuleHttpVersionCondition), + IsDevice(DeliveryRuleIsDeviceCondition), + PostArgs(DeliveryRulePostArgsCondition), + QueryString(DeliveryRuleQueryStringCondition), + RemoteAddress(DeliveryRuleRemoteAddressCondition), + RequestBody(DeliveryRuleRequestBodyCondition), + RequestHeader(DeliveryRuleRequestHeaderCondition), + RequestMethod(DeliveryRuleRequestMethodCondition), + RequestScheme(DeliveryRuleRequestSchemeCondition), + RequestUri(DeliveryRuleRequestUriCondition), + UrlFileExtension(DeliveryRuleUrlFileExtensionCondition), + UrlFileName(DeliveryRuleUrlFileNameCondition), + UrlPath(DeliveryRuleUrlPathCondition), +} #[doc = "Defines the Cookies condition for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCookiesCondition { @@ -5958,14 +5994,14 @@ pub struct RuleUpdatePropertiesParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, #[doc = "If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue."] #[serde(rename = "matchProcessingBehavior", default, skip_serializing_if = "Option::is_none")] pub match_processing_behavior: Option, @@ -6113,6 +6149,13 @@ pub mod secret_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretParametersUnion { + CustomerCertificate(CustomerCertificateParameters), + ManagedCertificate(ManagedCertificateParameters), + UrlSigningKey(UrlSigningKeyParameters), +} #[doc = "The JSON object that contains the properties of the Secret to create."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretProperties { @@ -6120,7 +6163,7 @@ pub struct SecretProperties { pub afd_state_properties: AfdStateProperties, #[doc = "The json object containing secret parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecretProperties { pub fn new() -> Self { @@ -6216,6 +6259,11 @@ pub mod security_policy_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecurityPolicyParametersUnion { + WebApplicationFirewall(SecurityPolicyWebApplicationFirewallParameters), +} #[doc = "The json object that contains properties required to create a security policy"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityPolicyProperties { @@ -6223,7 +6271,7 @@ pub struct SecurityPolicyProperties { pub afd_state_properties: AfdStateProperties, #[doc = "The json object containing security policy parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecurityPolicyProperties { pub fn new() -> Self { diff --git a/services/mgmt/cdn/src/package_2021_06/mod.rs b/services/mgmt/cdn/src/package_2021_06/mod.rs index 8fb3329824..b40b33a88b 100644 --- a/services/mgmt/cdn/src/package_2021_06/mod.rs +++ b/services/mgmt/cdn/src/package_2021_06/mod.rs @@ -14840,13 +14840,13 @@ pub mod custom_domains { pub(crate) endpoint_name: String, pub(crate) custom_domain_name: String, pub(crate) subscription_id: String, - pub(crate) custom_domain_https_parameters: Option, + pub(crate) custom_domain_https_parameters: Option, } impl RequestBuilder { #[doc = "The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default."] pub fn custom_domain_https_parameters( mut self, - custom_domain_https_parameters: impl Into, + custom_domain_https_parameters: impl Into, ) -> Self { self.custom_domain_https_parameters = Some(custom_domain_https_parameters.into()); self diff --git a/services/mgmt/cdn/src/package_2021_06/models.rs b/services/mgmt/cdn/src/package_2021_06/models.rs index e1c1290faa..f608226be1 100644 --- a/services/mgmt/cdn/src/package_2021_06/models.rs +++ b/services/mgmt/cdn/src/package_2021_06/models.rs @@ -2087,6 +2087,12 @@ pub mod custom_domain_https_parameters { Tls12, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "certificateSource")] +pub enum CustomDomainHttpsParametersUnion { + Cdn(CdnManagedHttpsParameters), + AzureKeyVault(UserManagedHttpsParameters), +} #[doc = "Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next set of results."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomDomainListResult { @@ -2141,7 +2147,7 @@ pub struct CustomDomainProperties { pub custom_https_provisioning_substate: Option, #[doc = "The JSON object that contains the properties to secure a custom domain."] #[serde(rename = "customHttpsParameters", default, skip_serializing_if = "Option::is_none")] - pub custom_https_parameters: Option, + pub custom_https_parameters: Option, #[doc = "Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China."] #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] pub validation_data: Option, @@ -2709,12 +2715,12 @@ pub struct DeliveryRule { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] - pub actions: Vec, + pub actions: Vec, } impl DeliveryRule { - pub fn new(order: i32, actions: Vec) -> Self { + pub fn new(order: i32, actions: Vec) -> Self { Self { name: None, order, @@ -2788,6 +2794,19 @@ pub mod delivery_rule_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleActionUnion { + CacheExpiration(DeliveryRuleCacheExpirationAction), + CacheKeyQueryString(DeliveryRuleCacheKeyQueryStringAction), + ModifyRequestHeader(DeliveryRuleRequestHeaderAction), + ModifyResponseHeader(DeliveryRuleResponseHeaderAction), + RouteConfigurationOverride(DeliveryRuleRouteConfigurationOverrideAction), + OriginGroupOverride(OriginGroupOverrideAction), + UrlRedirect(UrlRedirectAction), + UrlRewrite(UrlRewriteAction), + UrlSigning(UrlSigningAction), +} #[doc = "Defines the cache expiration action for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCacheExpirationAction { @@ -2921,6 +2940,29 @@ pub mod delivery_rule_condition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleConditionUnion { + ClientPort(DeliveryRuleClientPortCondition), + Cookies(DeliveryRuleCookiesCondition), + HostName(DeliveryRuleHostNameCondition), + HttpVersion(DeliveryRuleHttpVersionCondition), + IsDevice(DeliveryRuleIsDeviceCondition), + PostArgs(DeliveryRulePostArgsCondition), + QueryString(DeliveryRuleQueryStringCondition), + RemoteAddress(DeliveryRuleRemoteAddressCondition), + RequestBody(DeliveryRuleRequestBodyCondition), + RequestHeader(DeliveryRuleRequestHeaderCondition), + RequestMethod(DeliveryRuleRequestMethodCondition), + RequestScheme(DeliveryRuleRequestSchemeCondition), + RequestUri(DeliveryRuleRequestUriCondition), + ServerPort(DeliveryRuleServerPortCondition), + SocketAddr(DeliveryRuleSocketAddrCondition), + SslProtocol(DeliveryRuleSslProtocolCondition), + UrlFileExtension(DeliveryRuleUrlFileExtensionCondition), + UrlFileName(DeliveryRuleUrlFileNameCondition), + UrlPath(DeliveryRuleUrlPathCondition), +} #[doc = "Defines the Cookies condition for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCookiesCondition { @@ -7277,14 +7319,14 @@ pub struct RuleUpdatePropertiesParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, #[doc = "If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue."] #[serde(rename = "matchProcessingBehavior", default, skip_serializing_if = "Option::is_none")] pub match_processing_behavior: Option, @@ -7390,6 +7432,14 @@ impl SecretParameters { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretParametersUnion { + AzureFirstPartyManagedCertificate(AzureFirstPartyManagedCertificateParameters), + CustomerCertificate(CustomerCertificateParameters), + ManagedCertificate(ManagedCertificateParameters), + UrlSigningKey(UrlSigningKeyParameters), +} #[doc = "The JSON object that contains the properties of the Secret to create."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretProperties { @@ -7400,7 +7450,7 @@ pub struct SecretProperties { pub profile_name: Option, #[doc = "The json object containing secret parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecretProperties { pub fn new() -> Self { @@ -7499,7 +7549,7 @@ pub struct SecurityPolicyProperties { pub profile_name: Option, #[doc = "The json object containing security policy parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecurityPolicyProperties { pub fn new() -> Self { @@ -7556,6 +7606,11 @@ pub mod security_policy_properties_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecurityPolicyPropertiesParametersUnion { + WebApplicationFirewall(SecurityPolicyWebApplicationFirewallParameters), +} #[doc = "The JSON object containing security policy update parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityPolicyUpdateParameters { @@ -7573,7 +7628,7 @@ impl SecurityPolicyUpdateParameters { pub struct SecurityPolicyUpdateProperties { #[doc = "The json object containing security policy parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecurityPolicyUpdateProperties { pub fn new() -> Self { diff --git a/services/mgmt/cdn/src/package_2023_05/mod.rs b/services/mgmt/cdn/src/package_2023_05/mod.rs index 33347777a2..bbe0a7cd6a 100644 --- a/services/mgmt/cdn/src/package_2023_05/mod.rs +++ b/services/mgmt/cdn/src/package_2023_05/mod.rs @@ -16101,13 +16101,13 @@ pub mod custom_domains { pub(crate) endpoint_name: String, pub(crate) custom_domain_name: String, pub(crate) subscription_id: String, - pub(crate) custom_domain_https_parameters: Option, + pub(crate) custom_domain_https_parameters: Option, } impl RequestBuilder { #[doc = "The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default."] pub fn custom_domain_https_parameters( mut self, - custom_domain_https_parameters: impl Into, + custom_domain_https_parameters: impl Into, ) -> Self { self.custom_domain_https_parameters = Some(custom_domain_https_parameters.into()); self diff --git a/services/mgmt/cdn/src/package_2023_05/models.rs b/services/mgmt/cdn/src/package_2023_05/models.rs index 39bd56710e..1e2626cf60 100644 --- a/services/mgmt/cdn/src/package_2023_05/models.rs +++ b/services/mgmt/cdn/src/package_2023_05/models.rs @@ -2218,6 +2218,12 @@ pub mod custom_domain_https_parameters { Tls12, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "certificateSource")] +pub enum CustomDomainHttpsParametersUnion { + Cdn(CdnManagedHttpsParameters), + AzureKeyVault(UserManagedHttpsParameters), +} #[doc = "Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next set of results."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomDomainListResult { @@ -2272,7 +2278,7 @@ pub struct CustomDomainProperties { pub custom_https_provisioning_substate: Option, #[doc = "The JSON object that contains the properties to secure a custom domain."] #[serde(rename = "customHttpsParameters", default, skip_serializing_if = "Option::is_none")] - pub custom_https_parameters: Option, + pub custom_https_parameters: Option, #[doc = "Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China."] #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] pub validation_data: Option, @@ -2840,12 +2846,12 @@ pub struct DeliveryRule { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] - pub actions: Vec, + pub actions: Vec, } impl DeliveryRule { - pub fn new(order: i32, actions: Vec) -> Self { + pub fn new(order: i32, actions: Vec) -> Self { Self { name: None, order, @@ -2919,6 +2925,19 @@ pub mod delivery_rule_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleActionUnion { + CacheExpiration(DeliveryRuleCacheExpirationAction), + CacheKeyQueryString(DeliveryRuleCacheKeyQueryStringAction), + ModifyRequestHeader(DeliveryRuleRequestHeaderAction), + ModifyResponseHeader(DeliveryRuleResponseHeaderAction), + RouteConfigurationOverride(DeliveryRuleRouteConfigurationOverrideAction), + OriginGroupOverride(OriginGroupOverrideAction), + UrlRedirect(UrlRedirectAction), + UrlRewrite(UrlRewriteAction), + UrlSigning(UrlSigningAction), +} #[doc = "Defines the cache expiration action for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCacheExpirationAction { @@ -3052,6 +3071,29 @@ pub mod delivery_rule_condition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleConditionUnion { + ClientPort(DeliveryRuleClientPortCondition), + Cookies(DeliveryRuleCookiesCondition), + HostName(DeliveryRuleHostNameCondition), + HttpVersion(DeliveryRuleHttpVersionCondition), + IsDevice(DeliveryRuleIsDeviceCondition), + PostArgs(DeliveryRulePostArgsCondition), + QueryString(DeliveryRuleQueryStringCondition), + RemoteAddress(DeliveryRuleRemoteAddressCondition), + RequestBody(DeliveryRuleRequestBodyCondition), + RequestHeader(DeliveryRuleRequestHeaderCondition), + RequestMethod(DeliveryRuleRequestMethodCondition), + RequestScheme(DeliveryRuleRequestSchemeCondition), + RequestUri(DeliveryRuleRequestUriCondition), + ServerPort(DeliveryRuleServerPortCondition), + SocketAddr(DeliveryRuleSocketAddrCondition), + SslProtocol(DeliveryRuleSslProtocolCondition), + UrlFileExtension(DeliveryRuleUrlFileExtensionCondition), + UrlFileName(DeliveryRuleUrlFileNameCondition), + UrlPath(DeliveryRuleUrlPathCondition), +} #[doc = "Defines the Cookies condition for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCookiesCondition { @@ -7654,14 +7696,14 @@ pub struct RuleUpdatePropertiesParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, #[doc = "If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue."] #[serde(rename = "matchProcessingBehavior", default, skip_serializing_if = "Option::is_none")] pub match_processing_behavior: Option, @@ -7767,6 +7809,14 @@ impl SecretParameters { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretParametersUnion { + AzureFirstPartyManagedCertificate(AzureFirstPartyManagedCertificateParameters), + CustomerCertificate(CustomerCertificateParameters), + ManagedCertificate(ManagedCertificateParameters), + UrlSigningKey(UrlSigningKeyParameters), +} #[doc = "The JSON object that contains the properties of the Secret to create."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretProperties { @@ -7777,7 +7827,7 @@ pub struct SecretProperties { pub profile_name: Option, #[doc = "The json object containing secret parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecretProperties { pub fn new() -> Self { @@ -7876,7 +7926,7 @@ pub struct SecurityPolicyProperties { pub profile_name: Option, #[doc = "The json object containing security policy parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecurityPolicyProperties { pub fn new() -> Self { @@ -7933,6 +7983,11 @@ pub mod security_policy_properties_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecurityPolicyPropertiesParametersUnion { + WebApplicationFirewall(SecurityPolicyWebApplicationFirewallParameters), +} #[doc = "The JSON object containing security policy update parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityPolicyUpdateParameters { @@ -7950,7 +8005,7 @@ impl SecurityPolicyUpdateParameters { pub struct SecurityPolicyUpdateProperties { #[doc = "The json object containing security policy parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecurityPolicyUpdateProperties { pub fn new() -> Self { diff --git a/services/mgmt/cdn/src/package_preview_2022_05/mod.rs b/services/mgmt/cdn/src/package_preview_2022_05/mod.rs index 4e5aa6da25..29a6bba9c7 100644 --- a/services/mgmt/cdn/src/package_preview_2022_05/mod.rs +++ b/services/mgmt/cdn/src/package_preview_2022_05/mod.rs @@ -15284,13 +15284,13 @@ pub mod custom_domains { pub(crate) endpoint_name: String, pub(crate) custom_domain_name: String, pub(crate) subscription_id: String, - pub(crate) custom_domain_https_parameters: Option, + pub(crate) custom_domain_https_parameters: Option, } impl RequestBuilder { #[doc = "The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default."] pub fn custom_domain_https_parameters( mut self, - custom_domain_https_parameters: impl Into, + custom_domain_https_parameters: impl Into, ) -> Self { self.custom_domain_https_parameters = Some(custom_domain_https_parameters.into()); self diff --git a/services/mgmt/cdn/src/package_preview_2022_05/models.rs b/services/mgmt/cdn/src/package_preview_2022_05/models.rs index 89a85ff412..e3f816e97d 100644 --- a/services/mgmt/cdn/src/package_preview_2022_05/models.rs +++ b/services/mgmt/cdn/src/package_preview_2022_05/models.rs @@ -2202,6 +2202,12 @@ pub mod custom_domain_https_parameters { Tls12, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "certificateSource")] +pub enum CustomDomainHttpsParametersUnion { + Cdn(CdnManagedHttpsParameters), + AzureKeyVault(UserManagedHttpsParameters), +} #[doc = "Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next set of results."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomDomainListResult { @@ -2256,7 +2262,7 @@ pub struct CustomDomainProperties { pub custom_https_provisioning_substate: Option, #[doc = "The JSON object that contains the properties to secure a custom domain."] #[serde(rename = "customHttpsParameters", default, skip_serializing_if = "Option::is_none")] - pub custom_https_parameters: Option, + pub custom_https_parameters: Option, #[doc = "Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China."] #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] pub validation_data: Option, @@ -2824,12 +2830,12 @@ pub struct DeliveryRule { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] - pub actions: Vec, + pub actions: Vec, } impl DeliveryRule { - pub fn new(order: i32, actions: Vec) -> Self { + pub fn new(order: i32, actions: Vec) -> Self { Self { name: None, order, @@ -2903,6 +2909,19 @@ pub mod delivery_rule_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleActionUnion { + CacheExpiration(DeliveryRuleCacheExpirationAction), + CacheKeyQueryString(DeliveryRuleCacheKeyQueryStringAction), + ModifyRequestHeader(DeliveryRuleRequestHeaderAction), + ModifyResponseHeader(DeliveryRuleResponseHeaderAction), + RouteConfigurationOverride(DeliveryRuleRouteConfigurationOverrideAction), + OriginGroupOverride(OriginGroupOverrideAction), + UrlRedirect(UrlRedirectAction), + UrlRewrite(UrlRewriteAction), + UrlSigning(UrlSigningAction), +} #[doc = "Defines the cache expiration action for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCacheExpirationAction { @@ -3036,6 +3055,29 @@ pub mod delivery_rule_condition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleConditionUnion { + ClientPort(DeliveryRuleClientPortCondition), + Cookies(DeliveryRuleCookiesCondition), + HostName(DeliveryRuleHostNameCondition), + HttpVersion(DeliveryRuleHttpVersionCondition), + IsDevice(DeliveryRuleIsDeviceCondition), + PostArgs(DeliveryRulePostArgsCondition), + QueryString(DeliveryRuleQueryStringCondition), + RemoteAddress(DeliveryRuleRemoteAddressCondition), + RequestBody(DeliveryRuleRequestBodyCondition), + RequestHeader(DeliveryRuleRequestHeaderCondition), + RequestMethod(DeliveryRuleRequestMethodCondition), + RequestScheme(DeliveryRuleRequestSchemeCondition), + RequestUri(DeliveryRuleRequestUriCondition), + ServerPort(DeliveryRuleServerPortCondition), + SocketAddr(DeliveryRuleSocketAddrCondition), + SslProtocol(DeliveryRuleSslProtocolCondition), + UrlFileExtension(DeliveryRuleUrlFileExtensionCondition), + UrlFileName(DeliveryRuleUrlFileNameCondition), + UrlPath(DeliveryRuleUrlPathCondition), +} #[doc = "Defines the Cookies condition for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCookiesCondition { @@ -7489,14 +7531,14 @@ pub struct RuleUpdatePropertiesParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, #[doc = "If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue."] #[serde(rename = "matchProcessingBehavior", default, skip_serializing_if = "Option::is_none")] pub match_processing_behavior: Option, @@ -7602,6 +7644,14 @@ impl SecretParameters { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretParametersUnion { + AzureFirstPartyManagedCertificate(AzureFirstPartyManagedCertificateParameters), + CustomerCertificate(CustomerCertificateParameters), + ManagedCertificate(ManagedCertificateParameters), + UrlSigningKey(UrlSigningKeyParameters), +} #[doc = "The JSON object that contains the properties of the Secret to create."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretProperties { @@ -7612,7 +7662,7 @@ pub struct SecretProperties { pub profile_name: Option, #[doc = "The json object containing secret parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecretProperties { pub fn new() -> Self { @@ -7711,7 +7761,7 @@ pub struct SecurityPolicyProperties { pub profile_name: Option, #[doc = "The json object containing security policy parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecurityPolicyProperties { pub fn new() -> Self { @@ -7768,6 +7818,11 @@ pub mod security_policy_properties_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecurityPolicyPropertiesParametersUnion { + WebApplicationFirewall(SecurityPolicyWebApplicationFirewallParameters), +} #[doc = "The JSON object containing security policy update parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityPolicyUpdateParameters { @@ -7785,7 +7840,7 @@ impl SecurityPolicyUpdateParameters { pub struct SecurityPolicyUpdateProperties { #[doc = "The json object containing security policy parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecurityPolicyUpdateProperties { pub fn new() -> Self { diff --git a/services/mgmt/cdn/src/package_preview_2022_11/mod.rs b/services/mgmt/cdn/src/package_preview_2022_11/mod.rs index 74a79fb946..e4bc15fb64 100644 --- a/services/mgmt/cdn/src/package_preview_2022_11/mod.rs +++ b/services/mgmt/cdn/src/package_preview_2022_11/mod.rs @@ -16030,13 +16030,13 @@ pub mod custom_domains { pub(crate) endpoint_name: String, pub(crate) custom_domain_name: String, pub(crate) subscription_id: String, - pub(crate) custom_domain_https_parameters: Option, + pub(crate) custom_domain_https_parameters: Option, } impl RequestBuilder { #[doc = "The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default."] pub fn custom_domain_https_parameters( mut self, - custom_domain_https_parameters: impl Into, + custom_domain_https_parameters: impl Into, ) -> Self { self.custom_domain_https_parameters = Some(custom_domain_https_parameters.into()); self diff --git a/services/mgmt/cdn/src/package_preview_2022_11/models.rs b/services/mgmt/cdn/src/package_preview_2022_11/models.rs index 62ed92449b..4b6d3ab57a 100644 --- a/services/mgmt/cdn/src/package_preview_2022_11/models.rs +++ b/services/mgmt/cdn/src/package_preview_2022_11/models.rs @@ -2202,6 +2202,12 @@ pub mod custom_domain_https_parameters { Tls12, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "certificateSource")] +pub enum CustomDomainHttpsParametersUnion { + Cdn(CdnManagedHttpsParameters), + AzureKeyVault(UserManagedHttpsParameters), +} #[doc = "Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next set of results."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomDomainListResult { @@ -2256,7 +2262,7 @@ pub struct CustomDomainProperties { pub custom_https_provisioning_substate: Option, #[doc = "The JSON object that contains the properties to secure a custom domain."] #[serde(rename = "customHttpsParameters", default, skip_serializing_if = "Option::is_none")] - pub custom_https_parameters: Option, + pub custom_https_parameters: Option, #[doc = "Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China."] #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] pub validation_data: Option, @@ -2824,12 +2830,12 @@ pub struct DeliveryRule { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] - pub actions: Vec, + pub actions: Vec, } impl DeliveryRule { - pub fn new(order: i32, actions: Vec) -> Self { + pub fn new(order: i32, actions: Vec) -> Self { Self { name: None, order, @@ -2903,6 +2909,19 @@ pub mod delivery_rule_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleActionUnion { + CacheExpiration(DeliveryRuleCacheExpirationAction), + CacheKeyQueryString(DeliveryRuleCacheKeyQueryStringAction), + ModifyRequestHeader(DeliveryRuleRequestHeaderAction), + ModifyResponseHeader(DeliveryRuleResponseHeaderAction), + RouteConfigurationOverride(DeliveryRuleRouteConfigurationOverrideAction), + OriginGroupOverride(OriginGroupOverrideAction), + UrlRedirect(UrlRedirectAction), + UrlRewrite(UrlRewriteAction), + UrlSigning(UrlSigningAction), +} #[doc = "Defines the cache expiration action for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCacheExpirationAction { @@ -3036,6 +3055,29 @@ pub mod delivery_rule_condition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum DeliveryRuleConditionUnion { + ClientPort(DeliveryRuleClientPortCondition), + Cookies(DeliveryRuleCookiesCondition), + HostName(DeliveryRuleHostNameCondition), + HttpVersion(DeliveryRuleHttpVersionCondition), + IsDevice(DeliveryRuleIsDeviceCondition), + PostArgs(DeliveryRulePostArgsCondition), + QueryString(DeliveryRuleQueryStringCondition), + RemoteAddress(DeliveryRuleRemoteAddressCondition), + RequestBody(DeliveryRuleRequestBodyCondition), + RequestHeader(DeliveryRuleRequestHeaderCondition), + RequestMethod(DeliveryRuleRequestMethodCondition), + RequestScheme(DeliveryRuleRequestSchemeCondition), + RequestUri(DeliveryRuleRequestUriCondition), + ServerPort(DeliveryRuleServerPortCondition), + SocketAddr(DeliveryRuleSocketAddrCondition), + SslProtocol(DeliveryRuleSslProtocolCondition), + UrlFileExtension(DeliveryRuleUrlFileExtensionCondition), + UrlFileName(DeliveryRuleUrlFileNameCondition), + UrlPath(DeliveryRuleUrlPathCondition), +} #[doc = "Defines the Cookies condition for the delivery rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeliveryRuleCookiesCondition { @@ -7628,14 +7670,14 @@ pub struct RuleUpdatePropertiesParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, #[doc = "A list of actions that are executed when all the conditions of a rule are satisfied."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, #[doc = "If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue."] #[serde(rename = "matchProcessingBehavior", default, skip_serializing_if = "Option::is_none")] pub match_processing_behavior: Option, @@ -7741,6 +7783,14 @@ impl SecretParameters { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretParametersUnion { + AzureFirstPartyManagedCertificate(AzureFirstPartyManagedCertificateParameters), + CustomerCertificate(CustomerCertificateParameters), + ManagedCertificate(ManagedCertificateParameters), + UrlSigningKey(UrlSigningKeyParameters), +} #[doc = "The JSON object that contains the properties of the Secret to create."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretProperties { @@ -7751,7 +7801,7 @@ pub struct SecretProperties { pub profile_name: Option, #[doc = "The json object containing secret parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecretProperties { pub fn new() -> Self { @@ -7850,7 +7900,7 @@ pub struct SecurityPolicyProperties { pub profile_name: Option, #[doc = "The json object containing security policy parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecurityPolicyProperties { pub fn new() -> Self { @@ -7907,6 +7957,11 @@ pub mod security_policy_properties_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecurityPolicyPropertiesParametersUnion { + WebApplicationFirewall(SecurityPolicyWebApplicationFirewallParameters), +} #[doc = "The JSON object containing security policy update parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityPolicyUpdateParameters { @@ -7924,7 +7979,7 @@ impl SecurityPolicyUpdateParameters { pub struct SecurityPolicyUpdateProperties { #[doc = "The json object containing security policy parameters"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, } impl SecurityPolicyUpdateProperties { pub fn new() -> Self { diff --git a/services/mgmt/chaos/src/package_2021_09_15_preview/models.rs b/services/mgmt/chaos/src/package_2021_09_15_preview/models.rs index dc6ccc1dbf..75a5081b7e 100644 --- a/services/mgmt/chaos/src/package_2021_09_15_preview/models.rs +++ b/services/mgmt/chaos/src/package_2021_09_15_preview/models.rs @@ -271,6 +271,9 @@ impl Action { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ActionUnion {} #[doc = "Model that represents the an action and its status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActionStatus { @@ -308,10 +311,10 @@ pub struct Branch { #[doc = "String of the branch name."] pub name: String, #[doc = "List of actions."] - pub actions: Vec, + pub actions: Vec, } impl Branch { - pub fn new(name: String, actions: Vec) -> Self { + pub fn new(name: String, actions: Vec) -> Self { Self { name, actions } } } diff --git a/services/mgmt/chaos/src/package_2022_07_01_preview/models.rs b/services/mgmt/chaos/src/package_2022_07_01_preview/models.rs index f512252792..6cddd431a4 100644 --- a/services/mgmt/chaos/src/package_2022_07_01_preview/models.rs +++ b/services/mgmt/chaos/src/package_2022_07_01_preview/models.rs @@ -271,6 +271,9 @@ impl Action { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ActionUnion {} #[doc = "Model that represents the an action and its status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActionStatus { @@ -308,10 +311,10 @@ pub struct Branch { #[doc = "String of the branch name."] pub name: String, #[doc = "List of actions."] - pub actions: Vec, + pub actions: Vec, } impl Branch { - pub fn new(name: String, actions: Vec) -> Self { + pub fn new(name: String, actions: Vec) -> Self { Self { name, actions } } } diff --git a/services/mgmt/chaos/src/package_2022_10_01_preview/models.rs b/services/mgmt/chaos/src/package_2022_10_01_preview/models.rs index 9e775616a8..c535af0ecf 100644 --- a/services/mgmt/chaos/src/package_2022_10_01_preview/models.rs +++ b/services/mgmt/chaos/src/package_2022_10_01_preview/models.rs @@ -271,6 +271,9 @@ impl Action { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ActionUnion {} #[doc = "Model that represents the an action and its status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActionStatus { @@ -308,10 +311,10 @@ pub struct Branch { #[doc = "String of the branch name."] pub name: String, #[doc = "List of actions."] - pub actions: Vec, + pub actions: Vec, } impl Branch { - pub fn new(name: String, actions: Vec) -> Self { + pub fn new(name: String, actions: Vec) -> Self { Self { name, actions } } } @@ -849,6 +852,9 @@ pub mod filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FilterUnion {} #[doc = "The managed identity of a resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResourceIdentity { @@ -892,7 +898,7 @@ pub struct Selector { pub targets: Vec, #[doc = "Model that represents available filter types that can be applied to a targets list."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option, + pub filter: Option, } impl Selector { pub fn new(type_: selector::Type, id: String, targets: Vec) -> Self { diff --git a/services/mgmt/chaos/src/package_2023_04_01_preview/models.rs b/services/mgmt/chaos/src/package_2023_04_01_preview/models.rs index d06612a157..5aa6127bca 100644 --- a/services/mgmt/chaos/src/package_2023_04_01_preview/models.rs +++ b/services/mgmt/chaos/src/package_2023_04_01_preview/models.rs @@ -294,6 +294,9 @@ impl Action { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ActionUnion {} #[doc = "Model that represents the an action and its status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActionStatus { @@ -331,10 +334,10 @@ pub struct Branch { #[doc = "String of the branch name."] pub name: String, #[doc = "List of actions."] - pub actions: Vec, + pub actions: Vec, } impl Branch { - pub fn new(name: String, actions: Vec) -> Self { + pub fn new(name: String, actions: Vec) -> Self { Self { name, actions } } } @@ -900,6 +903,9 @@ pub mod filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FilterUnion {} #[doc = "The identity of a resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResourceIdentity { @@ -948,7 +954,7 @@ pub struct Selector { pub targets: Vec, #[doc = "Model that represents available filter types that can be applied to a targets list."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option, + pub filter: Option, } impl Selector { pub fn new(type_: selector::Type, id: String, targets: Vec) -> Self { diff --git a/services/mgmt/chaos/src/package_2023_04_15_preview/models.rs b/services/mgmt/chaos/src/package_2023_04_15_preview/models.rs index 841fa8d5f5..89f1f5f15e 100644 --- a/services/mgmt/chaos/src/package_2023_04_15_preview/models.rs +++ b/services/mgmt/chaos/src/package_2023_04_15_preview/models.rs @@ -294,6 +294,9 @@ impl Action { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ActionUnion {} #[doc = "Model that represents the an action and its status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActionStatus { @@ -331,10 +334,10 @@ pub struct Branch { #[doc = "String of the branch name."] pub name: String, #[doc = "List of actions."] - pub actions: Vec, + pub actions: Vec, } impl Branch { - pub fn new(name: String, actions: Vec) -> Self { + pub fn new(name: String, actions: Vec) -> Self { Self { name, actions } } } @@ -745,13 +748,13 @@ pub struct ExperimentProperties { #[doc = "List of steps."] pub steps: Vec, #[doc = "List of selectors."] - pub selectors: Vec, + pub selectors: Vec, #[doc = "A boolean value that indicates if experiment should be started on creation or not."] #[serde(rename = "startOnCreation", default, skip_serializing_if = "Option::is_none")] pub start_on_creation: Option, } impl ExperimentProperties { - pub fn new(steps: Vec, selectors: Vec) -> Self { + pub fn new(steps: Vec, selectors: Vec) -> Self { Self { steps, selectors, @@ -900,6 +903,9 @@ pub mod filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FilterUnion {} #[doc = "The identity of a resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResourceIdentity { @@ -946,7 +952,7 @@ pub struct Selector { pub id: String, #[doc = "Model that represents available filter types that can be applied to a targets list."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option, + pub filter: Option, } impl Selector { pub fn new(type_: selector::Type, id: String) -> Self { @@ -993,6 +999,9 @@ pub mod selector { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SelectorUnion {} #[doc = "Model that represents a step in the Experiment resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Step { diff --git a/services/mgmt/commerce/src/package_2015_06_preview/models.rs b/services/mgmt/commerce/src/package_2015_06_preview/models.rs index 1ea6de38cb..eb29d621d0 100644 --- a/services/mgmt/commerce/src/package_2015_06_preview/models.rs +++ b/services/mgmt/commerce/src/package_2015_06_preview/models.rs @@ -171,6 +171,16 @@ pub mod offer_term_info { MonetaryCredit, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Name")] +pub enum OfferTermInfoUnion { + #[serde(rename = "Monetary Commitment")] + MonetaryCommitment(MonetaryCommitment), + #[serde(rename = "Monetary Credit")] + MonetaryCredit(MonetaryCredit), + #[serde(rename = "Recurring Charge")] + RecurringCharge(RecurringCharge), +} #[doc = "Parameters that are used in the odata $filter query parameter for providing RateCard information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RateCardQueryParameters { @@ -233,7 +243,7 @@ pub struct ResourceRateCardInfo { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub offer_terms: Vec, + pub offer_terms: Vec, #[doc = "A list of meters."] #[serde( rename = "Meters", diff --git a/services/mgmt/commerce/src/profile_hybrid_2020_09_01/models.rs b/services/mgmt/commerce/src/profile_hybrid_2020_09_01/models.rs index 1ea6de38cb..eb29d621d0 100644 --- a/services/mgmt/commerce/src/profile_hybrid_2020_09_01/models.rs +++ b/services/mgmt/commerce/src/profile_hybrid_2020_09_01/models.rs @@ -171,6 +171,16 @@ pub mod offer_term_info { MonetaryCredit, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Name")] +pub enum OfferTermInfoUnion { + #[serde(rename = "Monetary Commitment")] + MonetaryCommitment(MonetaryCommitment), + #[serde(rename = "Monetary Credit")] + MonetaryCredit(MonetaryCredit), + #[serde(rename = "Recurring Charge")] + RecurringCharge(RecurringCharge), +} #[doc = "Parameters that are used in the odata $filter query parameter for providing RateCard information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RateCardQueryParameters { @@ -233,7 +243,7 @@ pub struct ResourceRateCardInfo { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub offer_terms: Vec, + pub offer_terms: Vec, #[doc = "A list of meters."] #[serde( rename = "Meters", diff --git a/services/mgmt/connectedvmware/src/package_2020_10_01_preview/models.rs b/services/mgmt/connectedvmware/src/package_2020_10_01_preview/models.rs index 9d42ed65e8..fec5c0aea0 100644 --- a/services/mgmt/connectedvmware/src/package_2020_10_01_preview/models.rs +++ b/services/mgmt/connectedvmware/src/package_2020_10_01_preview/models.rs @@ -991,7 +991,7 @@ pub struct InventoryItem { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "Defines the resource properties."] - pub properties: InventoryItemProperties, + pub properties: InventoryItemPropertiesUnion, #[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, @@ -1000,7 +1000,7 @@ pub struct InventoryItem { pub kind: Option, } impl InventoryItem { - pub fn new(properties: InventoryItemProperties) -> Self { + pub fn new(properties: InventoryItemPropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -1054,6 +1054,17 @@ impl InventoryItemProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inventoryType")] +pub enum InventoryItemPropertiesUnion { + Cluster(ClusterInventoryItem), + Datastore(DatastoreInventoryItem), + Host(HostInventoryItem), + ResourcePool(ResourcePoolInventoryItem), + VirtualMachine(VirtualMachineInventoryItem), + VirtualMachineTemplate(VirtualMachineTemplateInventoryItem), + VirtualNetwork(VirtualNetworkInventoryItem), +} #[doc = "List of InventoryItems."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InventoryItemsList { diff --git a/services/mgmt/connectedvmware/src/package_2022_01_10_preview/models.rs b/services/mgmt/connectedvmware/src/package_2022_01_10_preview/models.rs index b219c92182..f7326dedb9 100644 --- a/services/mgmt/connectedvmware/src/package_2022_01_10_preview/models.rs +++ b/services/mgmt/connectedvmware/src/package_2022_01_10_preview/models.rs @@ -1027,7 +1027,7 @@ pub struct InventoryItem { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "Defines the resource properties."] - pub properties: InventoryItemProperties, + pub properties: InventoryItemPropertiesUnion, #[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, @@ -1036,7 +1036,7 @@ pub struct InventoryItem { pub kind: Option, } impl InventoryItem { - pub fn new(properties: InventoryItemProperties) -> Self { + pub fn new(properties: InventoryItemPropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -1090,6 +1090,17 @@ impl InventoryItemProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inventoryType")] +pub enum InventoryItemPropertiesUnion { + Cluster(ClusterInventoryItem), + Datastore(DatastoreInventoryItem), + Host(HostInventoryItem), + ResourcePool(ResourcePoolInventoryItem), + VirtualMachine(VirtualMachineInventoryItem), + VirtualMachineTemplate(VirtualMachineTemplateInventoryItem), + VirtualNetwork(VirtualNetworkInventoryItem), +} #[doc = "List of InventoryItems."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InventoryItemsList { diff --git a/services/mgmt/connectedvmware/src/package_2022_07_15_preview/models.rs b/services/mgmt/connectedvmware/src/package_2022_07_15_preview/models.rs index 5910095159..2c3c4cc6a1 100644 --- a/services/mgmt/connectedvmware/src/package_2022_07_15_preview/models.rs +++ b/services/mgmt/connectedvmware/src/package_2022_07_15_preview/models.rs @@ -1086,7 +1086,7 @@ pub struct InventoryItem { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "Describes the properties of an Inventory Item."] - pub properties: InventoryItemProperties, + pub properties: InventoryItemPropertiesUnion, #[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, @@ -1095,7 +1095,7 @@ pub struct InventoryItem { pub kind: Option, } impl InventoryItem { - pub fn new(properties: InventoryItemProperties) -> Self { + pub fn new(properties: InventoryItemPropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -1152,6 +1152,17 @@ impl InventoryItemProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inventoryType")] +pub enum InventoryItemPropertiesUnion { + Cluster(ClusterInventoryItem), + Datastore(DatastoreInventoryItem), + Host(HostInventoryItem), + ResourcePool(ResourcePoolInventoryItem), + VirtualMachine(VirtualMachineInventoryItem), + VirtualMachineTemplate(VirtualMachineTemplateInventoryItem), + VirtualNetwork(VirtualNetworkInventoryItem), +} #[doc = "List of InventoryItems."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InventoryItemsList { diff --git a/services/mgmt/connectedvmware/src/package_preview_2023_03/models.rs b/services/mgmt/connectedvmware/src/package_preview_2023_03/models.rs index 74a4aabc4e..2586dbbc00 100644 --- a/services/mgmt/connectedvmware/src/package_preview_2023_03/models.rs +++ b/services/mgmt/connectedvmware/src/package_preview_2023_03/models.rs @@ -1144,13 +1144,13 @@ pub struct InventoryItem { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "Describes the properties of an Inventory Item."] - pub properties: InventoryItemProperties, + pub properties: InventoryItemPropertiesUnion, #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value."] #[serde(default, skip_serializing_if = "Option::is_none")] pub kind: Option, } impl InventoryItem { - pub fn new(properties: InventoryItemProperties) -> Self { + pub fn new(properties: InventoryItemPropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -1206,6 +1206,17 @@ impl InventoryItemProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inventoryType")] +pub enum InventoryItemPropertiesUnion { + Cluster(ClusterInventoryItem), + Datastore(DatastoreInventoryItem), + Host(HostInventoryItem), + ResourcePool(ResourcePoolInventoryItem), + VirtualMachine(VirtualMachineInventoryItem), + VirtualMachineTemplate(VirtualMachineTemplateInventoryItem), + VirtualNetwork(VirtualNetworkInventoryItem), +} #[doc = "List of InventoryItems."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InventoryItemsList { diff --git a/services/mgmt/consumption/src/package_2023_05/models.rs b/services/mgmt/consumption/src/package_2023_05/models.rs index 277f50006b..0eef6e03af 100644 --- a/services/mgmt/consumption/src/package_2023_05/models.rs +++ b/services/mgmt/consumption/src/package_2023_05/models.rs @@ -476,6 +476,14 @@ pub mod charge_summary { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ChargeSummaryUnion { + #[serde(rename = "legacy")] + Legacy(LegacyChargeSummary), + #[serde(rename = "modern")] + Modern(ModernChargeSummary), +} #[doc = "Result of listing charge summary."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChargesListResult { @@ -485,7 +493,7 @@ pub struct ChargesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl ChargesListResult { pub fn new() -> Self { @@ -937,10 +945,10 @@ pub struct LegacyReservationRecommendation { #[serde(flatten)] pub reservation_recommendation: ReservationRecommendation, #[doc = "The properties of the reservation recommendation."] - pub properties: LegacyReservationRecommendationProperties, + pub properties: LegacyReservationRecommendationPropertiesUnion, } impl LegacyReservationRecommendation { - pub fn new(reservation_recommendation: ReservationRecommendation, properties: LegacyReservationRecommendationProperties) -> Self { + pub fn new(reservation_recommendation: ReservationRecommendation, properties: LegacyReservationRecommendationPropertiesUnion) -> Self { Self { reservation_recommendation, properties, @@ -1021,6 +1029,12 @@ impl LegacyReservationRecommendationProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "scope")] +pub enum LegacyReservationRecommendationPropertiesUnion { + Shared(LegacySharedScopeReservationRecommendationProperties), + Single(LegacySingleScopeReservationRecommendationProperties), +} #[doc = "Legacy Reservation transaction resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LegacyReservationTransaction { @@ -1848,10 +1862,10 @@ pub struct ModernReservationRecommendation { #[serde(flatten)] pub reservation_recommendation: ReservationRecommendation, #[doc = "The properties of the reservation recommendation."] - pub properties: ModernReservationRecommendationProperties, + pub properties: ModernReservationRecommendationPropertiesUnion, } impl ModernReservationRecommendation { - pub fn new(reservation_recommendation: ReservationRecommendation, properties: ModernReservationRecommendationProperties) -> Self { + pub fn new(reservation_recommendation: ReservationRecommendation, properties: ModernReservationRecommendationPropertiesUnion) -> Self { Self { reservation_recommendation, properties, @@ -1940,6 +1954,12 @@ impl ModernReservationRecommendationProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "scope")] +pub enum ModernReservationRecommendationPropertiesUnion { + Shared(ModernSharedScopeReservationRecommendationProperties), + Single(ModernSingleScopeReservationRecommendationProperties), +} #[doc = "Modern Reservation transaction resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ModernReservationTransaction { @@ -2982,6 +3002,14 @@ pub mod reservation_recommendation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ReservationRecommendationUnion { + #[serde(rename = "legacy")] + Legacy(LegacyReservationRecommendation), + #[serde(rename = "modern")] + Modern(ModernReservationRecommendation), +} #[doc = "Details of estimated savings. The costs and savings are estimated for the term."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReservationRecommendationDetailsCalculatedSavingsProperties { @@ -3161,7 +3189,7 @@ pub struct ReservationRecommendationsListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link (url) to the next page of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -3522,6 +3550,14 @@ pub mod usage_detail { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum UsageDetailUnion { + #[serde(rename = "legacy")] + Legacy(LegacyUsageDetail), + #[serde(rename = "modern")] + Modern(ModernUsageDetail), +} #[doc = "Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing period."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UsageDetailsListResult { @@ -3531,7 +3567,7 @@ pub struct UsageDetailsListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link (url) to the next page of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/consumption/src/package_2023_11/models.rs b/services/mgmt/consumption/src/package_2023_11/models.rs index 23b88a14f5..d8be415b91 100644 --- a/services/mgmt/consumption/src/package_2023_11/models.rs +++ b/services/mgmt/consumption/src/package_2023_11/models.rs @@ -476,6 +476,14 @@ pub mod charge_summary { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ChargeSummaryUnion { + #[serde(rename = "legacy")] + Legacy(LegacyChargeSummary), + #[serde(rename = "modern")] + Modern(ModernChargeSummary), +} #[doc = "Result of listing charge summary."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChargesListResult { @@ -485,7 +493,7 @@ pub struct ChargesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl ChargesListResult { pub fn new() -> Self { @@ -937,10 +945,10 @@ pub struct LegacyReservationRecommendation { #[serde(flatten)] pub reservation_recommendation: ReservationRecommendation, #[doc = "The properties of the reservation recommendation."] - pub properties: LegacyReservationRecommendationProperties, + pub properties: LegacyReservationRecommendationPropertiesUnion, } impl LegacyReservationRecommendation { - pub fn new(reservation_recommendation: ReservationRecommendation, properties: LegacyReservationRecommendationProperties) -> Self { + pub fn new(reservation_recommendation: ReservationRecommendation, properties: LegacyReservationRecommendationPropertiesUnion) -> Self { Self { reservation_recommendation, properties, @@ -1021,6 +1029,12 @@ impl LegacyReservationRecommendationProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "scope")] +pub enum LegacyReservationRecommendationPropertiesUnion { + Shared(LegacySharedScopeReservationRecommendationProperties), + Single(LegacySingleScopeReservationRecommendationProperties), +} #[doc = "Legacy Reservation transaction resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LegacyReservationTransaction { @@ -1891,10 +1905,10 @@ pub struct ModernReservationRecommendation { #[serde(flatten)] pub reservation_recommendation: ReservationRecommendation, #[doc = "The properties of the reservation recommendation."] - pub properties: ModernReservationRecommendationProperties, + pub properties: ModernReservationRecommendationPropertiesUnion, } impl ModernReservationRecommendation { - pub fn new(reservation_recommendation: ReservationRecommendation, properties: ModernReservationRecommendationProperties) -> Self { + pub fn new(reservation_recommendation: ReservationRecommendation, properties: ModernReservationRecommendationPropertiesUnion) -> Self { Self { reservation_recommendation, properties, @@ -1983,6 +1997,12 @@ impl ModernReservationRecommendationProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "scope")] +pub enum ModernReservationRecommendationPropertiesUnion { + Shared(ModernSharedScopeReservationRecommendationProperties), + Single(ModernSingleScopeReservationRecommendationProperties), +} #[doc = "Modern Reservation transaction resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ModernReservationTransaction { @@ -3025,6 +3045,14 @@ pub mod reservation_recommendation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ReservationRecommendationUnion { + #[serde(rename = "legacy")] + Legacy(LegacyReservationRecommendation), + #[serde(rename = "modern")] + Modern(ModernReservationRecommendation), +} #[doc = "Details of estimated savings. The costs and savings are estimated for the term."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReservationRecommendationDetailsCalculatedSavingsProperties { @@ -3204,7 +3232,7 @@ pub struct ReservationRecommendationsListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link (url) to the next page of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -3565,6 +3593,14 @@ pub mod usage_detail { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum UsageDetailUnion { + #[serde(rename = "legacy")] + Legacy(LegacyUsageDetail), + #[serde(rename = "modern")] + Modern(ModernUsageDetail), +} #[doc = "Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing period."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UsageDetailsListResult { @@ -3574,7 +3610,7 @@ pub struct UsageDetailsListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link (url) to the next page of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/containerregistry/src/package_2022_12/mod.rs b/services/mgmt/containerregistry/src/package_2022_12/mod.rs index 3a7fa53495..391dc5376f 100644 --- a/services/mgmt/containerregistry/src/package_2022_12/mod.rs +++ b/services/mgmt/containerregistry/src/package_2022_12/mod.rs @@ -426,7 +426,7 @@ pub mod registries { subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - run_request: impl Into, + run_request: impl Into, ) -> schedule_run::RequestBuilder { schedule_run::RequestBuilder { client: self.0.clone(), @@ -2278,7 +2278,7 @@ pub mod registries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) run_request: models::RunRequest, + pub(crate) run_request: models::RunRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/containerregistry/src/package_2022_12/models.rs b/services/mgmt/containerregistry/src/package_2022_12/models.rs index 6eba58e44e..71252158ac 100644 --- a/services/mgmt/containerregistry/src/package_2022_12/models.rs +++ b/services/mgmt/containerregistry/src/package_2022_12/models.rs @@ -4117,6 +4117,14 @@ impl RunRequest { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum RunRequestUnion { + DockerBuildRequest(DockerBuildRequest), + EncodedTaskRunRequest(EncodedTaskRunRequest), + FileTaskRunRequest(FileTaskRunRequest), + TaskRunRequest(TaskRunRequest), +} #[doc = "The set of run properties that can be updated."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunUpdateParameters { @@ -5083,7 +5091,7 @@ pub struct TaskProperties { pub timeout: Option, #[doc = "Base properties for any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties of a trigger."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -5207,7 +5215,7 @@ pub struct TaskPropertiesUpdateParameters { pub timeout: Option, #[doc = "Base properties for updating any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties for updating triggers."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -5316,7 +5324,7 @@ pub struct TaskRunProperties { pub provisioning_state: Option, #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "Run resource properties"] #[serde(rename = "runResult", default, skip_serializing_if = "Option::is_none")] pub run_result: Option, @@ -5382,7 +5390,7 @@ pub mod task_run_properties { pub struct TaskRunPropertiesUpdateParameters { #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "How the run should be forced to rerun even if the run request configuration has not changed"] #[serde(rename = "forceUpdateTag", default, skip_serializing_if = "Option::is_none")] pub force_update_tag: Option, @@ -5506,6 +5514,13 @@ pub mod task_step_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepPropertiesUnion { + Docker(DockerBuildStep), + EncodedTask(EncodedTaskStep), + FileTask(FileTaskStep), +} #[doc = "Base properties for updating any task step."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaskStepUpdateParameters { @@ -5570,6 +5585,13 @@ pub mod task_step_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepUpdateParametersUnion { + Docker(DockerBuildStepUpdateParameters), + EncodedTask(EncodedTaskStepUpdateParameters), + FileTask(FileTaskStepUpdateParameters), +} #[doc = "The parameters for updating a task."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskUpdateParameters { diff --git a/services/mgmt/containerregistry/src/package_2023_01_preview/mod.rs b/services/mgmt/containerregistry/src/package_2023_01_preview/mod.rs index fdeb80770a..f1d10f7601 100644 --- a/services/mgmt/containerregistry/src/package_2023_01_preview/mod.rs +++ b/services/mgmt/containerregistry/src/package_2023_01_preview/mod.rs @@ -3674,7 +3674,7 @@ pub mod registries { subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - run_request: impl Into, + run_request: impl Into, ) -> schedule_run::RequestBuilder { schedule_run::RequestBuilder { client: self.0.clone(), @@ -5526,7 +5526,7 @@ pub mod registries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) run_request: models::RunRequest, + pub(crate) run_request: models::RunRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/containerregistry/src/package_2023_01_preview/models.rs b/services/mgmt/containerregistry/src/package_2023_01_preview/models.rs index ba47ffbcb8..8a746f7c4a 100644 --- a/services/mgmt/containerregistry/src/package_2023_01_preview/models.rs +++ b/services/mgmt/containerregistry/src/package_2023_01_preview/models.rs @@ -5774,6 +5774,14 @@ impl RunRequest { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum RunRequestUnion { + DockerBuildRequest(DockerBuildRequest), + EncodedTaskRunRequest(EncodedTaskRunRequest), + FileTaskRunRequest(FileTaskRunRequest), + TaskRunRequest(TaskRunRequest), +} #[doc = "The set of run properties that can be updated."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunUpdateParameters { @@ -6881,7 +6889,7 @@ pub struct TaskProperties { pub timeout: Option, #[doc = "Base properties for any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties of a trigger."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -7005,7 +7013,7 @@ pub struct TaskPropertiesUpdateParameters { pub timeout: Option, #[doc = "Base properties for updating any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties for updating triggers."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -7114,7 +7122,7 @@ pub struct TaskRunProperties { pub provisioning_state: Option, #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "Run resource properties"] #[serde(rename = "runResult", default, skip_serializing_if = "Option::is_none")] pub run_result: Option, @@ -7180,7 +7188,7 @@ pub mod task_run_properties { pub struct TaskRunPropertiesUpdateParameters { #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "How the run should be forced to rerun even if the run request configuration has not changed"] #[serde(rename = "forceUpdateTag", default, skip_serializing_if = "Option::is_none")] pub force_update_tag: Option, @@ -7304,6 +7312,13 @@ pub mod task_step_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepPropertiesUnion { + Docker(DockerBuildStep), + EncodedTask(EncodedTaskStep), + FileTask(FileTaskStep), +} #[doc = "Base properties for updating any task step."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaskStepUpdateParameters { @@ -7368,6 +7383,13 @@ pub mod task_step_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepUpdateParametersUnion { + Docker(DockerBuildStepUpdateParameters), + EncodedTask(EncodedTaskStepUpdateParameters), + FileTask(FileTaskStepUpdateParameters), +} #[doc = "The parameters for updating a task."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskUpdateParameters { diff --git a/services/mgmt/containerregistry/src/package_2023_06_preview/mod.rs b/services/mgmt/containerregistry/src/package_2023_06_preview/mod.rs index acc1cac5b4..c7c1744e95 100644 --- a/services/mgmt/containerregistry/src/package_2023_06_preview/mod.rs +++ b/services/mgmt/containerregistry/src/package_2023_06_preview/mod.rs @@ -5080,7 +5080,7 @@ pub mod registries { subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - run_request: impl Into, + run_request: impl Into, ) -> schedule_run::RequestBuilder { schedule_run::RequestBuilder { client: self.0.clone(), @@ -6932,7 +6932,7 @@ pub mod registries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) run_request: models::RunRequest, + pub(crate) run_request: models::RunRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/containerregistry/src/package_2023_06_preview/models.rs b/services/mgmt/containerregistry/src/package_2023_06_preview/models.rs index a16eb57c5f..853309d35f 100644 --- a/services/mgmt/containerregistry/src/package_2023_06_preview/models.rs +++ b/services/mgmt/containerregistry/src/package_2023_06_preview/models.rs @@ -6091,6 +6091,14 @@ impl RunRequest { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum RunRequestUnion { + DockerBuildRequest(DockerBuildRequest), + EncodedTaskRunRequest(EncodedTaskRunRequest), + FileTaskRunRequest(FileTaskRunRequest), + TaskRunRequest(TaskRunRequest), +} #[doc = "The set of run properties that can be updated."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunUpdateParameters { @@ -7198,7 +7206,7 @@ pub struct TaskProperties { pub timeout: Option, #[doc = "Base properties for any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties of a trigger."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -7322,7 +7330,7 @@ pub struct TaskPropertiesUpdateParameters { pub timeout: Option, #[doc = "Base properties for updating any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties for updating triggers."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -7431,7 +7439,7 @@ pub struct TaskRunProperties { pub provisioning_state: Option, #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "Run resource properties"] #[serde(rename = "runResult", default, skip_serializing_if = "Option::is_none")] pub run_result: Option, @@ -7497,7 +7505,7 @@ pub mod task_run_properties { pub struct TaskRunPropertiesUpdateParameters { #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "How the run should be forced to rerun even if the run request configuration has not changed"] #[serde(rename = "forceUpdateTag", default, skip_serializing_if = "Option::is_none")] pub force_update_tag: Option, @@ -7621,6 +7629,13 @@ pub mod task_step_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepPropertiesUnion { + Docker(DockerBuildStep), + EncodedTask(EncodedTaskStep), + FileTask(FileTaskStep), +} #[doc = "Base properties for updating any task step."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaskStepUpdateParameters { @@ -7685,6 +7700,13 @@ pub mod task_step_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepUpdateParametersUnion { + Docker(DockerBuildStepUpdateParameters), + EncodedTask(EncodedTaskStepUpdateParameters), + FileTask(FileTaskStepUpdateParameters), +} #[doc = "The parameters for updating a task."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskUpdateParameters { diff --git a/services/mgmt/containerregistry/src/package_2023_07/mod.rs b/services/mgmt/containerregistry/src/package_2023_07/mod.rs index 60793e158d..90fdacf629 100644 --- a/services/mgmt/containerregistry/src/package_2023_07/mod.rs +++ b/services/mgmt/containerregistry/src/package_2023_07/mod.rs @@ -2088,7 +2088,7 @@ pub mod registries { subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - run_request: impl Into, + run_request: impl Into, ) -> schedule_run::RequestBuilder { schedule_run::RequestBuilder { client: self.0.clone(), @@ -3940,7 +3940,7 @@ pub mod registries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) run_request: models::RunRequest, + pub(crate) run_request: models::RunRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/containerregistry/src/package_2023_07/models.rs b/services/mgmt/containerregistry/src/package_2023_07/models.rs index acb030c8ae..1c579a705f 100644 --- a/services/mgmt/containerregistry/src/package_2023_07/models.rs +++ b/services/mgmt/containerregistry/src/package_2023_07/models.rs @@ -4565,6 +4565,14 @@ impl RunRequest { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum RunRequestUnion { + DockerBuildRequest(DockerBuildRequest), + EncodedTaskRunRequest(EncodedTaskRunRequest), + FileTaskRunRequest(FileTaskRunRequest), + TaskRunRequest(TaskRunRequest), +} #[doc = "The set of run properties that can be updated."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunUpdateParameters { @@ -5531,7 +5539,7 @@ pub struct TaskProperties { pub timeout: Option, #[doc = "Base properties for any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties of a trigger."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -5655,7 +5663,7 @@ pub struct TaskPropertiesUpdateParameters { pub timeout: Option, #[doc = "Base properties for updating any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties for updating triggers."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -5764,7 +5772,7 @@ pub struct TaskRunProperties { pub provisioning_state: Option, #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "Run resource properties"] #[serde(rename = "runResult", default, skip_serializing_if = "Option::is_none")] pub run_result: Option, @@ -5830,7 +5838,7 @@ pub mod task_run_properties { pub struct TaskRunPropertiesUpdateParameters { #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "How the run should be forced to rerun even if the run request configuration has not changed"] #[serde(rename = "forceUpdateTag", default, skip_serializing_if = "Option::is_none")] pub force_update_tag: Option, @@ -5954,6 +5962,13 @@ pub mod task_step_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepPropertiesUnion { + Docker(DockerBuildStep), + EncodedTask(EncodedTaskStep), + FileTask(FileTaskStep), +} #[doc = "Base properties for updating any task step."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaskStepUpdateParameters { @@ -6018,6 +6033,13 @@ pub mod task_step_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepUpdateParametersUnion { + Docker(DockerBuildStepUpdateParameters), + EncodedTask(EncodedTaskStepUpdateParameters), + FileTask(FileTaskStepUpdateParameters), +} #[doc = "The parameters for updating a task."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskUpdateParameters { diff --git a/services/mgmt/containerregistry/src/package_2023_08_preview/mod.rs b/services/mgmt/containerregistry/src/package_2023_08_preview/mod.rs index d32944b845..4d2f9210d9 100644 --- a/services/mgmt/containerregistry/src/package_2023_08_preview/mod.rs +++ b/services/mgmt/containerregistry/src/package_2023_08_preview/mod.rs @@ -5080,7 +5080,7 @@ pub mod registries { subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - run_request: impl Into, + run_request: impl Into, ) -> schedule_run::RequestBuilder { schedule_run::RequestBuilder { client: self.0.clone(), @@ -6932,7 +6932,7 @@ pub mod registries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) run_request: models::RunRequest, + pub(crate) run_request: models::RunRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/containerregistry/src/package_2023_08_preview/models.rs b/services/mgmt/containerregistry/src/package_2023_08_preview/models.rs index cb64593ff1..49b8bd0ee2 100644 --- a/services/mgmt/containerregistry/src/package_2023_08_preview/models.rs +++ b/services/mgmt/containerregistry/src/package_2023_08_preview/models.rs @@ -6139,6 +6139,14 @@ impl RunRequest { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum RunRequestUnion { + DockerBuildRequest(DockerBuildRequest), + EncodedTaskRunRequest(EncodedTaskRunRequest), + FileTaskRunRequest(FileTaskRunRequest), + TaskRunRequest(TaskRunRequest), +} #[doc = "The set of run properties that can be updated."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunUpdateParameters { @@ -7246,7 +7254,7 @@ pub struct TaskProperties { pub timeout: Option, #[doc = "Base properties for any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties of a trigger."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -7370,7 +7378,7 @@ pub struct TaskPropertiesUpdateParameters { pub timeout: Option, #[doc = "Base properties for updating any task step."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub step: Option, + pub step: Option, #[doc = "The properties for updating triggers."] #[serde(default, skip_serializing_if = "Option::is_none")] pub trigger: Option, @@ -7479,7 +7487,7 @@ pub struct TaskRunProperties { pub provisioning_state: Option, #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "Run resource properties"] #[serde(rename = "runResult", default, skip_serializing_if = "Option::is_none")] pub run_result: Option, @@ -7545,7 +7553,7 @@ pub mod task_run_properties { pub struct TaskRunPropertiesUpdateParameters { #[doc = "The request parameters for scheduling a run."] #[serde(rename = "runRequest", default, skip_serializing_if = "Option::is_none")] - pub run_request: Option, + pub run_request: Option, #[doc = "How the run should be forced to rerun even if the run request configuration has not changed"] #[serde(rename = "forceUpdateTag", default, skip_serializing_if = "Option::is_none")] pub force_update_tag: Option, @@ -7669,6 +7677,13 @@ pub mod task_step_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepPropertiesUnion { + Docker(DockerBuildStep), + EncodedTask(EncodedTaskStep), + FileTask(FileTaskStep), +} #[doc = "Base properties for updating any task step."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaskStepUpdateParameters { @@ -7733,6 +7748,13 @@ pub mod task_step_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TaskStepUpdateParametersUnion { + Docker(DockerBuildStepUpdateParameters), + EncodedTask(EncodedTaskStepUpdateParameters), + FileTask(FileTaskStepUpdateParameters), +} #[doc = "The parameters for updating a task."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskUpdateParameters { diff --git a/services/mgmt/cosmosdb/src/package_preview_2022_05/models.rs b/services/mgmt/cosmosdb/src/package_preview_2022_05/models.rs index 4945204bd0..af865310e6 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2022_05/models.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2022_05/models.rs @@ -342,6 +342,12 @@ impl BackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum BackupPolicyUnion { + Continuous(ContinuousModeBackupPolicy), + Periodic(PeriodicModeBackupPolicy), +} #[doc = "The object representing the state of the migration between the backup policies."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupPolicyMigrationState { @@ -1961,6 +1967,15 @@ pub mod data_transfer_data_source_sink { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "component")] +pub enum DataTransferDataSourceSinkUnion { + AzureBlobStorage(AzureBlobDataTransferDataSourceSink), + #[serde(rename = "CosmosDBCassandra")] + CosmosDbCassandra(CosmosCassandraDataTransferDataSourceSink), + #[serde(rename = "CosmosDBSql")] + CosmosDbSql(CosmosSqlDataTransferDataSourceSink), +} #[doc = "The List operation response, that contains the Data Transfer jobs and their properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTransferJobFeedResults { @@ -2007,9 +2022,9 @@ pub struct DataTransferJobProperties { #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] pub job_name: Option, #[doc = "Base class for all DataTransfer source/sink"] - pub source: DataTransferDataSourceSink, + pub source: DataTransferDataSourceSinkUnion, #[doc = "Base class for all DataTransfer source/sink"] - pub destination: DataTransferDataSourceSink, + pub destination: DataTransferDataSourceSinkUnion, #[doc = "Job Status"] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, @@ -2030,7 +2045,7 @@ pub struct DataTransferJobProperties { pub error: Option, } impl DataTransferJobProperties { - pub fn new(source: DataTransferDataSourceSink, destination: DataTransferDataSourceSink) -> Self { + pub fn new(source: DataTransferDataSourceSinkUnion, destination: DataTransferDataSourceSinkUnion) -> Self { Self { job_name: None, source, @@ -2248,7 +2263,7 @@ pub struct DatabaseAccountCreateUpdateProperties { pub create_mode: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -2443,7 +2458,7 @@ pub struct DatabaseAccountGetProperties { pub restore_parameters: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -2782,7 +2797,7 @@ pub struct DatabaseAccountUpdateProperties { pub analytical_storage_configuration: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -6662,7 +6677,7 @@ pub struct ServiceResource { pub arm_proxy_resource: ArmProxyResource, #[doc = "Services response resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -6793,6 +6808,15 @@ impl ServiceResourceProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceType")] +pub enum ServiceResourcePropertiesUnion { + DataTransfer(DataTransferServiceResourceProperties), + #[serde(rename = "GraphAPICompute")] + GraphApiCompute(GraphApiComputeServiceResourceProperties), + MaterializedViewsBuilder(MaterializedViewsBuilderServiceResourceProperties), + SqlDedicatedGateway(SqlDedicatedGatewayServiceResourceProperties), +} #[doc = "Describes the status of a service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceResourceStatus")] diff --git a/services/mgmt/cosmosdb/src/package_preview_2022_08/models.rs b/services/mgmt/cosmosdb/src/package_preview_2022_08/models.rs index 6dee5ce1bb..23671c9137 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2022_08/models.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2022_08/models.rs @@ -342,6 +342,12 @@ impl BackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum BackupPolicyUnion { + Continuous(ContinuousModeBackupPolicy), + Periodic(PeriodicModeBackupPolicy), +} #[doc = "The object representing the state of the migration between the backup policies."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupPolicyMigrationState { @@ -1983,6 +1989,17 @@ pub mod data_transfer_data_source_sink { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "component")] +pub enum DataTransferDataSourceSinkUnion { + AzureBlobStorage(AzureBlobDataTransferDataSourceSink), + #[serde(rename = "CosmosDBCassandra")] + CosmosDbCassandra(CosmosCassandraDataTransferDataSourceSink), + #[serde(rename = "CosmosDBMongo")] + CosmosDbMongo(CosmosMongoDataTransferDataSourceSink), + #[serde(rename = "CosmosDBSql")] + CosmosDbSql(CosmosSqlDataTransferDataSourceSink), +} #[doc = "The List operation response, that contains the Data Transfer jobs and their properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTransferJobFeedResults { @@ -2029,9 +2046,9 @@ pub struct DataTransferJobProperties { #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] pub job_name: Option, #[doc = "Base class for all DataTransfer source/sink"] - pub source: DataTransferDataSourceSink, + pub source: DataTransferDataSourceSinkUnion, #[doc = "Base class for all DataTransfer source/sink"] - pub destination: DataTransferDataSourceSink, + pub destination: DataTransferDataSourceSinkUnion, #[doc = "Job Status"] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, @@ -2052,7 +2069,7 @@ pub struct DataTransferJobProperties { pub error: Option, } impl DataTransferJobProperties { - pub fn new(source: DataTransferDataSourceSink, destination: DataTransferDataSourceSink) -> Self { + pub fn new(source: DataTransferDataSourceSinkUnion, destination: DataTransferDataSourceSinkUnion) -> Self { Self { job_name: None, source, @@ -2270,7 +2287,7 @@ pub struct DatabaseAccountCreateUpdateProperties { pub create_mode: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -2469,7 +2486,7 @@ pub struct DatabaseAccountGetProperties { pub restore_parameters: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -2811,7 +2828,7 @@ pub struct DatabaseAccountUpdateProperties { pub analytical_storage_configuration: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -6733,7 +6750,7 @@ pub struct ServiceResource { pub arm_proxy_resource: ArmProxyResource, #[doc = "Services response resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -6864,6 +6881,15 @@ impl ServiceResourceProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceType")] +pub enum ServiceResourcePropertiesUnion { + DataTransfer(DataTransferServiceResourceProperties), + #[serde(rename = "GraphAPICompute")] + GraphApiCompute(GraphApiComputeServiceResourceProperties), + MaterializedViewsBuilder(MaterializedViewsBuilderServiceResourceProperties), + SqlDedicatedGateway(SqlDedicatedGatewayServiceResourceProperties), +} #[doc = "Describes the status of a service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceResourceStatus")] diff --git a/services/mgmt/cosmosdb/src/package_preview_2022_11/models.rs b/services/mgmt/cosmosdb/src/package_preview_2022_11/models.rs index 3de94acc8d..8a2b803099 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2022_11/models.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2022_11/models.rs @@ -342,6 +342,12 @@ impl BackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum BackupPolicyUnion { + Continuous(ContinuousModeBackupPolicy), + Periodic(PeriodicModeBackupPolicy), +} #[doc = "The object representing the state of the migration between the backup policies."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupPolicyMigrationState { @@ -1961,6 +1967,15 @@ pub mod data_transfer_data_source_sink { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "component")] +pub enum DataTransferDataSourceSinkUnion { + AzureBlobStorage(AzureBlobDataTransferDataSourceSink), + #[serde(rename = "CosmosDBCassandra")] + CosmosDbCassandra(CosmosCassandraDataTransferDataSourceSink), + #[serde(rename = "CosmosDBSql")] + CosmosDbSql(CosmosSqlDataTransferDataSourceSink), +} #[doc = "The List operation response, that contains the Data Transfer jobs and their properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTransferJobFeedResults { @@ -2007,9 +2022,9 @@ pub struct DataTransferJobProperties { #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] pub job_name: Option, #[doc = "Base class for all DataTransfer source/sink"] - pub source: DataTransferDataSourceSink, + pub source: DataTransferDataSourceSinkUnion, #[doc = "Base class for all DataTransfer source/sink"] - pub destination: DataTransferDataSourceSink, + pub destination: DataTransferDataSourceSinkUnion, #[doc = "Job Status"] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, @@ -2030,7 +2045,7 @@ pub struct DataTransferJobProperties { pub error: Option, } impl DataTransferJobProperties { - pub fn new(source: DataTransferDataSourceSink, destination: DataTransferDataSourceSink) -> Self { + pub fn new(source: DataTransferDataSourceSinkUnion, destination: DataTransferDataSourceSinkUnion) -> Self { Self { job_name: None, source, @@ -2248,7 +2263,7 @@ pub struct DatabaseAccountCreateUpdateProperties { pub create_mode: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -2455,7 +2470,7 @@ pub struct DatabaseAccountGetProperties { pub restore_parameters: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -2803,7 +2818,7 @@ pub struct DatabaseAccountUpdateProperties { pub analytical_storage_configuration: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -6797,7 +6812,7 @@ pub struct ServiceResource { pub arm_proxy_resource: ArmProxyResource, #[doc = "Services response resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -6928,6 +6943,15 @@ impl ServiceResourceProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceType")] +pub enum ServiceResourcePropertiesUnion { + DataTransfer(DataTransferServiceResourceProperties), + #[serde(rename = "GraphAPICompute")] + GraphApiCompute(GraphApiComputeServiceResourceProperties), + MaterializedViewsBuilder(MaterializedViewsBuilderServiceResourceProperties), + SqlDedicatedGateway(SqlDedicatedGatewayServiceResourceProperties), +} #[doc = "Describes the status of a service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceResourceStatus")] diff --git a/services/mgmt/cosmosdb/src/package_preview_2023_03/models.rs b/services/mgmt/cosmosdb/src/package_preview_2023_03/models.rs index 77d313bcee..44fda0ac5b 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2023_03/models.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2023_03/models.rs @@ -342,6 +342,12 @@ impl BackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum BackupPolicyUnion { + Continuous(ContinuousModeBackupPolicy), + Periodic(PeriodicModeBackupPolicy), +} #[doc = "The object representing the state of the migration between the backup policies."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupPolicyMigrationState { @@ -2071,6 +2077,17 @@ pub mod data_transfer_data_source_sink { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "component")] +pub enum DataTransferDataSourceSinkUnion { + AzureBlobStorage(AzureBlobDataTransferDataSourceSink), + #[serde(rename = "CosmosDBCassandra")] + CosmosDbCassandra(CosmosCassandraDataTransferDataSourceSink), + #[serde(rename = "CosmosDBMongo")] + CosmosDbMongo(CosmosMongoDataTransferDataSourceSink), + #[serde(rename = "CosmosDBSql")] + CosmosDbSql(CosmosSqlDataTransferDataSourceSink), +} #[doc = "The List operation response, that contains the Data Transfer jobs and their properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTransferJobFeedResults { @@ -2117,9 +2134,9 @@ pub struct DataTransferJobProperties { #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] pub job_name: Option, #[doc = "Base class for all DataTransfer source/sink"] - pub source: DataTransferDataSourceSink, + pub source: DataTransferDataSourceSinkUnion, #[doc = "Base class for all DataTransfer source/sink"] - pub destination: DataTransferDataSourceSink, + pub destination: DataTransferDataSourceSinkUnion, #[doc = "Job Status"] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, @@ -2140,7 +2157,7 @@ pub struct DataTransferJobProperties { pub error: Option, } impl DataTransferJobProperties { - pub fn new(source: DataTransferDataSourceSink, destination: DataTransferDataSourceSink) -> Self { + pub fn new(source: DataTransferDataSourceSinkUnion, destination: DataTransferDataSourceSinkUnion) -> Self { Self { job_name: None, source, @@ -2358,7 +2375,7 @@ pub struct DatabaseAccountCreateUpdateProperties { pub create_mode: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -2565,7 +2582,7 @@ pub struct DatabaseAccountGetProperties { pub restore_parameters: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -2913,7 +2930,7 @@ pub struct DatabaseAccountUpdateProperties { pub analytical_storage_configuration: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -7309,7 +7326,7 @@ pub struct ServiceResource { pub arm_proxy_resource: ArmProxyResource, #[doc = "Services response resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -7440,6 +7457,15 @@ impl ServiceResourceProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceType")] +pub enum ServiceResourcePropertiesUnion { + DataTransfer(DataTransferServiceResourceProperties), + #[serde(rename = "GraphAPICompute")] + GraphApiCompute(GraphApiComputeServiceResourceProperties), + MaterializedViewsBuilder(MaterializedViewsBuilderServiceResourceProperties), + SqlDedicatedGateway(SqlDedicatedGatewayServiceResourceProperties), +} #[doc = "Describes the status of a service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceResourceStatus")] diff --git a/services/mgmt/cosmosdb/src/package_preview_2023_03_15/models.rs b/services/mgmt/cosmosdb/src/package_preview_2023_03_15/models.rs index 04365b406d..bdb3d159a3 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2023_03_15/models.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2023_03_15/models.rs @@ -345,6 +345,12 @@ impl BackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum BackupPolicyUnion { + Continuous(ContinuousModeBackupPolicy), + Periodic(PeriodicModeBackupPolicy), +} #[doc = "The object representing the state of the migration between the backup policies."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupPolicyMigrationState { @@ -2108,6 +2114,17 @@ pub mod data_transfer_data_source_sink { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "component")] +pub enum DataTransferDataSourceSinkUnion { + AzureBlobStorage(AzureBlobDataTransferDataSourceSink), + #[serde(rename = "CosmosDBCassandra")] + CosmosDbCassandra(CosmosCassandraDataTransferDataSourceSink), + #[serde(rename = "CosmosDBMongo")] + CosmosDbMongo(CosmosMongoDataTransferDataSourceSink), + #[serde(rename = "CosmosDBSql")] + CosmosDbSql(CosmosSqlDataTransferDataSourceSink), +} #[doc = "The List operation response, that contains the Data Transfer jobs and their properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTransferJobFeedResults { @@ -2154,9 +2171,9 @@ pub struct DataTransferJobProperties { #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] pub job_name: Option, #[doc = "Base class for all DataTransfer source/sink"] - pub source: DataTransferDataSourceSink, + pub source: DataTransferDataSourceSinkUnion, #[doc = "Base class for all DataTransfer source/sink"] - pub destination: DataTransferDataSourceSink, + pub destination: DataTransferDataSourceSinkUnion, #[doc = "Job Status"] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, @@ -2177,7 +2194,7 @@ pub struct DataTransferJobProperties { pub error: Option, } impl DataTransferJobProperties { - pub fn new(source: DataTransferDataSourceSink, destination: DataTransferDataSourceSink) -> Self { + pub fn new(source: DataTransferDataSourceSinkUnion, destination: DataTransferDataSourceSinkUnion) -> Self { Self { job_name: None, source, @@ -2497,7 +2514,7 @@ pub struct DatabaseAccountCreateUpdateProperties { pub create_mode: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -2704,7 +2721,7 @@ pub struct DatabaseAccountGetProperties { pub restore_parameters: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -3052,7 +3069,7 @@ pub struct DatabaseAccountUpdateProperties { pub analytical_storage_configuration: Option, #[doc = "The object representing the policy for taking backups on an account."] #[serde(rename = "backupPolicy", default, skip_serializing_if = "Option::is_none")] - pub backup_policy: Option, + pub backup_policy: Option, #[doc = "The CORS policy for the Cosmos DB database account."] #[serde( default, @@ -7532,7 +7549,7 @@ pub struct ServiceResource { pub arm_proxy_resource: ArmProxyResource, #[doc = "Services response resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -7663,6 +7680,15 @@ impl ServiceResourceProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceType")] +pub enum ServiceResourcePropertiesUnion { + DataTransfer(DataTransferServiceResourceProperties), + #[serde(rename = "GraphAPICompute")] + GraphApiCompute(GraphApiComputeServiceResourceProperties), + MaterializedViewsBuilder(MaterializedViewsBuilderServiceResourceProperties), + SqlDedicatedGateway(SqlDedicatedGatewayServiceResourceProperties), +} #[doc = "Describes the status of a service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceResourceStatus")] diff --git a/services/mgmt/costmanagement/src/package_preview_2023_04/models.rs b/services/mgmt/costmanagement/src/package_preview_2023_04/models.rs index e77eb6269e..71ec60461e 100644 --- a/services/mgmt/costmanagement/src/package_preview_2023_04/models.rs +++ b/services/mgmt/costmanagement/src/package_preview_2023_04/models.rs @@ -598,7 +598,7 @@ pub struct BenefitUtilizationSummariesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link (URL) to the next page of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -630,6 +630,12 @@ impl BenefitUtilizationSummary { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum BenefitUtilizationSummaryUnion { + IncludedQuantity(IncludedQuantityUtilizationSummary), + SavingsPlan(SavingsPlanUtilizationSummary), +} #[doc = "The properties of a benefit utilization summary."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BenefitUtilizationSummaryProperties { @@ -5384,7 +5390,7 @@ pub struct BenefitRecommendationModel { pub benefit_resource: BenefitResource, #[doc = "The properties of the benefit recommendations."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BenefitRecommendationModel { pub fn new() -> Self { @@ -5452,6 +5458,12 @@ impl BenefitRecommendationProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "scope")] +pub enum BenefitRecommendationPropertiesUnion { + Shared(SharedScopeBenefitRecommendationProperties), + Single(SingleScopeBenefitRecommendationProperties), +} #[doc = "Result of listing benefit recommendations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BenefitRecommendationsListResult { diff --git a/services/mgmt/databox/src/package_2022_02/mod.rs b/services/mgmt/databox/src/package_2022_02/mod.rs index cf1e3fdcb8..0cdd6b5a5f 100644 --- a/services/mgmt/databox/src/package_2022_02/mod.rs +++ b/services/mgmt/databox/src/package_2022_02/mod.rs @@ -1778,7 +1778,7 @@ pub mod service { subscription_id: impl Into, resource_group_name: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs_by_resource_group::RequestBuilder { validate_inputs_by_resource_group::RequestBuilder { client: self.0.clone(), @@ -1798,7 +1798,7 @@ pub mod service { &self, subscription_id: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs::RequestBuilder { validate_inputs::RequestBuilder { client: self.0.clone(), @@ -2140,7 +2140,7 @@ pub mod service { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2249,7 +2249,7 @@ pub mod service { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/databox/src/package_2022_02/models.rs b/services/mgmt/databox/src/package_2022_02/models.rs index c369052a8d..d708d85784 100644 --- a/services/mgmt/databox/src/package_2022_02/models.rs +++ b/services/mgmt/databox/src/package_2022_02/models.rs @@ -383,6 +383,14 @@ pub mod copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum CopyLogDetailsUnion { + DataBox(DataBoxAccountCopyLogDetails), + DataBoxCustomerDisk(DataBoxCustomerDiskCopyLogDetails), + DataBoxDisk(DataBoxDiskCopyLogDetails), + DataBoxHeavy(DataBoxHeavyAccountCopyLogDetails), +} #[doc = "Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CopyProgress { @@ -579,6 +587,12 @@ pub mod data_account_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dataAccountType")] +pub enum DataAccountDetailsUnion { + ManagedDisk(ManagedDiskDetails), + StorageAccount(StorageAccountDetails), +} #[doc = "Copy log details for a storage account of a DataBox job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataBoxAccountCopyLogDetails { @@ -1285,10 +1299,10 @@ pub struct DataExportDetails { pub log_collection_level: Option, #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, } impl DataExportDetails { - pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetails) -> Self { + pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetailsUnion) -> Self { Self { transfer_configuration, log_collection_level: None, @@ -1315,13 +1329,13 @@ pub mod data_export_details { pub struct DataImportDetails { #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, #[doc = "Level of the logs to be collected."] #[serde(rename = "logCollectionLevel", default, skip_serializing_if = "Option::is_none")] pub log_collection_level: Option, } impl DataImportDetails { - pub fn new(account_details: DataAccountDetails) -> Self { + pub fn new(account_details: DataAccountDetailsUnion) -> Self { Self { account_details, log_collection_level: None, @@ -1613,6 +1627,12 @@ pub mod datacenter_address_response { DatacenterAddressInstruction, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "datacenterAddressType")] +pub enum DatacenterAddressResponseUnion { + DatacenterAddressInstruction(DatacenterAddressInstructionResponse), + DatacenterAddressLocation(DatacenterAddressLocationResponse), +} #[doc = "Dc access security code"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DcAccessSecurityCode { @@ -1822,6 +1842,11 @@ pub mod granular_copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum GranularCopyLogDetailsUnion { + DataBoxCustomerDisk(DataBoxDiskGranularCopyLogDetails), +} #[doc = "Granular Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GranularCopyProgress { @@ -2009,7 +2034,7 @@ pub struct JobDetails { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub copy_log_details: Vec, + pub copy_log_details: Vec, #[doc = "Shared access key to download the return shipment label"] #[serde(rename = "reverseShipmentLabelSasKey", default, skip_serializing_if = "Option::is_none")] pub reverse_shipment_label_sas_key: Option, @@ -2037,7 +2062,7 @@ pub struct JobDetails { pub last_mitigation_action_on_job: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddress", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address: Option, + pub datacenter_address: Option, #[doc = "DataCenter code."] #[serde(rename = "dataCenterCode", default, skip_serializing_if = "Option::is_none")] pub data_center_code: Option, @@ -2286,6 +2311,14 @@ pub mod job_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobDetailsType")] +pub enum JobDetailsUnion { + DataBoxCustomerDisk(DataBoxCustomerDiskJobDetails), + DataBoxDisk(DataBoxDiskJobDetails), + DataBoxHeavy(DataBoxHeavyJobDetails), + DataBox(DataBoxJobDetails), +} #[doc = "Job Properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobProperties { @@ -2315,7 +2348,7 @@ pub struct JobProperties { pub error: Option, #[doc = "Job details."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option, + pub details: Option, #[doc = "Reason for cancellation."] #[serde(rename = "cancellationReason", default, skip_serializing_if = "Option::is_none")] pub cancellation_reason: Option, @@ -2558,6 +2591,14 @@ pub mod job_secrets { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobSecretsType")] +pub enum JobSecretsUnion { + DataBoxCustomerDisk(CustomerDiskJobSecrets), + DataBoxDisk(DataBoxDiskJobSecrets), + DataBoxHeavy(DataBoxHeavyJobSecrets), + DataBox(DataboxJobSecrets), +} #[doc = "Job stages."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobStages { @@ -3112,7 +3153,7 @@ pub mod preferences_validation_response_properties { pub struct RegionConfigurationRequest { #[doc = "Request body to get the availability for scheduling orders."] #[serde(rename = "scheduleAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] - pub schedule_availability_request: Option, + pub schedule_availability_request: Option, #[doc = "Request body to get the transport availability for given sku."] #[serde(rename = "transportAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] pub transport_availability_request: Option, @@ -3136,7 +3177,7 @@ pub struct RegionConfigurationResponse { pub transport_availability_response: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddressResponse", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address_response: Option, + pub datacenter_address_response: Option, } impl RegionConfigurationResponse { pub fn new() -> Self { @@ -3221,6 +3262,13 @@ pub mod schedule_availability_request { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "skuName")] +pub enum ScheduleAvailabilityRequestUnion { + DataBox(DataBoxScheduleAvailabilityRequest), + DataBoxDisk(DiskScheduleAvailabilityRequest), + DataBoxHeavy(HeavyScheduleAvailabilityRequest), +} #[doc = "Schedule availability for given sku in a region."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScheduleAvailabilityResponse { @@ -3880,7 +3928,7 @@ pub struct UnencryptedCredentials { pub job_name: Option, #[doc = "The base class for the secrets"] #[serde(rename = "jobSecrets", default, skip_serializing_if = "Option::is_none")] - pub job_secrets: Option, + pub job_secrets: Option, } impl UnencryptedCredentials { pub fn new() -> Self { @@ -4037,6 +4085,16 @@ pub mod validation_input_request { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputRequestUnion { + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationRequest), + ValidateDataTransferDetails(DataTransferDetailsValidationRequest), + ValidatePreferences(PreferencesValidationRequest), + ValidateSkuAvailability(SkuAvailabilityValidationRequest), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationRequest), + ValidateAddress(ValidateAddress), +} #[doc = "Minimum properties that should be present in each individual validation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationInputResponse { @@ -4068,6 +4126,16 @@ pub mod validation_input_response { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputResponseUnion { + ValidateAddress(AddressValidationProperties), + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationResponseProperties), + ValidateDataTransferDetails(DataTransferDetailsValidationResponseProperties), + ValidatePreferences(PreferencesValidationResponseProperties), + ValidateSkuAvailability(SkuAvailabilityValidationResponseProperties), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationResponseProperties), +} #[doc = "Minimum request requirement of any validation category."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationRequest { @@ -4076,12 +4144,12 @@ pub struct ValidationRequest { pub validation_category: validation_request::ValidationCategory, #[doc = "List of request details contain validationType and its request as key and value respectively."] #[serde(rename = "individualRequestDetails")] - pub individual_request_details: Vec, + pub individual_request_details: Vec, } impl ValidationRequest { pub fn new( validation_category: validation_request::ValidationCategory, - individual_request_details: Vec, + individual_request_details: Vec, ) -> Self { Self { validation_category, @@ -4097,6 +4165,11 @@ pub mod validation_request { JobCreationValidation, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationCategory")] +pub enum ValidationRequestUnion { + JobCreationValidation(CreateJobValidations), +} #[doc = "Response of pre job creation validations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationResponse { @@ -4122,7 +4195,7 @@ pub struct ValidationResponseProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub individual_response_details: Vec, + pub individual_response_details: Vec, } impl ValidationResponseProperties { pub fn new() -> Self { diff --git a/services/mgmt/databox/src/package_2022_09/mod.rs b/services/mgmt/databox/src/package_2022_09/mod.rs index 6d71351749..de3e377d17 100644 --- a/services/mgmt/databox/src/package_2022_09/mod.rs +++ b/services/mgmt/databox/src/package_2022_09/mod.rs @@ -1798,7 +1798,7 @@ pub mod service { subscription_id: impl Into, resource_group_name: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs_by_resource_group::RequestBuilder { validate_inputs_by_resource_group::RequestBuilder { client: self.0.clone(), @@ -1818,7 +1818,7 @@ pub mod service { &self, subscription_id: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs::RequestBuilder { validate_inputs::RequestBuilder { client: self.0.clone(), @@ -2160,7 +2160,7 @@ pub mod service { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2269,7 +2269,7 @@ pub mod service { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/databox/src/package_2022_09/models.rs b/services/mgmt/databox/src/package_2022_09/models.rs index 6829222cdb..6f914b1dc6 100644 --- a/services/mgmt/databox/src/package_2022_09/models.rs +++ b/services/mgmt/databox/src/package_2022_09/models.rs @@ -408,6 +408,14 @@ pub mod copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum CopyLogDetailsUnion { + DataBox(DataBoxAccountCopyLogDetails), + DataBoxCustomerDisk(DataBoxCustomerDiskCopyLogDetails), + DataBoxDisk(DataBoxDiskCopyLogDetails), + DataBoxHeavy(DataBoxHeavyAccountCopyLogDetails), +} #[doc = "Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CopyProgress { @@ -604,6 +612,12 @@ pub mod data_account_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dataAccountType")] +pub enum DataAccountDetailsUnion { + ManagedDisk(ManagedDiskDetails), + StorageAccount(StorageAccountDetails), +} #[doc = "Copy log details for a storage account of a DataBox job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataBoxAccountCopyLogDetails { @@ -1310,10 +1324,10 @@ pub struct DataExportDetails { pub log_collection_level: Option, #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, } impl DataExportDetails { - pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetails) -> Self { + pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetailsUnion) -> Self { Self { transfer_configuration, log_collection_level: None, @@ -1340,13 +1354,13 @@ pub mod data_export_details { pub struct DataImportDetails { #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, #[doc = "Level of the logs to be collected."] #[serde(rename = "logCollectionLevel", default, skip_serializing_if = "Option::is_none")] pub log_collection_level: Option, } impl DataImportDetails { - pub fn new(account_details: DataAccountDetails) -> Self { + pub fn new(account_details: DataAccountDetailsUnion) -> Self { Self { account_details, log_collection_level: None, @@ -1638,6 +1652,12 @@ pub mod datacenter_address_response { DatacenterAddressInstruction, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "datacenterAddressType")] +pub enum DatacenterAddressResponseUnion { + DatacenterAddressInstruction(DatacenterAddressInstructionResponse), + DatacenterAddressLocation(DatacenterAddressLocationResponse), +} #[doc = "Dc access security code"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DcAccessSecurityCode { @@ -1847,6 +1867,11 @@ pub mod granular_copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum GranularCopyLogDetailsUnion { + DataBoxCustomerDisk(DataBoxDiskGranularCopyLogDetails), +} #[doc = "Granular Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GranularCopyProgress { @@ -2037,7 +2062,7 @@ pub struct JobDetails { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub copy_log_details: Vec, + pub copy_log_details: Vec, #[doc = "Shared access key to download the return shipment label"] #[serde(rename = "reverseShipmentLabelSasKey", default, skip_serializing_if = "Option::is_none")] pub reverse_shipment_label_sas_key: Option, @@ -2065,7 +2090,7 @@ pub struct JobDetails { pub last_mitigation_action_on_job: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddress", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address: Option, + pub datacenter_address: Option, #[doc = "DataCenter code."] #[serde(rename = "dataCenterCode", default, skip_serializing_if = "Option::is_none")] pub data_center_code: Option, @@ -2315,6 +2340,14 @@ pub mod job_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobDetailsType")] +pub enum JobDetailsUnion { + DataBoxCustomerDisk(DataBoxCustomerDiskJobDetails), + DataBoxDisk(DataBoxDiskJobDetails), + DataBoxHeavy(DataBoxHeavyJobDetails), + DataBox(DataBoxJobDetails), +} #[doc = "Job Properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobProperties { @@ -2350,7 +2383,7 @@ pub struct JobProperties { pub error: Option, #[doc = "Job details."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option, + pub details: Option, #[doc = "Reason for cancellation."] #[serde(rename = "cancellationReason", default, skip_serializing_if = "Option::is_none")] pub cancellation_reason: Option, @@ -2609,6 +2642,14 @@ pub mod job_secrets { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobSecretsType")] +pub enum JobSecretsUnion { + DataBoxCustomerDisk(CustomerDiskJobSecrets), + DataBoxDisk(DataBoxDiskJobSecrets), + DataBoxHeavy(DataBoxHeavyJobSecrets), + DataBox(DataboxJobSecrets), +} #[doc = "Job stages."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobStages { @@ -3166,7 +3207,7 @@ pub mod preferences_validation_response_properties { pub struct RegionConfigurationRequest { #[doc = "Request body to get the availability for scheduling orders."] #[serde(rename = "scheduleAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] - pub schedule_availability_request: Option, + pub schedule_availability_request: Option, #[doc = "Request body to get the transport availability for given sku."] #[serde(rename = "transportAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] pub transport_availability_request: Option, @@ -3190,7 +3231,7 @@ pub struct RegionConfigurationResponse { pub transport_availability_response: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddressResponse", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address_response: Option, + pub datacenter_address_response: Option, } impl RegionConfigurationResponse { pub fn new() -> Self { @@ -3293,6 +3334,13 @@ pub mod schedule_availability_request { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "skuName")] +pub enum ScheduleAvailabilityRequestUnion { + DataBox(DataBoxScheduleAvailabilityRequest), + DataBoxDisk(DiskScheduleAvailabilityRequest), + DataBoxHeavy(HeavyScheduleAvailabilityRequest), +} #[doc = "Schedule availability for given sku in a region."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScheduleAvailabilityResponse { @@ -3966,7 +4014,7 @@ pub struct UnencryptedCredentials { pub job_name: Option, #[doc = "The base class for the secrets"] #[serde(rename = "jobSecrets", default, skip_serializing_if = "Option::is_none")] - pub job_secrets: Option, + pub job_secrets: Option, } impl UnencryptedCredentials { pub fn new() -> Self { @@ -4129,6 +4177,16 @@ pub mod validation_input_request { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputRequestUnion { + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationRequest), + ValidateDataTransferDetails(DataTransferDetailsValidationRequest), + ValidatePreferences(PreferencesValidationRequest), + ValidateSkuAvailability(SkuAvailabilityValidationRequest), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationRequest), + ValidateAddress(ValidateAddress), +} #[doc = "Minimum properties that should be present in each individual validation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationInputResponse { @@ -4160,6 +4218,16 @@ pub mod validation_input_response { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputResponseUnion { + ValidateAddress(AddressValidationProperties), + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationResponseProperties), + ValidateDataTransferDetails(DataTransferDetailsValidationResponseProperties), + ValidatePreferences(PreferencesValidationResponseProperties), + ValidateSkuAvailability(SkuAvailabilityValidationResponseProperties), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationResponseProperties), +} #[doc = "Minimum request requirement of any validation category."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationRequest { @@ -4168,12 +4236,12 @@ pub struct ValidationRequest { pub validation_category: validation_request::ValidationCategory, #[doc = "List of request details contain validationType and its request as key and value respectively."] #[serde(rename = "individualRequestDetails")] - pub individual_request_details: Vec, + pub individual_request_details: Vec, } impl ValidationRequest { pub fn new( validation_category: validation_request::ValidationCategory, - individual_request_details: Vec, + individual_request_details: Vec, ) -> Self { Self { validation_category, @@ -4189,6 +4257,11 @@ pub mod validation_request { JobCreationValidation, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationCategory")] +pub enum ValidationRequestUnion { + JobCreationValidation(CreateJobValidations), +} #[doc = "Response of pre job creation validations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationResponse { @@ -4214,7 +4287,7 @@ pub struct ValidationResponseProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub individual_response_details: Vec, + pub individual_response_details: Vec, } impl ValidationResponseProperties { pub fn new() -> Self { diff --git a/services/mgmt/databox/src/package_2022_10/mod.rs b/services/mgmt/databox/src/package_2022_10/mod.rs index 825d4e95e1..8a37028c72 100644 --- a/services/mgmt/databox/src/package_2022_10/mod.rs +++ b/services/mgmt/databox/src/package_2022_10/mod.rs @@ -1798,7 +1798,7 @@ pub mod service { subscription_id: impl Into, resource_group_name: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs_by_resource_group::RequestBuilder { validate_inputs_by_resource_group::RequestBuilder { client: self.0.clone(), @@ -1818,7 +1818,7 @@ pub mod service { &self, subscription_id: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs::RequestBuilder { validate_inputs::RequestBuilder { client: self.0.clone(), @@ -2160,7 +2160,7 @@ pub mod service { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2269,7 +2269,7 @@ pub mod service { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/databox/src/package_2022_10/models.rs b/services/mgmt/databox/src/package_2022_10/models.rs index eaa98085fd..e5f2c45e82 100644 --- a/services/mgmt/databox/src/package_2022_10/models.rs +++ b/services/mgmt/databox/src/package_2022_10/models.rs @@ -408,6 +408,14 @@ pub mod copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum CopyLogDetailsUnion { + DataBox(DataBoxAccountCopyLogDetails), + DataBoxCustomerDisk(DataBoxCustomerDiskCopyLogDetails), + DataBoxDisk(DataBoxDiskCopyLogDetails), + DataBoxHeavy(DataBoxHeavyAccountCopyLogDetails), +} #[doc = "Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CopyProgress { @@ -604,6 +612,12 @@ pub mod data_account_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dataAccountType")] +pub enum DataAccountDetailsUnion { + ManagedDisk(ManagedDiskDetails), + StorageAccount(StorageAccountDetails), +} #[doc = "Copy log details for a storage account of a DataBox job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataBoxAccountCopyLogDetails { @@ -1320,10 +1334,10 @@ pub struct DataExportDetails { pub log_collection_level: Option, #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, } impl DataExportDetails { - pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetails) -> Self { + pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetailsUnion) -> Self { Self { transfer_configuration, log_collection_level: None, @@ -1350,13 +1364,13 @@ pub mod data_export_details { pub struct DataImportDetails { #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, #[doc = "Level of the logs to be collected."] #[serde(rename = "logCollectionLevel", default, skip_serializing_if = "Option::is_none")] pub log_collection_level: Option, } impl DataImportDetails { - pub fn new(account_details: DataAccountDetails) -> Self { + pub fn new(account_details: DataAccountDetailsUnion) -> Self { Self { account_details, log_collection_level: None, @@ -1648,6 +1662,12 @@ pub mod datacenter_address_response { DatacenterAddressInstruction, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "datacenterAddressType")] +pub enum DatacenterAddressResponseUnion { + DatacenterAddressInstruction(DatacenterAddressInstructionResponse), + DatacenterAddressLocation(DatacenterAddressLocationResponse), +} #[doc = "Dc access security code"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DcAccessSecurityCode { @@ -1857,6 +1877,11 @@ pub mod granular_copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum GranularCopyLogDetailsUnion { + DataBoxCustomerDisk(DataBoxDiskGranularCopyLogDetails), +} #[doc = "Granular Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GranularCopyProgress { @@ -2057,7 +2082,7 @@ pub struct JobDetails { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub copy_log_details: Vec, + pub copy_log_details: Vec, #[doc = "Shared access key to download the return shipment label"] #[serde(rename = "reverseShipmentLabelSasKey", default, skip_serializing_if = "Option::is_none")] pub reverse_shipment_label_sas_key: Option, @@ -2085,7 +2110,7 @@ pub struct JobDetails { pub last_mitigation_action_on_job: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddress", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address: Option, + pub datacenter_address: Option, #[doc = "DataCenter code."] #[serde(rename = "dataCenterCode", default, skip_serializing_if = "Option::is_none")] pub data_center_code: Option, @@ -2335,6 +2360,14 @@ pub mod job_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobDetailsType")] +pub enum JobDetailsUnion { + DataBoxCustomerDisk(DataBoxCustomerDiskJobDetails), + DataBoxDisk(DataBoxDiskJobDetails), + DataBoxHeavy(DataBoxHeavyJobDetails), + DataBox(DataBoxJobDetails), +} #[doc = "Job Properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobProperties { @@ -2370,7 +2403,7 @@ pub struct JobProperties { pub error: Option, #[doc = "Job details."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option, + pub details: Option, #[doc = "Reason for cancellation."] #[serde(rename = "cancellationReason", default, skip_serializing_if = "Option::is_none")] pub cancellation_reason: Option, @@ -2629,6 +2662,14 @@ pub mod job_secrets { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobSecretsType")] +pub enum JobSecretsUnion { + DataBoxCustomerDisk(CustomerDiskJobSecrets), + DataBoxDisk(DataBoxDiskJobSecrets), + DataBoxHeavy(DataBoxHeavyJobSecrets), + DataBox(DataboxJobSecrets), +} #[doc = "Job stages."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobStages { @@ -3189,7 +3230,7 @@ pub mod preferences_validation_response_properties { pub struct RegionConfigurationRequest { #[doc = "Request body to get the availability for scheduling orders."] #[serde(rename = "scheduleAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] - pub schedule_availability_request: Option, + pub schedule_availability_request: Option, #[doc = "Request body to get the transport availability for given sku."] #[serde(rename = "transportAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] pub transport_availability_request: Option, @@ -3213,7 +3254,7 @@ pub struct RegionConfigurationResponse { pub transport_availability_response: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddressResponse", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address_response: Option, + pub datacenter_address_response: Option, } impl RegionConfigurationResponse { pub fn new() -> Self { @@ -3316,6 +3357,13 @@ pub mod schedule_availability_request { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "skuName")] +pub enum ScheduleAvailabilityRequestUnion { + DataBox(DataBoxScheduleAvailabilityRequest), + DataBoxDisk(DiskScheduleAvailabilityRequest), + DataBoxHeavy(HeavyScheduleAvailabilityRequest), +} #[doc = "Schedule availability for given sku in a region."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScheduleAvailabilityResponse { @@ -3989,7 +4037,7 @@ pub struct UnencryptedCredentials { pub job_name: Option, #[doc = "The base class for the secrets"] #[serde(rename = "jobSecrets", default, skip_serializing_if = "Option::is_none")] - pub job_secrets: Option, + pub job_secrets: Option, } impl UnencryptedCredentials { pub fn new() -> Self { @@ -4152,6 +4200,16 @@ pub mod validation_input_request { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputRequestUnion { + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationRequest), + ValidateDataTransferDetails(DataTransferDetailsValidationRequest), + ValidatePreferences(PreferencesValidationRequest), + ValidateSkuAvailability(SkuAvailabilityValidationRequest), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationRequest), + ValidateAddress(ValidateAddress), +} #[doc = "Minimum properties that should be present in each individual validation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationInputResponse { @@ -4183,6 +4241,16 @@ pub mod validation_input_response { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputResponseUnion { + ValidateAddress(AddressValidationProperties), + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationResponseProperties), + ValidateDataTransferDetails(DataTransferDetailsValidationResponseProperties), + ValidatePreferences(PreferencesValidationResponseProperties), + ValidateSkuAvailability(SkuAvailabilityValidationResponseProperties), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationResponseProperties), +} #[doc = "Minimum request requirement of any validation category."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationRequest { @@ -4191,12 +4259,12 @@ pub struct ValidationRequest { pub validation_category: validation_request::ValidationCategory, #[doc = "List of request details contain validationType and its request as key and value respectively."] #[serde(rename = "individualRequestDetails")] - pub individual_request_details: Vec, + pub individual_request_details: Vec, } impl ValidationRequest { pub fn new( validation_category: validation_request::ValidationCategory, - individual_request_details: Vec, + individual_request_details: Vec, ) -> Self { Self { validation_category, @@ -4212,6 +4280,11 @@ pub mod validation_request { JobCreationValidation, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationCategory")] +pub enum ValidationRequestUnion { + JobCreationValidation(CreateJobValidations), +} #[doc = "Response of pre job creation validations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationResponse { @@ -4237,7 +4310,7 @@ pub struct ValidationResponseProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub individual_response_details: Vec, + pub individual_response_details: Vec, } impl ValidationResponseProperties { pub fn new() -> Self { diff --git a/services/mgmt/databox/src/package_2022_12/mod.rs b/services/mgmt/databox/src/package_2022_12/mod.rs index 22025c7065..f0586e1e76 100644 --- a/services/mgmt/databox/src/package_2022_12/mod.rs +++ b/services/mgmt/databox/src/package_2022_12/mod.rs @@ -1798,7 +1798,7 @@ pub mod service { subscription_id: impl Into, resource_group_name: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs_by_resource_group::RequestBuilder { validate_inputs_by_resource_group::RequestBuilder { client: self.0.clone(), @@ -1818,7 +1818,7 @@ pub mod service { &self, subscription_id: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs::RequestBuilder { validate_inputs::RequestBuilder { client: self.0.clone(), @@ -2160,7 +2160,7 @@ pub mod service { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2269,7 +2269,7 @@ pub mod service { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/databox/src/package_2022_12/models.rs b/services/mgmt/databox/src/package_2022_12/models.rs index 041ebbbed4..e7ef23521d 100644 --- a/services/mgmt/databox/src/package_2022_12/models.rs +++ b/services/mgmt/databox/src/package_2022_12/models.rs @@ -408,6 +408,14 @@ pub mod copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum CopyLogDetailsUnion { + DataBox(DataBoxAccountCopyLogDetails), + DataBoxCustomerDisk(DataBoxCustomerDiskCopyLogDetails), + DataBoxDisk(DataBoxDiskCopyLogDetails), + DataBoxHeavy(DataBoxHeavyAccountCopyLogDetails), +} #[doc = "Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CopyProgress { @@ -614,6 +622,12 @@ pub mod data_account_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dataAccountType")] +pub enum DataAccountDetailsUnion { + ManagedDisk(ManagedDiskDetails), + StorageAccount(StorageAccountDetails), +} #[doc = "Copy log details for a storage account of a DataBox job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataBoxAccountCopyLogDetails { @@ -1330,10 +1344,10 @@ pub struct DataExportDetails { pub log_collection_level: Option, #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, } impl DataExportDetails { - pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetails) -> Self { + pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetailsUnion) -> Self { Self { transfer_configuration, log_collection_level: None, @@ -1360,13 +1374,13 @@ pub mod data_export_details { pub struct DataImportDetails { #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, #[doc = "Level of the logs to be collected."] #[serde(rename = "logCollectionLevel", default, skip_serializing_if = "Option::is_none")] pub log_collection_level: Option, } impl DataImportDetails { - pub fn new(account_details: DataAccountDetails) -> Self { + pub fn new(account_details: DataAccountDetailsUnion) -> Self { Self { account_details, log_collection_level: None, @@ -1658,6 +1672,12 @@ pub mod datacenter_address_response { DatacenterAddressInstruction, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "datacenterAddressType")] +pub enum DatacenterAddressResponseUnion { + DatacenterAddressInstruction(DatacenterAddressInstructionResponse), + DatacenterAddressLocation(DatacenterAddressLocationResponse), +} #[doc = "Dc access security code"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DcAccessSecurityCode { @@ -1876,6 +1896,11 @@ pub mod granular_copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum GranularCopyLogDetailsUnion { + DataBoxCustomerDisk(DataBoxDiskGranularCopyLogDetails), +} #[doc = "Granular Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GranularCopyProgress { @@ -2076,7 +2101,7 @@ pub struct JobDetails { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub copy_log_details: Vec, + pub copy_log_details: Vec, #[doc = "Shared access key to download the return shipment label"] #[serde(rename = "reverseShipmentLabelSasKey", default, skip_serializing_if = "Option::is_none")] pub reverse_shipment_label_sas_key: Option, @@ -2104,7 +2129,7 @@ pub struct JobDetails { pub last_mitigation_action_on_job: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddress", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address: Option, + pub datacenter_address: Option, #[doc = "DataCenter code."] #[serde(rename = "dataCenterCode", default, skip_serializing_if = "Option::is_none")] pub data_center_code: Option, @@ -2354,6 +2379,14 @@ pub mod job_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobDetailsType")] +pub enum JobDetailsUnion { + DataBoxCustomerDisk(DataBoxCustomerDiskJobDetails), + DataBoxDisk(DataBoxDiskJobDetails), + DataBoxHeavy(DataBoxHeavyJobDetails), + DataBox(DataBoxJobDetails), +} #[doc = "Job Properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobProperties { @@ -2389,7 +2422,7 @@ pub struct JobProperties { pub error: Option, #[doc = "Job details."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option, + pub details: Option, #[doc = "Reason for cancellation."] #[serde(rename = "cancellationReason", default, skip_serializing_if = "Option::is_none")] pub cancellation_reason: Option, @@ -2648,6 +2681,14 @@ pub mod job_secrets { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobSecretsType")] +pub enum JobSecretsUnion { + DataBoxCustomerDisk(CustomerDiskJobSecrets), + DataBoxDisk(DataBoxDiskJobSecrets), + DataBoxHeavy(DataBoxHeavyJobSecrets), + DataBox(DataboxJobSecrets), +} #[doc = "Job stages."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobStages { @@ -3208,7 +3249,7 @@ pub mod preferences_validation_response_properties { pub struct RegionConfigurationRequest { #[doc = "Request body to get the availability for scheduling orders."] #[serde(rename = "scheduleAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] - pub schedule_availability_request: Option, + pub schedule_availability_request: Option, #[doc = "Request body to get the transport availability for given sku."] #[serde(rename = "transportAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] pub transport_availability_request: Option, @@ -3232,7 +3273,7 @@ pub struct RegionConfigurationResponse { pub transport_availability_response: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddressResponse", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address_response: Option, + pub datacenter_address_response: Option, } impl RegionConfigurationResponse { pub fn new() -> Self { @@ -3335,6 +3376,13 @@ pub mod schedule_availability_request { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "skuName")] +pub enum ScheduleAvailabilityRequestUnion { + DataBox(DataBoxScheduleAvailabilityRequest), + DataBoxDisk(DiskScheduleAvailabilityRequest), + DataBoxHeavy(HeavyScheduleAvailabilityRequest), +} #[doc = "Schedule availability for given sku in a region."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScheduleAvailabilityResponse { @@ -4016,7 +4064,7 @@ pub struct UnencryptedCredentials { pub job_name: Option, #[doc = "The base class for the secrets"] #[serde(rename = "jobSecrets", default, skip_serializing_if = "Option::is_none")] - pub job_secrets: Option, + pub job_secrets: Option, } impl UnencryptedCredentials { pub fn new() -> Self { @@ -4179,6 +4227,16 @@ pub mod validation_input_request { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputRequestUnion { + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationRequest), + ValidateDataTransferDetails(DataTransferDetailsValidationRequest), + ValidatePreferences(PreferencesValidationRequest), + ValidateSkuAvailability(SkuAvailabilityValidationRequest), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationRequest), + ValidateAddress(ValidateAddress), +} #[doc = "Minimum properties that should be present in each individual validation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationInputResponse { @@ -4210,6 +4268,16 @@ pub mod validation_input_response { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputResponseUnion { + ValidateAddress(AddressValidationProperties), + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationResponseProperties), + ValidateDataTransferDetails(DataTransferDetailsValidationResponseProperties), + ValidatePreferences(PreferencesValidationResponseProperties), + ValidateSkuAvailability(SkuAvailabilityValidationResponseProperties), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationResponseProperties), +} #[doc = "Minimum request requirement of any validation category."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationRequest { @@ -4218,12 +4286,12 @@ pub struct ValidationRequest { pub validation_category: validation_request::ValidationCategory, #[doc = "List of request details contain validationType and its request as key and value respectively."] #[serde(rename = "individualRequestDetails")] - pub individual_request_details: Vec, + pub individual_request_details: Vec, } impl ValidationRequest { pub fn new( validation_category: validation_request::ValidationCategory, - individual_request_details: Vec, + individual_request_details: Vec, ) -> Self { Self { validation_category, @@ -4239,6 +4307,11 @@ pub mod validation_request { JobCreationValidation, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationCategory")] +pub enum ValidationRequestUnion { + JobCreationValidation(CreateJobValidations), +} #[doc = "Response of pre job creation validations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationResponse { @@ -4264,7 +4337,7 @@ pub struct ValidationResponseProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub individual_response_details: Vec, + pub individual_response_details: Vec, } impl ValidationResponseProperties { pub fn new() -> Self { diff --git a/services/mgmt/databox/src/package_2023_03/mod.rs b/services/mgmt/databox/src/package_2023_03/mod.rs index cb21664d05..28c8ba3c2d 100644 --- a/services/mgmt/databox/src/package_2023_03/mod.rs +++ b/services/mgmt/databox/src/package_2023_03/mod.rs @@ -1798,7 +1798,7 @@ pub mod service { subscription_id: impl Into, resource_group_name: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs_by_resource_group::RequestBuilder { validate_inputs_by_resource_group::RequestBuilder { client: self.0.clone(), @@ -1818,7 +1818,7 @@ pub mod service { &self, subscription_id: impl Into, location: impl Into, - validation_request: impl Into, + validation_request: impl Into, ) -> validate_inputs::RequestBuilder { validate_inputs::RequestBuilder { client: self.0.clone(), @@ -2160,7 +2160,7 @@ pub mod service { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2269,7 +2269,7 @@ pub mod service { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) validation_request: models::ValidationRequest, + pub(crate) validation_request: models::ValidationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/databox/src/package_2023_03/models.rs b/services/mgmt/databox/src/package_2023_03/models.rs index 486c112ac5..b9842a3a42 100644 --- a/services/mgmt/databox/src/package_2023_03/models.rs +++ b/services/mgmt/databox/src/package_2023_03/models.rs @@ -408,6 +408,14 @@ pub mod copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum CopyLogDetailsUnion { + DataBox(DataBoxAccountCopyLogDetails), + DataBoxCustomerDisk(DataBoxCustomerDiskCopyLogDetails), + DataBoxDisk(DataBoxDiskCopyLogDetails), + DataBoxHeavy(DataBoxHeavyAccountCopyLogDetails), +} #[doc = "Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CopyProgress { @@ -614,6 +622,12 @@ pub mod data_account_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dataAccountType")] +pub enum DataAccountDetailsUnion { + ManagedDisk(ManagedDiskDetails), + StorageAccount(StorageAccountDetails), +} #[doc = "Copy log details for a storage account of a DataBox job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataBoxAccountCopyLogDetails { @@ -1330,10 +1344,10 @@ pub struct DataExportDetails { pub log_collection_level: Option, #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, } impl DataExportDetails { - pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetails) -> Self { + pub fn new(transfer_configuration: TransferConfiguration, account_details: DataAccountDetailsUnion) -> Self { Self { transfer_configuration, log_collection_level: None, @@ -1360,13 +1374,13 @@ pub mod data_export_details { pub struct DataImportDetails { #[doc = "Account details of the data to be transferred"] #[serde(rename = "accountDetails")] - pub account_details: DataAccountDetails, + pub account_details: DataAccountDetailsUnion, #[doc = "Level of the logs to be collected."] #[serde(rename = "logCollectionLevel", default, skip_serializing_if = "Option::is_none")] pub log_collection_level: Option, } impl DataImportDetails { - pub fn new(account_details: DataAccountDetails) -> Self { + pub fn new(account_details: DataAccountDetailsUnion) -> Self { Self { account_details, log_collection_level: None, @@ -1658,6 +1672,12 @@ pub mod datacenter_address_response { DatacenterAddressInstruction, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "datacenterAddressType")] +pub enum DatacenterAddressResponseUnion { + DatacenterAddressInstruction(DatacenterAddressInstructionResponse), + DatacenterAddressLocation(DatacenterAddressLocationResponse), +} #[doc = "Dc access security code"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DcAccessSecurityCode { @@ -1876,6 +1896,11 @@ pub mod granular_copy_log_details { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "copyLogDetailsType")] +pub enum GranularCopyLogDetailsUnion { + DataBoxCustomerDisk(DataBoxDiskGranularCopyLogDetails), +} #[doc = "Granular Copy progress."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GranularCopyProgress { @@ -2183,7 +2208,7 @@ pub struct JobDetails { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub copy_log_details: Vec, + pub copy_log_details: Vec, #[doc = "Shared access key to download the return shipment label"] #[serde(rename = "reverseShipmentLabelSasKey", default, skip_serializing_if = "Option::is_none")] pub reverse_shipment_label_sas_key: Option, @@ -2211,7 +2236,7 @@ pub struct JobDetails { pub last_mitigation_action_on_job: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddress", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address: Option, + pub datacenter_address: Option, #[doc = "DataCenter code."] #[serde(rename = "dataCenterCode", default, skip_serializing_if = "Option::is_none")] pub data_center_code: Option, @@ -2461,6 +2486,14 @@ pub mod job_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobDetailsType")] +pub enum JobDetailsUnion { + DataBoxCustomerDisk(DataBoxCustomerDiskJobDetails), + DataBoxDisk(DataBoxDiskJobDetails), + DataBoxHeavy(DataBoxHeavyJobDetails), + DataBox(DataBoxJobDetails), +} #[doc = "Job Properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobProperties { @@ -2499,7 +2532,7 @@ pub struct JobProperties { pub error: Option, #[doc = "Job details."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option, + pub details: Option, #[doc = "Reason for cancellation."] #[serde(rename = "cancellationReason", default, skip_serializing_if = "Option::is_none")] pub cancellation_reason: Option, @@ -2845,6 +2878,14 @@ pub mod job_secrets { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobSecretsType")] +pub enum JobSecretsUnion { + DataBoxCustomerDisk(CustomerDiskJobSecrets), + DataBoxDisk(DataBoxDiskJobSecrets), + DataBoxHeavy(DataBoxHeavyJobSecrets), + DataBox(DataboxJobSecrets), +} #[doc = "Job stages."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobStages { @@ -3413,7 +3454,7 @@ pub mod preferences_validation_response_properties { pub struct RegionConfigurationRequest { #[doc = "Request body to get the availability for scheduling orders."] #[serde(rename = "scheduleAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] - pub schedule_availability_request: Option, + pub schedule_availability_request: Option, #[doc = "Request body to get the transport availability for given sku."] #[serde(rename = "transportAvailabilityRequest", default, skip_serializing_if = "Option::is_none")] pub transport_availability_request: Option, @@ -3437,7 +3478,7 @@ pub struct RegionConfigurationResponse { pub transport_availability_response: Option, #[doc = "Datacenter address for given storage location."] #[serde(rename = "datacenterAddressResponse", default, skip_serializing_if = "Option::is_none")] - pub datacenter_address_response: Option, + pub datacenter_address_response: Option, } impl RegionConfigurationResponse { pub fn new() -> Self { @@ -3540,6 +3581,13 @@ pub mod schedule_availability_request { DataBoxCustomerDisk, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "skuName")] +pub enum ScheduleAvailabilityRequestUnion { + DataBox(DataBoxScheduleAvailabilityRequest), + DataBoxDisk(DiskScheduleAvailabilityRequest), + DataBoxHeavy(HeavyScheduleAvailabilityRequest), +} #[doc = "Schedule availability for given sku in a region."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScheduleAvailabilityResponse { @@ -4221,7 +4269,7 @@ pub struct UnencryptedCredentials { pub job_name: Option, #[doc = "The base class for the secrets"] #[serde(rename = "jobSecrets", default, skip_serializing_if = "Option::is_none")] - pub job_secrets: Option, + pub job_secrets: Option, } impl UnencryptedCredentials { pub fn new() -> Self { @@ -4384,6 +4432,16 @@ pub mod validation_input_request { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputRequestUnion { + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationRequest), + ValidateDataTransferDetails(DataTransferDetailsValidationRequest), + ValidatePreferences(PreferencesValidationRequest), + ValidateSkuAvailability(SkuAvailabilityValidationRequest), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationRequest), + ValidateAddress(ValidateAddress), +} #[doc = "Minimum properties that should be present in each individual validation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationInputResponse { @@ -4415,6 +4473,16 @@ pub mod validation_input_response { ValidateDataTransferDetails, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationType")] +pub enum ValidationInputResponseUnion { + ValidateAddress(AddressValidationProperties), + ValidateCreateOrderLimit(CreateOrderLimitForSubscriptionValidationResponseProperties), + ValidateDataTransferDetails(DataTransferDetailsValidationResponseProperties), + ValidatePreferences(PreferencesValidationResponseProperties), + ValidateSkuAvailability(SkuAvailabilityValidationResponseProperties), + ValidateSubscriptionIsAllowedToCreateJob(SubscriptionIsAllowedToCreateJobValidationResponseProperties), +} #[doc = "Minimum request requirement of any validation category."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ValidationRequest { @@ -4423,12 +4491,12 @@ pub struct ValidationRequest { pub validation_category: validation_request::ValidationCategory, #[doc = "List of request details contain validationType and its request as key and value respectively."] #[serde(rename = "individualRequestDetails")] - pub individual_request_details: Vec, + pub individual_request_details: Vec, } impl ValidationRequest { pub fn new( validation_category: validation_request::ValidationCategory, - individual_request_details: Vec, + individual_request_details: Vec, ) -> Self { Self { validation_category, @@ -4444,6 +4512,11 @@ pub mod validation_request { JobCreationValidation, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "validationCategory")] +pub enum ValidationRequestUnion { + JobCreationValidation(CreateJobValidations), +} #[doc = "Response of pre job creation validations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationResponse { @@ -4469,7 +4542,7 @@ pub struct ValidationResponseProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub individual_response_details: Vec, + pub individual_response_details: Vec, } impl ValidationResponseProperties { pub fn new() -> Self { diff --git a/services/mgmt/databoxedge/src/package_2021_06_01/mod.rs b/services/mgmt/databoxedge/src/package_2021_06_01/mod.rs index ac0db5536e..e8708581cc 100644 --- a/services/mgmt/databoxedge/src/package_2021_06_01/mod.rs +++ b/services/mgmt/databoxedge/src/package_2021_06_01/mod.rs @@ -5033,7 +5033,7 @@ pub mod roles { &self, device_name: impl Into, name: impl Into, - role: impl Into, + role: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -5204,9 +5204,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5293,8 +5293,8 @@ pub mod roles { } } 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`."] @@ -5314,9 +5314,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5358,7 +5358,7 @@ pub mod roles { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) role: models::Role, + pub(crate) role: models::RoleUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -5404,8 +5404,8 @@ pub mod roles { } } 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."] @@ -5606,7 +5606,7 @@ pub mod addons { device_name: impl Into, role_name: impl Into, addon_name: impl Into, - addon: impl Into, + addon: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -5783,9 +5783,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5874,8 +5874,8 @@ pub mod addons { } } 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`."] @@ -5895,9 +5895,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5940,7 +5940,7 @@ pub mod addons { pub(crate) device_name: String, pub(crate) role_name: String, pub(crate) addon_name: String, - pub(crate) addon: models::Addon, + pub(crate) addon: models::AddonUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -5987,8 +5987,8 @@ pub mod addons { } } 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."] @@ -9188,7 +9188,7 @@ pub mod triggers { &self, device_name: impl Into, name: impl Into, - trigger: impl Into, + trigger: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -9368,9 +9368,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9457,8 +9457,8 @@ pub mod triggers { } } 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`."] @@ -9478,9 +9478,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9522,7 +9522,7 @@ pub mod triggers { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -9568,8 +9568,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/databoxedge/src/package_2021_06_01/models.rs b/services/mgmt/databoxedge/src/package_2021_06_01/models.rs index 5322b356b8..40a4580c2f 100644 --- a/services/mgmt/databoxedge/src/package_2021_06_01/models.rs +++ b/services/mgmt/databoxedge/src/package_2021_06_01/models.rs @@ -81,6 +81,12 @@ pub mod addon { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AddonUnion { + ArcForKubernetes(ArcAddon), + IotEdge(IoTAddon), +} #[doc = "Collection of all the Role addon on the Azure Stack Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AddonList { @@ -90,7 +96,7 @@ pub struct AddonList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -5407,6 +5413,16 @@ pub mod role { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum RoleUnion { + CloudEdgeManagement(CloudEdgeManagementRole), + #[serde(rename = "IOT")] + Iot(IoTRole), + Kubernetes(KubernetesRole), + #[serde(rename = "MEC")] + Mec(MecRole), +} #[doc = "Collection of all the roles on the Data Box Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleList { @@ -5416,7 +5432,7 @@ pub struct RoleList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -6718,6 +6734,12 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + FileEvent(FileEventTrigger), + PeriodicTimerEvent(PeriodicTimerEventTrigger), +} #[doc = "Collection of all trigger on the data box edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TriggerList { @@ -6727,7 +6749,7 @@ pub struct TriggerList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/databoxedge/src/package_2021_06_01_preview/mod.rs b/services/mgmt/databoxedge/src/package_2021_06_01_preview/mod.rs index f72df36f96..2cad8a51fb 100644 --- a/services/mgmt/databoxedge/src/package_2021_06_01_preview/mod.rs +++ b/services/mgmt/databoxedge/src/package_2021_06_01_preview/mod.rs @@ -4988,7 +4988,7 @@ pub mod roles { &self, device_name: impl Into, name: impl Into, - role: impl Into, + role: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -5159,9 +5159,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5248,8 +5248,8 @@ pub mod roles { } } 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`."] @@ -5269,9 +5269,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5313,7 +5313,7 @@ pub mod roles { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) role: models::Role, + pub(crate) role: models::RoleUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -5359,8 +5359,8 @@ pub mod roles { } } 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."] @@ -5561,7 +5561,7 @@ pub mod addons { device_name: impl Into, role_name: impl Into, addon_name: impl Into, - addon: impl Into, + addon: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -5738,9 +5738,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5829,8 +5829,8 @@ pub mod addons { } } 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`."] @@ -5850,9 +5850,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5895,7 +5895,7 @@ pub mod addons { pub(crate) device_name: String, pub(crate) role_name: String, pub(crate) addon_name: String, - pub(crate) addon: models::Addon, + pub(crate) addon: models::AddonUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -5942,8 +5942,8 @@ pub mod addons { } } 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."] @@ -9143,7 +9143,7 @@ pub mod triggers { &self, device_name: impl Into, name: impl Into, - trigger: impl Into, + trigger: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -9323,9 +9323,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9412,8 +9412,8 @@ pub mod triggers { } } 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`."] @@ -9433,9 +9433,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9477,7 +9477,7 @@ pub mod triggers { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -9523,8 +9523,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/databoxedge/src/package_2021_06_01_preview/models.rs b/services/mgmt/databoxedge/src/package_2021_06_01_preview/models.rs index 064080414d..e4db82c595 100644 --- a/services/mgmt/databoxedge/src/package_2021_06_01_preview/models.rs +++ b/services/mgmt/databoxedge/src/package_2021_06_01_preview/models.rs @@ -81,6 +81,12 @@ pub mod addon { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AddonUnion { + ArcForKubernetes(ArcAddon), + IotEdge(IoTAddon), +} #[doc = "Collection of all the Role addon on the Azure Stack Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AddonList { @@ -90,7 +96,7 @@ pub struct AddonList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -5404,6 +5410,16 @@ pub mod role { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum RoleUnion { + CloudEdgeManagement(CloudEdgeManagementRole), + #[serde(rename = "IOT")] + Iot(IoTRole), + Kubernetes(KubernetesRole), + #[serde(rename = "MEC")] + Mec(MecRole), +} #[doc = "Collection of all the roles on the Data Box Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleList { @@ -5413,7 +5429,7 @@ pub struct RoleList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -6715,6 +6731,12 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + FileEvent(FileEventTrigger), + PeriodicTimerEvent(PeriodicTimerEventTrigger), +} #[doc = "Collection of all trigger on the data box edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TriggerList { @@ -6724,7 +6746,7 @@ pub struct TriggerList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/databoxedge/src/package_2022_12_01_preview/mod.rs b/services/mgmt/databoxedge/src/package_2022_12_01_preview/mod.rs index 1a96d57b84..3f8cc7bc5b 100644 --- a/services/mgmt/databoxedge/src/package_2022_12_01_preview/mod.rs +++ b/services/mgmt/databoxedge/src/package_2022_12_01_preview/mod.rs @@ -6388,7 +6388,7 @@ pub mod roles { &self, device_name: impl Into, name: impl Into, - role: impl Into, + role: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -6559,9 +6559,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6648,8 +6648,8 @@ pub mod roles { } } 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`."] @@ -6669,9 +6669,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6713,7 +6713,7 @@ pub mod roles { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) role: models::Role, + pub(crate) role: models::RoleUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -6759,8 +6759,8 @@ pub mod roles { } } 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."] @@ -6961,7 +6961,7 @@ pub mod addons { device_name: impl Into, role_name: impl Into, addon_name: impl Into, - addon: impl Into, + addon: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -7138,9 +7138,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7229,8 +7229,8 @@ pub mod addons { } } 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`."] @@ -7250,9 +7250,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7295,7 +7295,7 @@ pub mod addons { pub(crate) device_name: String, pub(crate) role_name: String, pub(crate) addon_name: String, - pub(crate) addon: models::Addon, + pub(crate) addon: models::AddonUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -7342,8 +7342,8 @@ pub mod addons { } } 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."] @@ -10543,7 +10543,7 @@ pub mod triggers { &self, device_name: impl Into, name: impl Into, - trigger: impl Into, + trigger: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -10723,9 +10723,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10812,8 +10812,8 @@ pub mod triggers { } } 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`."] @@ -10833,9 +10833,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10877,7 +10877,7 @@ pub mod triggers { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -10923,8 +10923,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/databoxedge/src/package_2022_12_01_preview/models.rs b/services/mgmt/databoxedge/src/package_2022_12_01_preview/models.rs index b0fee2d807..b9f5d867f7 100644 --- a/services/mgmt/databoxedge/src/package_2022_12_01_preview/models.rs +++ b/services/mgmt/databoxedge/src/package_2022_12_01_preview/models.rs @@ -81,6 +81,11 @@ pub mod addon { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AddonUnion { + ArcForKubernetes(ArcAddon), +} #[doc = "Collection of all the Role addon on the Azure Stack Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AddonList { @@ -90,7 +95,7 @@ pub struct AddonList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -5993,6 +5998,16 @@ pub mod role { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum RoleUnion { + CloudEdgeManagement(CloudEdgeManagementRole), + #[serde(rename = "IOT")] + Iot(IoTRole), + Kubernetes(KubernetesRole), + #[serde(rename = "MEC")] + Mec(MecRole), +} #[doc = "Collection of all the roles on the Data Box Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleList { @@ -6002,7 +6017,7 @@ pub struct RoleList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -7145,6 +7160,12 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + FileEvent(FileEventTrigger), + PeriodicTimerEvent(PeriodicTimerEventTrigger), +} #[doc = "Collection of all trigger on the data box edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TriggerList { @@ -7154,7 +7175,7 @@ pub struct TriggerList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/databoxedge/src/package_2023_01_01_preview/mod.rs b/services/mgmt/databoxedge/src/package_2023_01_01_preview/mod.rs index f16c993570..c9ad4d938f 100644 --- a/services/mgmt/databoxedge/src/package_2023_01_01_preview/mod.rs +++ b/services/mgmt/databoxedge/src/package_2023_01_01_preview/mod.rs @@ -6388,7 +6388,7 @@ pub mod roles { &self, device_name: impl Into, name: impl Into, - role: impl Into, + role: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -6559,9 +6559,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6648,8 +6648,8 @@ pub mod roles { } } 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`."] @@ -6669,9 +6669,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6713,7 +6713,7 @@ pub mod roles { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) role: models::Role, + pub(crate) role: models::RoleUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -6759,8 +6759,8 @@ pub mod roles { } } 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."] @@ -6961,7 +6961,7 @@ pub mod addons { device_name: impl Into, role_name: impl Into, addon_name: impl Into, - addon: impl Into, + addon: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -7138,9 +7138,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7229,8 +7229,8 @@ pub mod addons { } } 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`."] @@ -7250,9 +7250,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7295,7 +7295,7 @@ pub mod addons { pub(crate) device_name: String, pub(crate) role_name: String, pub(crate) addon_name: String, - pub(crate) addon: models::Addon, + pub(crate) addon: models::AddonUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -7342,8 +7342,8 @@ pub mod addons { } } 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."] @@ -10543,7 +10543,7 @@ pub mod triggers { &self, device_name: impl Into, name: impl Into, - trigger: impl Into, + trigger: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -10723,9 +10723,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10812,8 +10812,8 @@ pub mod triggers { } } 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`."] @@ -10833,9 +10833,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10877,7 +10877,7 @@ pub mod triggers { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -10923,8 +10923,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/databoxedge/src/package_2023_01_01_preview/models.rs b/services/mgmt/databoxedge/src/package_2023_01_01_preview/models.rs index b79b8c2fc1..68119b1578 100644 --- a/services/mgmt/databoxedge/src/package_2023_01_01_preview/models.rs +++ b/services/mgmt/databoxedge/src/package_2023_01_01_preview/models.rs @@ -81,6 +81,11 @@ pub mod addon { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AddonUnion { + ArcForKubernetes(ArcAddon), +} #[doc = "Collection of all the Role addon on the Azure Stack Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AddonList { @@ -90,7 +95,7 @@ pub struct AddonList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -6001,6 +6006,16 @@ pub mod role { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum RoleUnion { + CloudEdgeManagement(CloudEdgeManagementRole), + #[serde(rename = "IOT")] + Iot(IoTRole), + Kubernetes(KubernetesRole), + #[serde(rename = "MEC")] + Mec(MecRole), +} #[doc = "Collection of all the roles on the Data Box Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleList { @@ -6010,7 +6025,7 @@ pub struct RoleList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -7153,6 +7168,12 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + FileEvent(FileEventTrigger), + PeriodicTimerEvent(PeriodicTimerEventTrigger), +} #[doc = "Collection of all trigger on the data box edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TriggerList { @@ -7162,7 +7183,7 @@ pub struct TriggerList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/databoxedge/src/package_2023_07/mod.rs b/services/mgmt/databoxedge/src/package_2023_07/mod.rs index bf39f54550..82d402107b 100644 --- a/services/mgmt/databoxedge/src/package_2023_07/mod.rs +++ b/services/mgmt/databoxedge/src/package_2023_07/mod.rs @@ -5259,7 +5259,7 @@ pub mod roles { &self, device_name: impl Into, name: impl Into, - role: impl Into, + role: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -5430,9 +5430,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5519,8 +5519,8 @@ pub mod roles { } } 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`."] @@ -5540,9 +5540,9 @@ pub mod roles { #[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::Role = serde_json::from_slice(&bytes)?; + let body: models::RoleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5584,7 +5584,7 @@ pub mod roles { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) role: models::Role, + pub(crate) role: models::RoleUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -5630,8 +5630,8 @@ pub mod roles { } } 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."] @@ -5832,7 +5832,7 @@ pub mod addons { device_name: impl Into, role_name: impl Into, addon_name: impl Into, - addon: impl Into, + addon: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -6009,9 +6009,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6100,8 +6100,8 @@ pub mod addons { } } 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`."] @@ -6121,9 +6121,9 @@ pub mod addons { #[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::Addon = serde_json::from_slice(&bytes)?; + let body: models::AddonUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6166,7 +6166,7 @@ pub mod addons { pub(crate) device_name: String, pub(crate) role_name: String, pub(crate) addon_name: String, - pub(crate) addon: models::Addon, + pub(crate) addon: models::AddonUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -6213,8 +6213,8 @@ pub mod addons { } } 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."] @@ -9414,7 +9414,7 @@ pub mod triggers { &self, device_name: impl Into, name: impl Into, - trigger: impl Into, + trigger: impl Into, subscription_id: impl Into, resource_group_name: impl Into, ) -> create_or_update::RequestBuilder { @@ -9594,9 +9594,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9683,8 +9683,8 @@ pub mod triggers { } } 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`."] @@ -9704,9 +9704,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9748,7 +9748,7 @@ pub mod triggers { pub(crate) client: super::super::Client, pub(crate) device_name: String, pub(crate) name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, } @@ -9794,8 +9794,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/databoxedge/src/package_2023_07/models.rs b/services/mgmt/databoxedge/src/package_2023_07/models.rs index 29ade544a3..2daa5a6960 100644 --- a/services/mgmt/databoxedge/src/package_2023_07/models.rs +++ b/services/mgmt/databoxedge/src/package_2023_07/models.rs @@ -81,6 +81,12 @@ pub mod addon { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AddonUnion { + ArcForKubernetes(ArcAddon), + IotEdge(IoTAddon), +} #[doc = "Collection of all the Role addon on the Azure Stack Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AddonList { @@ -90,7 +96,7 @@ pub struct AddonList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -5661,6 +5667,16 @@ pub mod role { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum RoleUnion { + CloudEdgeManagement(CloudEdgeManagementRole), + #[serde(rename = "IOT")] + Iot(IoTRole), + Kubernetes(KubernetesRole), + #[serde(rename = "MEC")] + Mec(MecRole), +} #[doc = "Collection of all the roles on the Data Box Edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleList { @@ -5670,7 +5686,7 @@ pub struct RoleList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -6794,6 +6810,12 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + FileEvent(FileEventTrigger), + PeriodicTimerEvent(PeriodicTimerEventTrigger), +} #[doc = "Collection of all trigger on the data box edge device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TriggerList { @@ -6803,7 +6825,7 @@ pub struct TriggerList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/datafactory/src/package_2017_09_preview/models.rs b/services/mgmt/datafactory/src/package_2017_09_preview/models.rs index 675ed4799a..7933534a84 100644 --- a/services/mgmt/datafactory/src/package_2017_09_preview/models.rs +++ b/services/mgmt/datafactory/src/package_2017_09_preview/models.rs @@ -33,6 +33,9 @@ impl Activity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ActivityUnion {} #[doc = "Activity dependency information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ActivityDependency { @@ -192,6 +195,9 @@ impl Dataset { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DatasetUnion {} #[doc = "A list of dataset resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatasetListResponse { @@ -248,10 +254,10 @@ pub struct DatasetResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "The Azure Data Factory nested object which identifies data within different data stores, such as tables, files, folders, and documents."] - pub properties: Dataset, + pub properties: DatasetUnion, } impl DatasetResource { - pub fn new(properties: Dataset) -> Self { + pub fn new(properties: DatasetUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -480,6 +486,9 @@ impl IntegrationRuntime { Self { type_, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeUnion {} #[doc = "The integration runtime authentication keys."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IntegrationRuntimeAuthKeys { @@ -745,10 +754,10 @@ pub struct IntegrationRuntimeResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "Azure Data Factory nested object which serves as a compute resource for activities."] - pub properties: IntegrationRuntime, + pub properties: IntegrationRuntimeUnion, } impl IntegrationRuntimeResource { - pub fn new(properties: IntegrationRuntime) -> Self { + pub fn new(properties: IntegrationRuntimeUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -824,6 +833,9 @@ impl IntegrationRuntimeStatus { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeStatusUnion {} #[doc = "A list of integration runtime status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IntegrationRuntimeStatusListResponse { @@ -845,10 +857,10 @@ pub struct IntegrationRuntimeStatusResponse { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Integration runtime status."] - pub properties: IntegrationRuntimeStatus, + pub properties: IntegrationRuntimeStatusUnion, } impl IntegrationRuntimeStatusResponse { - pub fn new(properties: IntegrationRuntimeStatus) -> Self { + pub fn new(properties: IntegrationRuntimeStatusUnion) -> Self { Self { name: None, properties } } } @@ -923,6 +935,9 @@ impl LinkedService { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum LinkedServiceUnion {} #[doc = "A list of linked service resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LinkedServiceListResponse { @@ -979,10 +994,10 @@ pub struct LinkedServiceResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "The Azure Data Factory nested object which contains the information and credential which can be used to connect with related store or compute resource."] - pub properties: LinkedService, + pub properties: LinkedServiceUnion, } impl LinkedServiceResource { - pub fn new(properties: LinkedService) -> Self { + pub fn new(properties: LinkedServiceUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -1259,7 +1274,7 @@ pub struct Pipeline { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub activities: Vec, + pub activities: Vec, #[doc = "Definition of all parameters for an entity."] #[serde(default, skip_serializing_if = "Option::is_none")] pub parameters: Option, @@ -1684,6 +1699,12 @@ impl SecretBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretBaseUnion { + AzureKeyVaultSecret(AzureKeyVaultSecretReference), + SecureString(SecureString), +} #[doc = "Azure Data Factory secure string definition. The string value will be masked with asterisks '*' during Get or List API calls."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecureString { @@ -1890,6 +1911,9 @@ impl Trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TriggerUnion {} #[doc = "A list of trigger resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TriggerListResponse { @@ -1931,10 +1955,10 @@ pub struct TriggerResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "Azure data factory nested object which contains information about creating pipeline run"] - pub properties: Trigger, + pub properties: TriggerUnion, } impl TriggerResource { - pub fn new(properties: Trigger) -> Self { + pub fn new(properties: TriggerUnion) -> Self { Self { sub_resource: SubResource::default(), properties, diff --git a/services/mgmt/datafactory/src/package_2018_06/models.rs b/services/mgmt/datafactory/src/package_2018_06/models.rs index e385ee5ede..bc41016970 100644 --- a/services/mgmt/datafactory/src/package_2018_06/models.rs +++ b/services/mgmt/datafactory/src/package_2018_06/models.rs @@ -147,6 +147,13 @@ pub mod activity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ActivityUnion { + Container(ControlActivity), + ExecuteWranglingDataflow(ExecuteWranglingDataflowActivity), + Execution(ExecutionActivity), +} #[doc = "Activity dependency information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ActivityDependency { @@ -318,13 +325,13 @@ pub struct AmazonMwsLinkedServiceTypeProperties { pub seller_id: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "mwsAuthToken", default, skip_serializing_if = "Option::is_none")] - pub mws_auth_token: Option, + pub mws_auth_token: Option, #[doc = "The access key id used to access data."] #[serde(rename = "accessKeyId")] pub access_key_id: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "secretKey", default, skip_serializing_if = "Option::is_none")] - pub secret_key: Option, + pub secret_key: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -401,7 +408,7 @@ pub struct AmazonRdsForLinkedServiceTypeProperties { pub connection_string: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -586,7 +593,7 @@ pub struct AmazonRdsForSqlServerLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -705,7 +712,7 @@ pub struct AmazonRedshiftLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The database name of the Amazon Redshift source. Type: string (or Expression with resultType string)."] pub database: serde_json::Value, #[doc = "The TCP port number that the Amazon Redshift server uses to listen for client connections. The default value is 5439. Type: integer (or Expression with resultType integer)."] @@ -808,7 +815,7 @@ pub struct AmazonS3CompatibleLinkedServiceTypeProperties { pub access_key_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "secretAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secret_access_key: Option, + pub secret_access_key: Option, #[doc = "This value specifies the endpoint to access with the Amazon S3 Compatible Connector. This is an optional property; change it only if you want to try a different service endpoint or want to switch between https and http. Type: string (or Expression with resultType string)."] #[serde(rename = "serviceUrl", default, skip_serializing_if = "Option::is_none")] pub service_url: Option, @@ -935,7 +942,7 @@ pub struct AmazonS3DatasetTypeProperties { pub modified_datetime_end: Option, #[doc = "The format definition of a storage."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, #[doc = "The compression method used on a dataset."] #[serde(default, skip_serializing_if = "Option::is_none")] pub compression: Option, @@ -982,13 +989,13 @@ pub struct AmazonS3LinkedServiceTypeProperties { pub access_key_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "secretAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secret_access_key: Option, + pub secret_access_key: Option, #[doc = "This value specifies the endpoint to access with the S3 Connector. This is an optional property; change it only if you want to try a different service endpoint or want to switch between https and http. Type: string (or Expression with resultType string)."] #[serde(rename = "serviceUrl", default, skip_serializing_if = "Option::is_none")] pub service_url: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "sessionToken", default, skip_serializing_if = "Option::is_none")] - pub session_token: Option, + pub session_token: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -1096,13 +1103,13 @@ pub struct AppFiguresLinkedServiceTypeProperties { #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, #[doc = "The base definition of a secret type."] #[serde(rename = "clientKey")] - pub client_key: SecretBase, + pub client_key: SecretBaseUnion, } impl AppFiguresLinkedServiceTypeProperties { - pub fn new(user_name: serde_json::Value, password: SecretBase, client_key: SecretBase) -> Self { + pub fn new(user_name: serde_json::Value, password: SecretBaseUnion, client_key: SecretBaseUnion) -> Self { Self { user_name, password, @@ -1175,13 +1182,13 @@ impl AsanaLinkedService { pub struct AsanaLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken")] - pub api_token: SecretBase, + pub api_token: SecretBaseUnion, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, } impl AsanaLinkedServiceTypeProperties { - pub fn new(api_token: SecretBase) -> Self { + pub fn new(api_token: SecretBaseUnion) -> Self { Self { api_token, encrypted_credential: None, @@ -1256,7 +1263,7 @@ impl AvroDataset { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AvroDatasetTypeProperties { #[doc = "Dataset location."] - pub location: DatasetLocation, + pub location: DatasetLocationUnion, #[doc = "The data avroCompressionCodec. Type: string (or Expression with resultType string)."] #[serde(rename = "avroCompressionCodec", default, skip_serializing_if = "Option::is_none")] pub avro_compression_codec: Option, @@ -1264,7 +1271,7 @@ pub struct AvroDatasetTypeProperties { pub avro_compression_level: Option, } impl AvroDatasetTypeProperties { - pub fn new(location: DatasetLocation) -> Self { + pub fn new(location: DatasetLocationUnion) -> Self { Self { location, avro_compression_codec: None, @@ -1290,7 +1297,7 @@ pub struct AvroSink { pub copy_sink: CopySink, #[doc = "Connector write settings."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Avro write settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] pub format_settings: Option, @@ -1311,7 +1318,7 @@ pub struct AvroSource { pub copy_source: CopySource, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Specifies the additional columns to be added to source data. Type: array of objects(AdditionalColumns) (or Expression with resultType array of objects)."] #[serde(rename = "additionalColumns", default, skip_serializing_if = "Option::is_none")] pub additional_columns: Option, @@ -1407,7 +1414,7 @@ pub struct AzureBatchLinkedServiceTypeProperties { pub account_name: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "accessKey", default, skip_serializing_if = "Option::is_none")] - pub access_key: Option, + pub access_key: Option, #[doc = "The Azure Batch URI. Type: string (or Expression with resultType string)."] #[serde(rename = "batchUri")] pub batch_uri: serde_json::Value, @@ -1479,7 +1486,7 @@ pub struct AzureBlobDatasetTypeProperties { pub modified_datetime_end: Option, #[doc = "The format definition of a storage."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, #[doc = "The compression method used on a dataset."] #[serde(default, skip_serializing_if = "Option::is_none")] pub compression: Option, @@ -1517,7 +1524,7 @@ pub struct AzureBlobFsDatasetTypeProperties { pub file_name: Option, #[doc = "The format definition of a storage."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, #[doc = "The compression method used on a dataset."] #[serde(default, skip_serializing_if = "Option::is_none")] pub compression: Option, @@ -1558,7 +1565,7 @@ pub struct AzureBlobFsLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -1576,13 +1583,13 @@ pub struct AzureBlobFsLinkedServiceTypeProperties { pub service_principal_credential_type: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalCredential", default, skip_serializing_if = "Option::is_none")] - pub service_principal_credential: Option, + pub service_principal_credential: Option, #[doc = "SAS URI of the Azure Data Lake Storage Gen2 service. Type: string, SecureString or AzureKeyVaultSecretReference."] #[serde(rename = "sasUri", default, skip_serializing_if = "Option::is_none")] pub sas_uri: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "sasToken", default, skip_serializing_if = "Option::is_none")] - pub sas_token: Option, + pub sas_token: Option, } impl AzureBlobFsLinkedServiceTypeProperties { pub fn new() -> Self { @@ -1762,7 +1769,7 @@ pub struct AzureBlobStorageLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -1996,7 +2003,7 @@ pub struct AzureDataExplorerLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "Database name for connection. Type: string (or Expression with resultType string)."] pub database: serde_json::Value, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] @@ -2113,7 +2120,7 @@ pub struct AzureDataLakeAnalyticsLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] pub tenant: serde_json::Value, #[doc = "Data Lake Analytics account subscription ID (if different from Data Factory account). Type: string (or Expression with resultType string)."] @@ -2171,7 +2178,7 @@ pub struct AzureDataLakeStoreDatasetTypeProperties { pub file_name: Option, #[doc = "The format definition of a storage."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, #[doc = "The compression method used on a dataset."] #[serde(default, skip_serializing_if = "Option::is_none")] pub compression: Option, @@ -2209,7 +2216,7 @@ pub struct AzureDataLakeStoreLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -2519,7 +2526,7 @@ pub struct AzureDatabricksDetltaLakeLinkedServiceTypeProperties { pub domain: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, + pub access_token: Option, #[doc = "The id of an existing interactive cluster that will be used for all runs of this job. Type: string (or Expression with resultType string)."] #[serde(rename = "clusterId", default, skip_serializing_if = "Option::is_none")] pub cluster_id: Option, @@ -2569,7 +2576,7 @@ pub struct AzureDatabricksLinkedServiceTypeProperties { pub domain: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, + pub access_token: Option, #[doc = "Required to specify MSI, if using Workspace resource id for databricks REST API. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub authentication: Option, @@ -2675,7 +2682,7 @@ pub struct AzureFileStorageLinkedServiceTypeProperties { pub user_id: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The connection string. It is mutually exclusive with sasUri property. Type: string, SecureString or AzureKeyVaultSecretReference."] #[serde(rename = "connectionString", default, skip_serializing_if = "Option::is_none")] pub connection_string: Option, @@ -2899,7 +2906,7 @@ pub struct AzureFunctionLinkedServiceTypeProperties { pub function_app_url: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "functionKey", default, skip_serializing_if = "Option::is_none")] - pub function_key: Option, + pub function_key: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -3094,7 +3101,7 @@ pub struct AzureMlLinkedServiceTypeProperties { pub ml_endpoint: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "apiKey")] - pub api_key: SecretBase, + pub api_key: SecretBaseUnion, #[doc = "The Update Resource REST URL for an Azure ML Studio Web Service endpoint. Type: string (or Expression with resultType string)."] #[serde(rename = "updateResourceEndpoint", default, skip_serializing_if = "Option::is_none")] pub update_resource_endpoint: Option, @@ -3103,7 +3110,7 @@ pub struct AzureMlLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -3115,7 +3122,7 @@ pub struct AzureMlLinkedServiceTypeProperties { pub authentication: Option, } impl AzureMlLinkedServiceTypeProperties { - pub fn new(ml_endpoint: serde_json::Value, api_key: SecretBase) -> Self { + pub fn new(ml_endpoint: serde_json::Value, api_key: SecretBaseUnion) -> Self { Self { ml_endpoint, api_key, @@ -3173,7 +3180,7 @@ pub struct AzureMlServiceLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -3649,7 +3656,7 @@ pub struct AzureSearchLinkedServiceTypeProperties { pub url: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub key: Option, + pub key: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -3694,7 +3701,7 @@ pub struct AzureSqlDwLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -3788,7 +3795,7 @@ pub struct AzureSqlDatabaseLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -3851,7 +3858,7 @@ pub struct AzureSqlMiLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -4289,13 +4296,13 @@ impl BinaryDataset { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BinaryDatasetTypeProperties { #[doc = "Dataset location."] - pub location: DatasetLocation, + pub location: DatasetLocationUnion, #[doc = "The compression method used on a dataset."] #[serde(default, skip_serializing_if = "Option::is_none")] pub compression: Option, } impl BinaryDatasetTypeProperties { - pub fn new(location: DatasetLocation) -> Self { + pub fn new(location: DatasetLocationUnion) -> Self { Self { location, compression: None, @@ -4309,7 +4316,7 @@ pub struct BinaryReadSettings { pub format_read_settings: FormatReadSettings, #[doc = "Compression read settings."] #[serde(rename = "compressionProperties", default, skip_serializing_if = "Option::is_none")] - pub compression_properties: Option, + pub compression_properties: Option, } impl BinaryReadSettings { pub fn new(format_read_settings: FormatReadSettings) -> Self { @@ -4326,7 +4333,7 @@ pub struct BinarySink { pub copy_sink: CopySink, #[doc = "Connector write settings."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, } impl BinarySink { pub fn new(copy_sink: CopySink) -> Self { @@ -4343,7 +4350,7 @@ pub struct BinarySource { pub copy_source: CopySource, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Binary read settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] pub format_settings: Option, @@ -4555,7 +4562,7 @@ pub struct CassandraLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -4894,10 +4901,10 @@ pub struct CmdkeySetupTypeProperties { #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, } impl CmdkeySetupTypeProperties { - pub fn new(target_name: serde_json::Value, user_name: serde_json::Value, password: SecretBase) -> Self { + pub fn new(target_name: serde_json::Value, user_name: serde_json::Value, password: SecretBaseUnion) -> Self { Self { target_name, user_name, @@ -4977,7 +4984,7 @@ pub struct CommonDataServiceForAppsLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The client ID of the application in Azure Active Directory used for Server-To-Server authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "servicePrincipalId", default, skip_serializing_if = "Option::is_none")] pub service_principal_id: Option, @@ -4986,7 +4993,7 @@ pub struct CommonDataServiceForAppsLinkedServiceTypeProperties { pub service_principal_credential_type: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalCredential", default, skip_serializing_if = "Option::is_none")] - pub service_principal_credential: Option, + pub service_principal_credential: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -5184,6 +5191,9 @@ impl CompressionReadSettings { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CompressionReadSettingsUnion {} #[doc = "Concur Service linked service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConcurLinkedService { @@ -5214,7 +5224,7 @@ pub struct ConcurLinkedServiceTypeProperties { pub username: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -5357,9 +5367,9 @@ impl CopyActivityLogSettings { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CopyActivityTypeProperties { #[doc = "A copy activity source."] - pub source: CopySource, + pub source: CopySourceUnion, #[doc = "A copy activity sink."] - pub sink: CopySink, + pub sink: CopySinkUnion, #[doc = "Copy activity translator. If not specified, tabular translator is used."] #[serde(default, skip_serializing_if = "Option::is_none")] pub translator: Option, @@ -5410,7 +5420,7 @@ pub struct CopyActivityTypeProperties { pub skip_error_file: Option, } impl CopyActivityTypeProperties { - pub fn new(source: CopySource, sink: CopySink) -> Self { + pub fn new(source: CopySourceUnion, sink: CopySinkUnion) -> Self { Self { source, sink, @@ -5522,6 +5532,9 @@ impl CopySink { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CopySinkUnion {} #[doc = "A copy activity source."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CopySource { @@ -5552,6 +5565,9 @@ impl CopySource { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CopySourceUnion {} #[doc = "A copy activity translator."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CopyTranslator { @@ -5564,6 +5580,9 @@ impl CopyTranslator { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CopyTranslatorUnion {} #[doc = "Microsoft Azure Cosmos Database (CosmosDB) linked service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CosmosDbLinkedService { @@ -5595,7 +5614,7 @@ pub struct CosmosDbLinkedServiceTypeProperties { pub database: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "accountKey", default, skip_serializing_if = "Option::is_none")] - pub account_key: Option, + pub account_key: Option, #[doc = "The client ID of the application in Azure Active Directory used for Server-To-Server authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "servicePrincipalId", default, skip_serializing_if = "Option::is_none")] pub service_principal_id: Option, @@ -5604,7 +5623,7 @@ pub struct CosmosDbLinkedServiceTypeProperties { pub service_principal_credential_type: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalCredential", default, skip_serializing_if = "Option::is_none")] - pub service_principal_credential: Option, + pub service_principal_credential: Option, #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -6019,6 +6038,11 @@ impl Credential { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CredentialUnion { + ManagedIdentity(ManagedIdentityCredential), +} #[doc = "A list of credential resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CredentialListResponse { @@ -6098,10 +6122,10 @@ pub struct CredentialResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "The Azure Data Factory nested object which contains the information and credential which can be used to connect with related store or compute resource."] - pub properties: Credential, + pub properties: CredentialUnion, } impl CredentialResource { - pub fn new(properties: Credential) -> Self { + pub fn new(properties: CredentialUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -6276,6 +6300,9 @@ impl CustomSetupBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CustomSetupBaseUnion {} #[doc = "Default value."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DwCopyCommandDefaultValue { @@ -6356,6 +6383,13 @@ pub mod data_flow { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DataFlowUnion { + Flowlet(Flowlet), + MappingDataFlow(MappingDataFlow), + WranglingDataFlow(WranglingDataFlow), +} #[doc = "Structure of command payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataFlowDebugCommandPayload { @@ -6540,10 +6574,10 @@ pub struct DataFlowDebugResource { #[serde(flatten)] pub sub_resource_debug_resource: SubResourceDebugResource, #[doc = "Azure Data Factory nested object which contains a flow with data movements and transformations."] - pub properties: DataFlow, + pub properties: DataFlowUnion, } impl DataFlowDebugResource { - pub fn new(properties: DataFlow) -> Self { + pub fn new(properties: DataFlowUnion) -> Self { Self { sub_resource_debug_resource: SubResourceDebugResource::default(), properties, @@ -6676,10 +6710,10 @@ pub struct DataFlowResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "Azure Data Factory nested object which contains a flow with data movements and transformations."] - pub properties: DataFlow, + pub properties: DataFlowUnion, } impl DataFlowResource { - pub fn new(properties: DataFlow) -> Self { + pub fn new(properties: DataFlowUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -7055,6 +7089,112 @@ pub mod dataset { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DatasetUnion { + #[serde(rename = "AmazonMWSObject")] + AmazonMwsObject(AmazonMwsObjectDataset), + AmazonRdsForOracleTable(AmazonRdsForOracleTableDataset), + AmazonRdsForSqlServerTable(AmazonRdsForSqlServerTableDataset), + AmazonRedshiftTable(AmazonRedshiftTableDataset), + AmazonS3Object(AmazonS3Dataset), + Avro(AvroDataset), + AzureBlob(AzureBlobDataset), + #[serde(rename = "AzureBlobFSFile")] + AzureBlobFsFile(AzureBlobFsDataset), + AzureDataExplorerTable(AzureDataExplorerTableDataset), + AzureDataLakeStoreFile(AzureDataLakeStoreDataset), + AzureDatabricksDeltaLakeDataset(AzureDatabricksDeltaLakeDataset), + #[serde(rename = "AzureMariaDBTable")] + AzureMariaDbTable(AzureMariaDbTableDataset), + AzureMySqlTable(AzureMySqlTableDataset), + AzurePostgreSqlTable(AzurePostgreSqlTableDataset), + AzureSearchIndex(AzureSearchIndexDataset), + #[serde(rename = "AzureSqlDWTable")] + AzureSqlDwTable(AzureSqlDwTableDataset), + #[serde(rename = "AzureSqlMITable")] + AzureSqlMiTable(AzureSqlMiTableDataset), + AzureSqlTable(AzureSqlTableDataset), + AzureTable(AzureTableDataset), + Binary(BinaryDataset), + CassandraTable(CassandraTableDataset), + CommonDataServiceForAppsEntity(CommonDataServiceForAppsEntityDataset), + ConcurObject(ConcurObjectDataset), + CosmosDbMongoDbApiCollection(CosmosDbMongoDbApiCollectionDataset), + CosmosDbSqlApiCollection(CosmosDbSqlApiCollectionDataset), + CouchbaseTable(CouchbaseTableDataset), + Db2Table(Db2TableDataset), + DelimitedText(DelimitedTextDataset), + DocumentDbCollection(DocumentDbCollectionDataset), + DrillTable(DrillTableDataset), + #[serde(rename = "DynamicsAXResource")] + DynamicsAxResource(DynamicsAxResourceDataset), + DynamicsCrmEntity(DynamicsCrmEntityDataset), + DynamicsEntity(DynamicsEntityDataset), + EloquaObject(EloquaObjectDataset), + Excel(ExcelDataset), + FileShare(FileShareDataset), + GoogleAdWordsObject(GoogleAdWordsObjectDataset), + GoogleBigQueryObject(GoogleBigQueryObjectDataset), + GreenplumTable(GreenplumTableDataset), + HBaseObject(HBaseObjectDataset), + HiveObject(HiveObjectDataset), + HttpFile(HttpDataset), + HubspotObject(HubspotObjectDataset), + ImpalaObject(ImpalaObjectDataset), + InformixTable(InformixTableDataset), + JiraObject(JiraObjectDataset), + Json(JsonDataset), + MagentoObject(MagentoObjectDataset), + #[serde(rename = "MariaDBTable")] + MariaDbTable(MariaDbTableDataset), + MarketoObject(MarketoObjectDataset), + MicrosoftAccessTable(MicrosoftAccessTableDataset), + MongoDbAtlasCollection(MongoDbAtlasCollectionDataset), + MongoDbCollection(MongoDbCollectionDataset), + MongoDbV2Collection(MongoDbV2CollectionDataset), + MySqlTable(MySqlTableDataset), + NetezzaTable(NetezzaTableDataset), + ODataResource(ODataResourceDataset), + OdbcTable(OdbcTableDataset), + Office365Table(Office365Dataset), + OracleServiceCloudObject(OracleServiceCloudObjectDataset), + OracleTable(OracleTableDataset), + Orc(OrcDataset), + Parquet(ParquetDataset), + PaypalObject(PaypalObjectDataset), + PhoenixObject(PhoenixObjectDataset), + PostgreSqlTable(PostgreSqlTableDataset), + PrestoObject(PrestoObjectDataset), + QuickBooksObject(QuickBooksObjectDataset), + RelationalTable(RelationalTableDataset), + ResponsysObject(ResponsysObjectDataset), + RestResource(RestResourceDataset), + SalesforceMarketingCloudObject(SalesforceMarketingCloudObjectDataset), + SalesforceObject(SalesforceObjectDataset), + SalesforceServiceCloudObject(SalesforceServiceCloudObjectDataset), + SapBwCube(SapBwCubeDataset), + SapCloudForCustomerResource(SapCloudForCustomerResourceDataset), + SapEccResource(SapEccResourceDataset), + SapHanaTable(SapHanaTableDataset), + SapOdpResource(SapOdpResourceDataset), + SapOpenHubTable(SapOpenHubTableDataset), + SapTableResource(SapTableResourceDataset), + ServiceNowObject(ServiceNowObjectDataset), + SharePointOnlineListResource(SharePointOnlineListResourceDataset), + ShopifyObject(ShopifyObjectDataset), + SnowflakeTable(SnowflakeDataset), + SparkObject(SparkObjectDataset), + SqlServerTable(SqlServerTableDataset), + SquareObject(SquareObjectDataset), + SybaseTable(SybaseTableDataset), + TeradataTable(TeradataTableDataset), + VerticaTable(VerticaTableDataset), + WebTable(WebTableDataset), + XeroObject(XeroObjectDataset), + Xml(XmlDataset), + ZohoObject(ZohoObjectDataset), +} #[doc = "The compression method used on a dataset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatasetCompression { @@ -7091,10 +7231,10 @@ pub struct DatasetDebugResource { #[serde(flatten)] pub sub_resource_debug_resource: SubResourceDebugResource, #[doc = "The Azure Data Factory nested object which identifies data within different data stores, such as tables, files, folders, and documents."] - pub properties: Dataset, + pub properties: DatasetUnion, } impl DatasetDebugResource { - pub fn new(properties: Dataset) -> Self { + pub fn new(properties: DatasetUnion) -> Self { Self { sub_resource_debug_resource: SubResourceDebugResource::default(), properties, @@ -7143,6 +7283,9 @@ impl DatasetLocation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DatasetLocationUnion {} #[doc = "Dataset reference type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatasetReference { @@ -7179,10 +7322,10 @@ pub struct DatasetResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "The Azure Data Factory nested object which identifies data within different data stores, such as tables, files, folders, and documents."] - pub properties: Dataset, + pub properties: DatasetUnion, } impl DatasetResource { - pub fn new(properties: Dataset) -> Self { + pub fn new(properties: DatasetUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -7226,6 +7369,9 @@ impl DatasetStorageFormat { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DatasetStorageFormatUnion {} #[doc = "Linked service for Dataworld."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataworldLinkedService { @@ -7248,13 +7394,13 @@ impl DataworldLinkedService { pub struct DataworldLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken")] - pub api_token: SecretBase, + pub api_token: SecretBaseUnion, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, } impl DataworldLinkedServiceTypeProperties { - pub fn new(api_token: SecretBase) -> Self { + pub fn new(api_token: SecretBaseUnion) -> Self { Self { api_token, encrypted_credential: None, @@ -7309,7 +7455,7 @@ pub struct Db2LinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Under where packages are created when querying database. It is mutually exclusive with connectionString property. Type: string (or Expression with resultType string)."] #[serde(rename = "packageCollection", default, skip_serializing_if = "Option::is_none")] pub package_collection: Option, @@ -7451,7 +7597,7 @@ pub struct DeleteActivityTypeProperties { pub dataset: DatasetReference, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, } impl DeleteActivityTypeProperties { pub fn new(dataset: DatasetReference) -> Self { @@ -7498,7 +7644,7 @@ impl DelimitedTextDataset { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DelimitedTextDatasetTypeProperties { #[doc = "Dataset location."] - pub location: DatasetLocation, + pub location: DatasetLocationUnion, #[doc = "The column delimiter. Type: string (or Expression with resultType string)."] #[serde(rename = "columnDelimiter", default, skip_serializing_if = "Option::is_none")] pub column_delimiter: Option, @@ -7528,7 +7674,7 @@ pub struct DelimitedTextDatasetTypeProperties { pub null_value: Option, } impl DelimitedTextDatasetTypeProperties { - pub fn new(location: DatasetLocation) -> Self { + pub fn new(location: DatasetLocationUnion) -> Self { Self { location, column_delimiter: None, @@ -7553,7 +7699,7 @@ pub struct DelimitedTextReadSettings { pub skip_line_count: Option, #[doc = "Compression read settings."] #[serde(rename = "compressionProperties", default, skip_serializing_if = "Option::is_none")] - pub compression_properties: Option, + pub compression_properties: Option, } impl DelimitedTextReadSettings { pub fn new(format_read_settings: FormatReadSettings) -> Self { @@ -7571,7 +7717,7 @@ pub struct DelimitedTextSink { pub copy_sink: CopySink, #[doc = "Connector write settings."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Delimited text write settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] pub format_settings: Option, @@ -7592,7 +7738,7 @@ pub struct DelimitedTextSource { pub copy_source: CopySource, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Delimited text read settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] pub format_settings: Option, @@ -7651,6 +7797,9 @@ impl DependencyReference { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DependencyReferenceUnion {} #[doc = "Distcp settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DistcpSettings { @@ -7863,7 +8012,7 @@ pub struct DynamicsAxLinkedServiceTypeProperties { pub service_principal_id: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey")] - pub service_principal_key: SecretBase, + pub service_principal_key: SecretBaseUnion, #[doc = "Specify the tenant information (domain name or tenant ID) under which your application resides. Retrieve it by hovering the mouse in the top-right corner of the Azure portal. Type: string (or Expression with resultType string)."] pub tenant: serde_json::Value, #[doc = "Specify the resource you are requesting authorization. Type: string (or Expression with resultType string)."] @@ -7877,7 +8026,7 @@ impl DynamicsAxLinkedServiceTypeProperties { pub fn new( url: serde_json::Value, service_principal_id: serde_json::Value, - service_principal_key: SecretBase, + service_principal_key: SecretBaseUnion, tenant: serde_json::Value, aad_resource_id: serde_json::Value, ) -> Self { @@ -8049,7 +8198,7 @@ pub struct DynamicsCrmLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The client ID of the application in Azure Active Directory used for Server-To-Server authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "servicePrincipalId", default, skip_serializing_if = "Option::is_none")] pub service_principal_id: Option, @@ -8058,7 +8207,7 @@ pub struct DynamicsCrmLinkedServiceTypeProperties { pub service_principal_credential_type: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalCredential", default, skip_serializing_if = "Option::is_none")] - pub service_principal_credential: Option, + pub service_principal_credential: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -8236,7 +8385,7 @@ pub struct DynamicsLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The client ID of the application in Azure Active Directory used for Server-To-Server authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "servicePrincipalId", default, skip_serializing_if = "Option::is_none")] pub service_principal_id: Option, @@ -8245,7 +8394,7 @@ pub struct DynamicsLinkedServiceTypeProperties { pub service_principal_credential_type: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalCredential", default, skip_serializing_if = "Option::is_none")] - pub service_principal_credential: Option, + pub service_principal_credential: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -8379,7 +8528,7 @@ pub struct EloquaLinkedServiceTypeProperties { pub username: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -8577,7 +8726,7 @@ impl ExcelDataset { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExcelDatasetTypeProperties { #[doc = "Dataset location."] - pub location: DatasetLocation, + pub location: DatasetLocationUnion, #[doc = "The sheet name of excel file. Type: string (or Expression with resultType string)."] #[serde(rename = "sheetName", default, skip_serializing_if = "Option::is_none")] pub sheet_name: Option, @@ -8598,7 +8747,7 @@ pub struct ExcelDatasetTypeProperties { pub null_value: Option, } impl ExcelDatasetTypeProperties { - pub fn new(location: DatasetLocation) -> Self { + pub fn new(location: DatasetLocationUnion) -> Self { Self { location, sheet_name: None, @@ -8617,7 +8766,7 @@ pub struct ExcelSource { pub copy_source: CopySource, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Specifies the additional columns to be added to source data. Type: array of objects(AdditionalColumns) (or Expression with resultType array of objects)."] #[serde(rename = "additionalColumns", default, skip_serializing_if = "Option::is_none")] pub additional_columns: Option, @@ -8916,6 +9065,9 @@ impl ExportSettings { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ExportSettingsUnion {} #[doc = "A list of exposure control features."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExposureControlBatchRequest { @@ -9142,7 +9294,7 @@ pub struct FactoryProperties { pub purview_configuration: Option, #[doc = "Factory's git repo information."] #[serde(rename = "repoConfiguration", default, skip_serializing_if = "Option::is_none")] - pub repo_configuration: Option, + pub repo_configuration: Option, #[doc = "Definition of all parameters for an entity."] #[serde(rename = "globalParameters", default, skip_serializing_if = "Option::is_none")] pub global_parameters: Option, @@ -9236,6 +9388,13 @@ impl FactoryRepoConfiguration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FactoryRepoConfigurationUnion { + FactoryGitHubConfiguration(FactoryGitHubConfiguration), + #[serde(rename = "FactoryVSTSConfiguration")] + FactoryVstsConfiguration(FactoryVstsConfiguration), +} #[doc = "Factory's git repo information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FactoryRepoUpdate { @@ -9244,7 +9403,7 @@ pub struct FactoryRepoUpdate { pub factory_resource_id: Option, #[doc = "Factory's git repo information."] #[serde(rename = "repoConfiguration", default, skip_serializing_if = "Option::is_none")] - pub repo_configuration: Option, + pub repo_configuration: Option, } impl FactoryRepoUpdate { pub fn new() -> Self { @@ -9400,7 +9559,7 @@ pub struct FileServerLinkedServiceTypeProperties { pub user_id: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -9524,7 +9683,7 @@ pub struct FileShareDatasetTypeProperties { pub modified_datetime_end: Option, #[doc = "The format definition of a storage."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, #[doc = "Specify a filter to be used to select a subset of files in the folderPath rather than all files. Type: string (or Expression with resultType string)."] #[serde(rename = "fileFilter", default, skip_serializing_if = "Option::is_none")] pub file_filter: Option, @@ -9692,10 +9851,10 @@ pub struct ForEachActivityTypeProperties { #[doc = "Azure Data Factory expression definition."] pub items: Expression, #[doc = "List of activities to execute ."] - pub activities: Vec, + pub activities: Vec, } impl ForEachActivityTypeProperties { - pub fn new(items: Expression, activities: Vec) -> Self { + pub fn new(items: Expression, activities: Vec) -> Self { Self { is_sequential: None, batch_count: None, @@ -9716,6 +9875,9 @@ impl FormatReadSettings { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FormatReadSettingsUnion {} #[doc = "Format write settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FormatWriteSettings { @@ -9728,6 +9890,9 @@ impl FormatWriteSettings { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FormatWriteSettingsUnion {} #[doc = "Ftp read settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FtpReadSettings { @@ -9810,7 +9975,7 @@ pub struct FtpServerLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -9942,10 +10107,10 @@ pub struct GetMetadataActivityTypeProperties { pub field_list: Vec, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Format read settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] - pub format_settings: Option, + pub format_settings: Option, } impl GetMetadataActivityTypeProperties { pub fn new(dataset: DatasetReference) -> Self { @@ -10164,19 +10329,19 @@ pub struct GoogleAdWordsLinkedServiceTypeProperties { pub client_customer_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "developerToken", default, skip_serializing_if = "Option::is_none")] - pub developer_token: Option, + pub developer_token: Option, #[doc = "The OAuth 2.0 authentication mechanism used for authentication. ServiceAuthentication can only be used on self-hosted IR."] #[serde(rename = "authenticationType", default, skip_serializing_if = "Option::is_none")] pub authentication_type: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "refreshToken", default, skip_serializing_if = "Option::is_none")] - pub refresh_token: Option, + pub refresh_token: Option, #[doc = "The client id of the google application used to acquire the refresh token. Type: string (or Expression with resultType string)."] #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] pub client_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, @@ -10323,13 +10488,13 @@ pub struct GoogleBigQueryLinkedServiceTypeProperties { pub authentication_type: google_big_query_linked_service_type_properties::AuthenticationType, #[doc = "The base definition of a secret type."] #[serde(rename = "refreshToken", default, skip_serializing_if = "Option::is_none")] - pub refresh_token: Option, + pub refresh_token: Option, #[doc = "The client id of the google application used to acquire the refresh token. Type: string (or Expression with resultType string)."] #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] pub client_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, @@ -10466,7 +10631,7 @@ pub struct GoogleCloudStorageLinkedServiceTypeProperties { pub access_key_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "secretAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secret_access_key: Option, + pub secret_access_key: Option, #[doc = "This value specifies the endpoint to access with the Google Cloud Storage Connector. This is an optional property; change it only if you want to try a different service endpoint or want to switch between https and http. Type: string (or Expression with resultType string)."] #[serde(rename = "serviceUrl", default, skip_serializing_if = "Option::is_none")] pub service_url: Option, @@ -10575,13 +10740,13 @@ impl GoogleSheetsLinkedService { pub struct GoogleSheetsLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken")] - pub api_token: SecretBase, + pub api_token: SecretBaseUnion, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, } impl GoogleSheetsLinkedServiceTypeProperties { - pub fn new(api_token: SecretBase) -> Self { + pub fn new(api_token: SecretBaseUnion) -> Self { Self { api_token, encrypted_credential: None, @@ -10711,7 +10876,7 @@ pub struct HBaseLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Specifies whether the connections to the server are encrypted using SSL. The default value is false."] #[serde(rename = "enableSsl", default, skip_serializing_if = "Option::is_none")] pub enable_ssl: Option, @@ -10945,7 +11110,7 @@ pub struct HdInsightLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Linked service reference type."] #[serde(rename = "linkedServiceName", default, skip_serializing_if = "Option::is_none")] pub linked_service_name: Option, @@ -11088,7 +11253,7 @@ pub struct HdInsightOnDemandLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The Tenant id/name to which the service principal belongs. Type: string (or Expression with resultType string)."] pub tenant: serde_json::Value, #[doc = "The resource group where the cluster belongs. Type: string (or Expression with resultType string)."] @@ -11102,13 +11267,13 @@ pub struct HdInsightOnDemandLinkedServiceTypeProperties { pub cluster_user_name: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "clusterPassword", default, skip_serializing_if = "Option::is_none")] - pub cluster_password: Option, + pub cluster_password: Option, #[doc = "The username to SSH remotely connect to cluster’s node (for Linux). Type: string (or Expression with resultType string)."] #[serde(rename = "clusterSshUserName", default, skip_serializing_if = "Option::is_none")] pub cluster_ssh_user_name: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "clusterSshPassword", default, skip_serializing_if = "Option::is_none")] - pub cluster_ssh_password: Option, + pub cluster_ssh_password: Option, #[doc = "Specifies additional storage accounts for the HDInsight linked service so that the Data Factory service can register them on your behalf."] #[serde( rename = "additionalLinkedServiceNames", @@ -11464,7 +11629,7 @@ pub struct HdfsLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, } impl HdfsLinkedServiceTypeProperties { pub fn new(url: serde_json::Value) -> Self { @@ -11667,7 +11832,7 @@ pub struct HiveLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The partial URL corresponding to the Hive server."] #[serde(rename = "httpPath", default, skip_serializing_if = "Option::is_none")] pub http_path: Option, @@ -11908,7 +12073,7 @@ pub struct HttpDatasetTypeProperties { pub additional_headers: Option, #[doc = "The format definition of a storage."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, #[doc = "The compression method used on a dataset."] #[serde(default, skip_serializing_if = "Option::is_none")] pub compression: Option, @@ -11948,7 +12113,7 @@ pub struct HttpLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The additional HTTP headers in the request to RESTful API used for authorization. Type: object (or Expression with resultType object)."] #[serde(rename = "authHeaders", default, skip_serializing_if = "Option::is_none")] pub auth_headers: Option, @@ -12118,13 +12283,13 @@ pub struct HubspotLinkedServiceTypeProperties { pub client_id: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, + pub access_token: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "refreshToken", default, skip_serializing_if = "Option::is_none")] - pub refresh_token: Option, + pub refresh_token: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -12215,7 +12380,7 @@ pub struct IfConditionActivityTypeProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub if_true_activities: Vec, + pub if_true_activities: Vec, #[doc = "List of activities to execute if expression is evaluated to false. This is an optional property and if not provided, the activity will exit without any action."] #[serde( rename = "ifFalseActivities", @@ -12223,7 +12388,7 @@ pub struct IfConditionActivityTypeProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub if_false_activities: Vec, + pub if_false_activities: Vec, } impl IfConditionActivityTypeProperties { pub fn new(expression: Expression) -> Self { @@ -12285,7 +12450,7 @@ pub struct ImpalaLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Specifies whether the connections to the server are encrypted using SSL. The default value is false."] #[serde(rename = "enableSsl", default, skip_serializing_if = "Option::is_none")] pub enable_ssl: Option, @@ -12411,6 +12576,9 @@ impl ImportSettings { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImportSettingsUnion {} #[doc = "Informix linked service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InformixLinkedService { @@ -12439,13 +12607,13 @@ pub struct InformixLinkedServiceTypeProperties { pub authentication_type: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub credential: Option, + pub credential: Option, #[doc = "User name for Basic authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")] pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -12540,6 +12708,12 @@ impl IntegrationRuntime { Self { type_, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeUnion { + Managed(ManagedIntegrationRuntime), + SelfHosted(SelfHostedIntegrationRuntime), +} #[doc = "The integration runtime authentication keys."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IntegrationRuntimeAuthKeys { @@ -12778,10 +12952,10 @@ pub struct IntegrationRuntimeDebugResource { #[serde(flatten)] pub sub_resource_debug_resource: SubResourceDebugResource, #[doc = "Azure Data Factory nested object which serves as a compute resource for activities."] - pub properties: IntegrationRuntime, + pub properties: IntegrationRuntimeUnion, } impl IntegrationRuntimeDebugResource { - pub fn new(properties: IntegrationRuntime) -> Self { + pub fn new(properties: IntegrationRuntimeUnion) -> Self { Self { sub_resource_debug_resource: SubResourceDebugResource::default(), properties, @@ -13029,10 +13203,10 @@ pub struct IntegrationRuntimeResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "Azure Data Factory nested object which serves as a compute resource for activities."] - pub properties: IntegrationRuntime, + pub properties: IntegrationRuntimeUnion, } impl IntegrationRuntimeResource { - pub fn new(properties: IntegrationRuntime) -> Self { + pub fn new(properties: IntegrationRuntimeUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -13133,7 +13307,7 @@ pub struct IntegrationRuntimeSsisProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub express_custom_setup_properties: Vec, + pub express_custom_setup_properties: Vec, #[doc = "Package stores for the SSIS Integration Runtime."] #[serde( rename = "packageStores", @@ -13303,6 +13477,12 @@ impl IntegrationRuntimeStatus { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeStatusUnion { + Managed(ManagedIntegrationRuntimeStatus), + SelfHosted(SelfHostedIntegrationRuntimeStatus), +} #[doc = "A list of integration runtime status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IntegrationRuntimeStatusListResponse { @@ -13324,10 +13504,10 @@ pub struct IntegrationRuntimeStatusResponse { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Integration runtime status."] - pub properties: IntegrationRuntimeStatus, + pub properties: IntegrationRuntimeStatusUnion, } impl IntegrationRuntimeStatusResponse { - pub fn new(properties: IntegrationRuntimeStatus) -> Self { + pub fn new(properties: IntegrationRuntimeStatusUnion) -> Self { Self { name: None, properties } } } @@ -13423,7 +13603,7 @@ pub struct JiraLinkedServiceTypeProperties { pub username: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -13506,7 +13686,7 @@ impl JsonDataset { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JsonDatasetTypeProperties { #[doc = "Dataset location."] - pub location: DatasetLocation, + pub location: DatasetLocationUnion, #[doc = "The code page name of the preferred encoding. If not specified, the default value is UTF-8, unless BOM denotes another Unicode encoding. Refer to the name column of the table in the following link to set supported values: https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: string (or Expression with resultType string)."] #[serde(rename = "encodingName", default, skip_serializing_if = "Option::is_none")] pub encoding_name: Option, @@ -13515,7 +13695,7 @@ pub struct JsonDatasetTypeProperties { pub compression: Option, } impl JsonDatasetTypeProperties { - pub fn new(location: DatasetLocation) -> Self { + pub fn new(location: DatasetLocationUnion) -> Self { Self { location, encoding_name: None, @@ -13602,7 +13782,7 @@ pub struct JsonReadSettings { pub format_read_settings: FormatReadSettings, #[doc = "Compression read settings."] #[serde(rename = "compressionProperties", default, skip_serializing_if = "Option::is_none")] - pub compression_properties: Option, + pub compression_properties: Option, } impl JsonReadSettings { pub fn new(format_read_settings: FormatReadSettings) -> Self { @@ -13619,7 +13799,7 @@ pub struct JsonSink { pub copy_sink: CopySink, #[doc = "Connector write settings."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Json write settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] pub format_settings: Option, @@ -13640,7 +13820,7 @@ pub struct JsonSource { pub copy_source: CopySource, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Json read settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] pub format_settings: Option, @@ -13722,7 +13902,7 @@ pub struct LicensedComponentSetupTypeProperties { pub component_name: String, #[doc = "The base definition of a secret type."] #[serde(rename = "licenseKey", default, skip_serializing_if = "Option::is_none")] - pub license_key: Option, + pub license_key: Option, } impl LicensedComponentSetupTypeProperties { pub fn new(component_name: String) -> Self { @@ -13817,6 +13997,13 @@ impl LinkedIntegrationRuntimeType { Self { authorization_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authorizationType")] +pub enum LinkedIntegrationRuntimeTypeUnion { + Key(LinkedIntegrationRuntimeKeyAuthorization), + #[serde(rename = "RBAC")] + Rbac(LinkedIntegrationRuntimeRbacAuthorization), +} #[doc = "The nested object which contains the information and credential which can be used to connect with related store or compute resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LinkedService { @@ -13851,16 +14038,145 @@ impl LinkedService { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum LinkedServiceUnion { + #[serde(rename = "AmazonMWS")] + AmazonMws(AmazonMwsLinkedService), + AmazonRdsForOracle(AmazonRdsForOracleLinkedService), + AmazonRdsForSqlServer(AmazonRdsForSqlServerLinkedService), + AmazonRedshift(AmazonRedshiftLinkedService), + AmazonS3Compatible(AmazonS3CompatibleLinkedService), + AmazonS3(AmazonS3LinkedService), + AppFigures(AppFiguresLinkedService), + Asana(AsanaLinkedService), + AzureBatch(AzureBatchLinkedService), + #[serde(rename = "AzureBlobFS")] + AzureBlobFs(AzureBlobFsLinkedService), + AzureBlobStorage(AzureBlobStorageLinkedService), + AzureDataExplorer(AzureDataExplorerLinkedService), + AzureDataLakeAnalytics(AzureDataLakeAnalyticsLinkedService), + AzureDataLakeStore(AzureDataLakeStoreLinkedService), + AzureDatabricksDeltaLake(AzureDatabricksDeltaLakeLinkedService), + AzureDatabricks(AzureDatabricksLinkedService), + AzureFileStorage(AzureFileStorageLinkedService), + AzureFunction(AzureFunctionLinkedService), + AzureKeyVault(AzureKeyVaultLinkedService), + #[serde(rename = "AzureML")] + AzureMl(AzureMlLinkedService), + #[serde(rename = "AzureMLService")] + AzureMlService(AzureMlServiceLinkedService), + #[serde(rename = "AzureMariaDB")] + AzureMariaDb(AzureMariaDbLinkedService), + AzureMySql(AzureMySqlLinkedService), + AzurePostgreSql(AzurePostgreSqlLinkedService), + AzureSearch(AzureSearchLinkedService), + #[serde(rename = "AzureSqlDW")] + AzureSqlDw(AzureSqlDwLinkedService), + AzureSqlDatabase(AzureSqlDatabaseLinkedService), + #[serde(rename = "AzureSqlMI")] + AzureSqlMi(AzureSqlMiLinkedService), + AzureStorage(AzureStorageLinkedService), + AzureSynapseArtifacts(AzureSynapseArtifactsLinkedService), + AzureTableStorage(AzureTableStorageLinkedService), + Cassandra(CassandraLinkedService), + CommonDataServiceForApps(CommonDataServiceForAppsLinkedService), + Concur(ConcurLinkedService), + CosmosDb(CosmosDbLinkedService), + CosmosDbMongoDbApi(CosmosDbMongoDbApiLinkedService), + Couchbase(CouchbaseLinkedService), + CustomDataSource(CustomDataSourceLinkedService), + Dataworld(DataworldLinkedService), + Db2(Db2LinkedService), + Drill(DrillLinkedService), + #[serde(rename = "DynamicsAX")] + DynamicsAx(DynamicsAxLinkedService), + DynamicsCrm(DynamicsCrmLinkedService), + Dynamics(DynamicsLinkedService), + Eloqua(EloquaLinkedService), + FileServer(FileServerLinkedService), + FtpServer(FtpServerLinkedService), + GoogleAdWords(GoogleAdWordsLinkedService), + GoogleBigQuery(GoogleBigQueryLinkedService), + GoogleCloudStorage(GoogleCloudStorageLinkedService), + GoogleSheets(GoogleSheetsLinkedService), + Greenplum(GreenplumLinkedService), + HBase(HBaseLinkedService), + #[serde(rename = "HDInsight")] + HdInsight(HdInsightLinkedService), + #[serde(rename = "HDInsightOnDemand")] + HdInsightOnDemand(HdInsightOnDemandLinkedService), + Hdfs(HdfsLinkedService), + Hive(HiveLinkedService), + HttpServer(HttpLinkedService), + Hubspot(HubspotLinkedService), + Impala(ImpalaLinkedService), + Informix(InformixLinkedService), + Jira(JiraLinkedService), + Magento(MagentoLinkedService), + #[serde(rename = "MariaDB")] + MariaDb(MariaDbLinkedService), + Marketo(MarketoLinkedService), + MicrosoftAccess(MicrosoftAccessLinkedService), + MongoDbAtlas(MongoDbAtlasLinkedService), + MongoDb(MongoDbLinkedService), + MongoDbV2(MongoDbV2LinkedService), + MySql(MySqlLinkedService), + Netezza(NetezzaLinkedService), + OData(ODataLinkedService), + Odbc(OdbcLinkedService), + Office365(Office365LinkedService), + OracleCloudStorage(OracleCloudStorageLinkedService), + Oracle(OracleLinkedService), + OracleServiceCloud(OracleServiceCloudLinkedService), + Paypal(PaypalLinkedService), + Phoenix(PhoenixLinkedService), + PostgreSql(PostgreSqlLinkedService), + Presto(PrestoLinkedService), + QuickBooks(QuickBooksLinkedService), + Quickbase(QuickbaseLinkedService), + Responsys(ResponsysLinkedService), + RestService(RestServiceLinkedService), + Salesforce(SalesforceLinkedService), + SalesforceMarketingCloud(SalesforceMarketingCloudLinkedService), + SalesforceServiceCloud(SalesforceServiceCloudLinkedService), + #[serde(rename = "SapBW")] + SapBw(SapBwLinkedService), + SapCloudForCustomer(SapCloudForCustomerLinkedService), + SapEcc(SapEccLinkedService), + SapHana(SapHanaLinkedService), + SapOdp(SapOdpLinkedService), + SapOpenHub(SapOpenHubLinkedService), + SapTable(SapTableLinkedService), + ServiceNow(ServiceNowLinkedService), + Sftp(SftpServerLinkedService), + SharePointOnlineList(SharePointOnlineListLinkedService), + Shopify(ShopifyLinkedService), + Smartsheet(SmartsheetLinkedService), + Snowflake(SnowflakeLinkedService), + Spark(SparkLinkedService), + SqlServer(SqlServerLinkedService), + Square(SquareLinkedService), + Sybase(SybaseLinkedService), + TeamDesk(TeamDeskLinkedService), + Teradata(TeradataLinkedService), + Twilio(TwilioLinkedService), + Vertica(VerticaLinkedService), + Web(WebLinkedService), + Xero(XeroLinkedService), + Zendesk(ZendeskLinkedService), + Zoho(ZohoLinkedService), +} #[doc = "Linked service debug resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LinkedServiceDebugResource { #[serde(flatten)] pub sub_resource_debug_resource: SubResourceDebugResource, #[doc = "The nested object which contains the information and credential which can be used to connect with related store or compute resource."] - pub properties: LinkedService, + pub properties: LinkedServiceUnion, } impl LinkedServiceDebugResource { - pub fn new(properties: LinkedService) -> Self { + pub fn new(properties: LinkedServiceUnion) -> Self { Self { sub_resource_debug_resource: SubResourceDebugResource::default(), properties, @@ -13953,10 +14269,10 @@ pub struct LinkedServiceResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "The nested object which contains the information and credential which can be used to connect with related store or compute resource."] - pub properties: LinkedService, + pub properties: LinkedServiceUnion, } impl LinkedServiceResource { - pub fn new(properties: LinkedService) -> Self { + pub fn new(properties: LinkedServiceUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -14050,7 +14366,7 @@ impl LookupActivity { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LookupActivityTypeProperties { #[doc = "A copy activity source."] - pub source: CopySource, + pub source: CopySourceUnion, #[doc = "Dataset reference type."] pub dataset: DatasetReference, #[doc = "Whether to return first row or all rows. Default value is true. Type: boolean (or Expression with resultType boolean)."] @@ -14058,7 +14374,7 @@ pub struct LookupActivityTypeProperties { pub first_row_only: Option, } impl LookupActivityTypeProperties { - pub fn new(source: CopySource, dataset: DatasetReference) -> Self { + pub fn new(source: CopySourceUnion, dataset: DatasetReference) -> Self { Self { source, dataset, @@ -14090,7 +14406,7 @@ pub struct MagentoLinkedServiceTypeProperties { pub host: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, + pub access_token: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -15148,7 +15464,7 @@ pub struct MarketoLinkedServiceTypeProperties { pub client_id: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -15252,13 +15568,13 @@ pub struct MicrosoftAccessLinkedServiceTypeProperties { pub authentication_type: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub credential: Option, + pub credential: Option, #[doc = "User name for Basic authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")] pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -15535,7 +15851,7 @@ pub struct MongoDbLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Database to verify the username and password. Type: string (or Expression with resultType string)."] #[serde(rename = "authSource", default, skip_serializing_if = "Option::is_none")] pub auth_source: Option, @@ -16086,7 +16402,7 @@ pub struct ODataLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The additional HTTP headers in the request to RESTful API used for authorization. Type: object (or Expression with resultType object)."] #[serde(rename = "authHeaders", default, skip_serializing_if = "Option::is_none")] pub auth_headers: Option, @@ -16107,13 +16423,13 @@ pub struct ODataLinkedServiceTypeProperties { pub aad_service_principal_credential_type: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalEmbeddedCert", default, skip_serializing_if = "Option::is_none")] - pub service_principal_embedded_cert: Option, + pub service_principal_embedded_cert: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalEmbeddedCertPassword", default, skip_serializing_if = "Option::is_none")] - pub service_principal_embedded_cert_password: Option, + pub service_principal_embedded_cert_password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -16307,13 +16623,13 @@ pub struct OdbcLinkedServiceTypeProperties { pub authentication_type: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub credential: Option, + pub credential: Option, #[doc = "User name for Basic authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")] pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -16456,7 +16772,7 @@ pub struct Office365LinkedServiceTypeProperties { pub service_principal_id: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey")] - pub service_principal_key: SecretBase, + pub service_principal_key: SecretBaseUnion, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -16466,7 +16782,7 @@ impl Office365LinkedServiceTypeProperties { office365_tenant_id: serde_json::Value, service_principal_tenant_id: serde_json::Value, service_principal_id: serde_json::Value, - service_principal_key: SecretBase, + service_principal_key: SecretBaseUnion, ) -> Self { Self { office365_tenant_id, @@ -16744,7 +17060,7 @@ pub struct OracleCloudStorageLinkedServiceTypeProperties { pub access_key_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "secretAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secret_access_key: Option, + pub secret_access_key: Option, #[doc = "This value specifies the endpoint to access with the Oracle Cloud Storage Connector. This is an optional property; change it only if you want to try a different service endpoint or want to switch between https and http. Type: string (or Expression with resultType string)."] #[serde(rename = "serviceUrl", default, skip_serializing_if = "Option::is_none")] pub service_url: Option, @@ -16957,7 +17273,7 @@ pub struct OracleServiceCloudLinkedServiceTypeProperties { #[doc = "The user name that you use to access Oracle Service Cloud server."] pub username: serde_json::Value, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -16972,7 +17288,7 @@ pub struct OracleServiceCloudLinkedServiceTypeProperties { pub encrypted_credential: Option, } impl OracleServiceCloudLinkedServiceTypeProperties { - pub fn new(host: serde_json::Value, username: serde_json::Value, password: SecretBase) -> Self { + pub fn new(host: serde_json::Value, username: serde_json::Value, password: SecretBaseUnion) -> Self { Self { host, username, @@ -17168,13 +17484,13 @@ impl OrcDataset { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrcDatasetTypeProperties { #[doc = "Dataset location."] - pub location: DatasetLocation, + pub location: DatasetLocationUnion, #[doc = "The data orcCompressionCodec. Type: string (or Expression with resultType string)."] #[serde(rename = "orcCompressionCodec", default, skip_serializing_if = "Option::is_none")] pub orc_compression_codec: Option, } impl OrcDatasetTypeProperties { - pub fn new(location: DatasetLocation) -> Self { + pub fn new(location: DatasetLocationUnion) -> Self { Self { location, orc_compression_codec: None, @@ -17199,7 +17515,7 @@ pub struct OrcSink { pub copy_sink: CopySink, #[doc = "Connector write settings."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Orc write settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] pub format_settings: Option, @@ -17220,7 +17536,7 @@ pub struct OrcSource { pub copy_source: CopySource, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Specifies the additional columns to be added to source data. Type: array of objects(AdditionalColumns) (or Expression with resultType array of objects)."] #[serde(rename = "additionalColumns", default, skip_serializing_if = "Option::is_none")] pub additional_columns: Option, @@ -17397,13 +17713,13 @@ impl ParquetDataset { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ParquetDatasetTypeProperties { #[doc = "Dataset location."] - pub location: DatasetLocation, + pub location: DatasetLocationUnion, #[doc = "The data compressionCodec. Type: string (or Expression with resultType string)."] #[serde(rename = "compressionCodec", default, skip_serializing_if = "Option::is_none")] pub compression_codec: Option, } impl ParquetDatasetTypeProperties { - pub fn new(location: DatasetLocation) -> Self { + pub fn new(location: DatasetLocationUnion) -> Self { Self { location, compression_codec: None, @@ -17428,7 +17744,7 @@ pub struct ParquetSink { pub copy_sink: CopySink, #[doc = "Connector write settings."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Parquet write settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] pub format_settings: Option, @@ -17449,7 +17765,7 @@ pub struct ParquetSource { pub copy_source: CopySource, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Specifies the additional columns to be added to source data. Type: array of objects(AdditionalColumns) (or Expression with resultType array of objects)."] #[serde(rename = "additionalColumns", default, skip_serializing_if = "Option::is_none")] pub additional_columns: Option, @@ -17511,7 +17827,7 @@ pub struct PaypalLinkedServiceTypeProperties { pub client_id: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -17626,7 +17942,7 @@ pub struct PhoenixLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Specifies whether the connections to the server are encrypted using SSL. The default value is false."] #[serde(rename = "enableSsl", default, skip_serializing_if = "Option::is_none")] pub enable_ssl: Option, @@ -17755,7 +18071,7 @@ pub struct Pipeline { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub activities: Vec, + pub activities: Vec, #[doc = "Definition of all parameters for an entity."] #[serde(default, skip_serializing_if = "Option::is_none")] pub parameters: Option, @@ -18282,7 +18598,7 @@ pub struct PrestoLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Specifies whether the connections to the server are encrypted using SSL. The default value is false."] #[serde(rename = "enableSsl", default, skip_serializing_if = "Option::is_none")] pub enable_ssl: Option, @@ -18621,13 +18937,13 @@ pub struct QuickBooksLinkedServiceTypeProperties { pub consumer_key: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "consumerSecret", default, skip_serializing_if = "Option::is_none")] - pub consumer_secret: Option, + pub consumer_secret: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, + pub access_token: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "accessTokenSecret", default, skip_serializing_if = "Option::is_none")] - pub access_token_secret: Option, + pub access_token_secret: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -18698,13 +19014,13 @@ pub struct QuickbaseLinkedServiceTypeProperties { pub url: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "userToken")] - pub user_token: SecretBase, + pub user_token: SecretBaseUnion, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, } impl QuickbaseLinkedServiceTypeProperties { - pub fn new(url: serde_json::Value, user_token: SecretBase) -> Self { + pub fn new(url: serde_json::Value, user_token: SecretBaseUnion) -> Self { Self { url, user_token, @@ -19026,7 +19342,7 @@ pub struct ResponsysLinkedServiceTypeProperties { pub client_id: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -19161,7 +19477,7 @@ pub struct RestServiceLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The additional HTTP headers in the request to RESTful API used for authorization. Type: object (or Expression with resultType object)."] #[serde(rename = "authHeaders", default, skip_serializing_if = "Option::is_none")] pub auth_headers: Option, @@ -19170,7 +19486,7 @@ pub struct RestServiceLinkedServiceTypeProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "The tenant information (domain name or tenant ID) used in AadServicePrincipal authentication type under which your application resides. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, @@ -19191,7 +19507,7 @@ pub struct RestServiceLinkedServiceTypeProperties { pub client_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "The token endpoint of the authorization server to acquire access token. Type: string (or Expression with resultType string)."] #[serde(rename = "tokenEndpoint", default, skip_serializing_if = "Option::is_none")] pub token_endpoint: Option, @@ -19632,10 +19948,10 @@ pub struct SsisAccessCredential { #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, } impl SsisAccessCredential { - pub fn new(domain: serde_json::Value, user_name: serde_json::Value, password: SecretBase) -> Self { + pub fn new(domain: serde_json::Value, user_name: serde_json::Value, password: SecretBaseUnion) -> Self { Self { domain, user_name, @@ -19851,7 +20167,7 @@ pub mod ssis_package_location { pub struct SsisPackageLocationTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "packagePassword", default, skip_serializing_if = "Option::is_none")] - pub package_password: Option, + pub package_password: Option, #[doc = "SSIS access credential."] #[serde(rename = "accessCredential", default, skip_serializing_if = "Option::is_none")] pub access_credential: Option, @@ -19926,10 +20242,10 @@ pub struct SalesforceLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "securityToken", default, skip_serializing_if = "Option::is_none")] - pub security_token: Option, + pub security_token: Option, #[doc = "The Salesforce API version used in ADF. Type: string (or Expression with resultType string)."] #[serde(rename = "apiVersion", default, skip_serializing_if = "Option::is_none")] pub api_version: Option, @@ -19970,7 +20286,7 @@ pub struct SalesforceMarketingCloudLinkedServiceTypeProperties { pub client_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -20080,10 +20396,10 @@ pub struct SalesforceServiceCloudLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "securityToken", default, skip_serializing_if = "Option::is_none")] - pub security_token: Option, + pub security_token: Option, #[doc = "The Salesforce API version used in ADF. Type: string (or Expression with resultType string)."] #[serde(rename = "apiVersion", default, skip_serializing_if = "Option::is_none")] pub api_version: Option, @@ -20374,7 +20690,7 @@ pub struct SapBwLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -20446,7 +20762,7 @@ pub struct SapCloudForCustomerLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Either encryptedCredential or username/password must be provided. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -20595,7 +20911,7 @@ pub struct SapEccLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Either encryptedCredential or username/password must be provided. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -20690,7 +21006,7 @@ pub struct SapHanaLinkedServiceProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -20894,7 +21210,7 @@ pub struct SapOdpLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The hostname of the SAP Message Server. Type: string (or Expression with resultType string)."] #[serde(rename = "messageServer", default, skip_serializing_if = "Option::is_none")] pub message_server: Option, @@ -21031,7 +21347,7 @@ pub struct SapOpenHubLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The hostname of the SAP Message Server. Type: string (or Expression with resultType string)."] #[serde(rename = "messageServer", default, skip_serializing_if = "Option::is_none")] pub message_server: Option, @@ -21155,7 +21471,7 @@ pub struct SapTableLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The hostname of the SAP Message Server. Type: string (or Expression with resultType string)."] #[serde(rename = "messageServer", default, skip_serializing_if = "Option::is_none")] pub message_server: Option, @@ -21713,6 +22029,12 @@ impl SecretBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretBaseUnion { + AzureKeyVaultSecret(AzureKeyVaultSecretReference), + SecureString(SecureString), +} #[doc = "Execution policy for an activity that supports secure input and output."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecureInputOutputPolicy { @@ -22074,7 +22396,7 @@ pub mod self_hosted_integration_runtime_status_type_properties { pub struct SelfHostedIntegrationRuntimeTypeProperties { #[doc = "The base definition of a linked integration runtime."] #[serde(rename = "linkedInfo", default, skip_serializing_if = "Option::is_none")] - pub linked_info: Option, + pub linked_info: Option, #[doc = "An alternative option to ensure interactive authoring function when your self-hosted integration runtime is unable to establish a connection with Azure Relay."] #[serde( rename = "selfContainedInteractiveAuthoringEnabled", @@ -22118,13 +22440,13 @@ pub struct ServiceNowLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The client id for OAuth2 authentication."] #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] pub client_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -22401,7 +22723,7 @@ pub struct SftpServerLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -22410,10 +22732,10 @@ pub struct SftpServerLinkedServiceTypeProperties { pub private_key_path: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "privateKeyContent", default, skip_serializing_if = "Option::is_none")] - pub private_key_content: Option, + pub private_key_content: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "passPhrase", default, skip_serializing_if = "Option::is_none")] - pub pass_phrase: Option, + pub pass_phrase: Option, #[doc = "If true, skip the SSH host key validation. Default value is false. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "skipHostKeyValidation", default, skip_serializing_if = "Option::is_none")] pub skip_host_key_validation: Option, @@ -22544,7 +22866,7 @@ pub struct SharePointOnlineListLinkedServiceTypeProperties { pub service_principal_id: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey")] - pub service_principal_key: SecretBase, + pub service_principal_key: SecretBaseUnion, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -22554,7 +22876,7 @@ impl SharePointOnlineListLinkedServiceTypeProperties { site_url: serde_json::Value, tenant_id: serde_json::Value, service_principal_id: serde_json::Value, - service_principal_key: SecretBase, + service_principal_key: SecretBaseUnion, ) -> Self { Self { site_url, @@ -22627,7 +22949,7 @@ pub struct ShopifyLinkedServiceTypeProperties { pub host: serde_json::Value, #[doc = "The base definition of a secret type."] #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, + pub access_token: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -22724,13 +23046,13 @@ impl SmartsheetLinkedService { pub struct SmartsheetLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken")] - pub api_token: SecretBase, + pub api_token: SecretBaseUnion, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, } impl SmartsheetLinkedServiceTypeProperties { - pub fn new(api_token: SecretBase) -> Self { + pub fn new(api_token: SecretBaseUnion) -> Self { Self { api_token, encrypted_credential: None, @@ -22998,7 +23320,7 @@ pub struct SparkLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The partial URL corresponding to the Spark server."] #[serde(rename = "httpPath", default, skip_serializing_if = "Option::is_none")] pub http_path: Option, @@ -23217,7 +23539,7 @@ pub struct SqlAlwaysEncryptedProperties { pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] - pub service_principal_key: Option, + pub service_principal_key: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -23589,7 +23911,7 @@ pub struct SqlServerLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -23942,7 +24264,7 @@ pub struct SquareLinkedServiceTypeProperties { pub client_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub client_secret: Option, #[doc = "The redirect URL assigned in the Square application dashboard. (i.e. http://localhost:2500)"] #[serde(rename = "redirectUri", default, skip_serializing_if = "Option::is_none")] pub redirect_uri: Option, @@ -24081,6 +24403,14 @@ impl SsisObjectMetadata { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SsisObjectMetadataUnion { + Environment(SsisEnvironment), + Folder(SsisFolder), + Package(SsisPackage), + Project(SsisProject), +} #[doc = "A list of SSIS object metadata."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SsisObjectMetadataListResponse { @@ -24090,7 +24420,7 @@ pub struct SsisObjectMetadataListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link to the next page of results, if any remaining results exist."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -24352,6 +24682,9 @@ impl StoreReadSettings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum StoreReadSettingsUnion {} #[doc = "Connector write settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StoreWriteSettings { @@ -24378,6 +24711,9 @@ impl StoreWriteSettings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum StoreWriteSettingsUnion {} #[doc = "SQL stored procedure parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StoredProcedureParameter { @@ -24509,7 +24845,7 @@ pub struct SwitchActivityTypeProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub default_activities: Vec, + pub default_activities: Vec, } impl SwitchActivityTypeProperties { pub fn new(on: Expression) -> Self { @@ -24532,7 +24868,7 @@ pub struct SwitchCase { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub activities: Vec, + pub activities: Vec, } impl SwitchCase { pub fn new() -> Self { @@ -24574,7 +24910,7 @@ pub struct SybaseLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -25169,10 +25505,10 @@ pub struct TeamDeskLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken", default, skip_serializing_if = "Option::is_none")] - pub api_token: Option, + pub api_token: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -25263,7 +25599,7 @@ pub struct TeradataLinkedServiceTypeProperties { pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -25535,6 +25871,11 @@ impl Trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TriggerUnion { + MultiplePipelineTrigger(MultiplePipelineTrigger), +} #[doc = "Trigger referenced dependency."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TriggerDependencyReference { @@ -25678,10 +26019,10 @@ pub struct TriggerResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "Azure data factory nested object which contains information about creating pipeline run"] - pub properties: Trigger, + pub properties: TriggerUnion, } impl TriggerResource { - pub fn new(properties: Trigger) -> Self { + pub fn new(properties: TriggerUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -25976,7 +26317,7 @@ pub mod tumbling_window_trigger { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub depends_on: Vec, + pub depends_on: Vec, } impl TypeProperties { pub fn new(frequency: TumblingWindowFrequency, interval: i32, start_time: time::OffsetDateTime, max_concurrency: i64) -> Self { @@ -26038,10 +26379,10 @@ pub struct TwilioLinkedServiceTypeProperties { #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, } impl TwilioLinkedServiceTypeProperties { - pub fn new(user_name: serde_json::Value, password: SecretBase) -> Self { + pub fn new(user_name: serde_json::Value, password: SecretBaseUnion) -> Self { Self { user_name, password } } } @@ -26098,10 +26439,10 @@ pub struct UntilActivityTypeProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub timeout: Option, #[doc = "List of activities to execute."] - pub activities: Vec, + pub activities: Vec, } impl UntilActivityTypeProperties { - pub fn new(expression: Expression, activities: Vec) -> Self { + pub fn new(expression: Expression, activities: Vec) -> Self { Self { expression, timeout: None, @@ -26444,13 +26785,13 @@ pub struct WebActivityAuthentication { pub type_: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub pfx: Option, + pub pfx: Option, #[doc = "Web activity authentication user name for basic authentication or ClientID when used for ServicePrincipal. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "Resource for which Azure Auth token will be requested when using MSI Authentication. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub resource: Option, @@ -26585,13 +26926,13 @@ pub struct WebBasicAuthentication { #[doc = "User name for Basic authentication. Type: string (or Expression with resultType string)."] pub username: serde_json::Value, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, } impl WebBasicAuthentication { pub fn new( web_linked_service_type_properties: WebLinkedServiceTypeProperties, username: serde_json::Value, - password: SecretBase, + password: SecretBaseUnion, ) -> Self { Self { web_linked_service_type_properties, @@ -26606,12 +26947,16 @@ pub struct WebClientCertificateAuthentication { #[serde(flatten)] pub web_linked_service_type_properties: WebLinkedServiceTypeProperties, #[doc = "The base definition of a secret type."] - pub pfx: SecretBase, + pub pfx: SecretBaseUnion, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, } impl WebClientCertificateAuthentication { - pub fn new(web_linked_service_type_properties: WebLinkedServiceTypeProperties, pfx: SecretBase, password: SecretBase) -> Self { + pub fn new( + web_linked_service_type_properties: WebLinkedServiceTypeProperties, + pfx: SecretBaseUnion, + password: SecretBaseUnion, + ) -> Self { Self { web_linked_service_type_properties, pfx, @@ -26715,10 +27060,10 @@ pub struct WebLinkedService { pub linked_service: LinkedService, #[doc = "Base definition of WebLinkedServiceTypeProperties, this typeProperties is polymorphic based on authenticationType, so not flattened in SDK models."] #[serde(rename = "typeProperties")] - pub type_properties: WebLinkedServiceTypeProperties, + pub type_properties: WebLinkedServiceTypePropertiesUnion, } impl WebLinkedService { - pub fn new(linked_service: LinkedService, type_properties: WebLinkedServiceTypeProperties) -> Self { + pub fn new(linked_service: LinkedService, type_properties: WebLinkedServiceTypePropertiesUnion) -> Self { Self { linked_service, type_properties, @@ -26781,6 +27126,13 @@ pub mod web_linked_service_type_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authenticationType")] +pub enum WebLinkedServiceTypePropertiesUnion { + Anonymous(WebAnonymousAuthentication), + Basic(WebBasicAuthentication), + ClientCertificate(WebClientCertificateAuthentication), +} #[doc = "A copy activity source for web page table."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WebSource { @@ -26871,10 +27223,10 @@ pub struct XeroLinkedServiceTypeProperties { pub host: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "consumerKey", default, skip_serializing_if = "Option::is_none")] - pub consumer_key: Option, + pub consumer_key: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "privateKey", default, skip_serializing_if = "Option::is_none")] - pub private_key: Option, + pub private_key: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, @@ -26948,7 +27300,7 @@ impl XmlDataset { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct XmlDatasetTypeProperties { #[doc = "Dataset location."] - pub location: DatasetLocation, + pub location: DatasetLocationUnion, #[doc = "The code page name of the preferred encoding. If not specified, the default value is UTF-8, unless BOM denotes another Unicode encoding. Refer to the name column of the table in the following link to set supported values: https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: string (or Expression with resultType string)."] #[serde(rename = "encodingName", default, skip_serializing_if = "Option::is_none")] pub encoding_name: Option, @@ -26960,7 +27312,7 @@ pub struct XmlDatasetTypeProperties { pub compression: Option, } impl XmlDatasetTypeProperties { - pub fn new(location: DatasetLocation) -> Self { + pub fn new(location: DatasetLocationUnion) -> Self { Self { location, encoding_name: None, @@ -26976,7 +27328,7 @@ pub struct XmlReadSettings { pub format_read_settings: FormatReadSettings, #[doc = "Compression read settings."] #[serde(rename = "compressionProperties", default, skip_serializing_if = "Option::is_none")] - pub compression_properties: Option, + pub compression_properties: Option, #[doc = "Indicates what validation method is used when reading the xml files. Allowed values: 'none', 'xsd', or 'dtd'. Type: string (or Expression with resultType string)."] #[serde(rename = "validationMode", default, skip_serializing_if = "Option::is_none")] pub validation_mode: Option, @@ -27009,7 +27361,7 @@ pub struct XmlSource { pub copy_source: CopySource, #[doc = "Connector read setting."] #[serde(rename = "storeSettings", default, skip_serializing_if = "Option::is_none")] - pub store_settings: Option, + pub store_settings: Option, #[doc = "Xml read settings."] #[serde(rename = "formatSettings", default, skip_serializing_if = "Option::is_none")] pub format_settings: Option, @@ -27057,10 +27409,10 @@ pub struct ZendeskLinkedServiceTypeProperties { pub user_name: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, + pub password: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken", default, skip_serializing_if = "Option::is_none")] - pub api_token: Option, + pub api_token: Option, #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, @@ -27162,7 +27514,7 @@ pub struct ZohoLinkedServiceTypeProperties { pub endpoint: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, + pub access_token: Option, #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, diff --git a/services/mgmt/datamigration/src/package_2018_04_19/models.rs b/services/mgmt/datamigration/src/package_2018_04_19/models.rs index ec440fca5d..f85045c871 100644 --- a/services/mgmt/datamigration/src/package_2018_04_19/models.rs +++ b/services/mgmt/datamigration/src/package_2018_04_19/models.rs @@ -471,6 +471,14 @@ pub mod command_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "commandType")] +pub enum CommandPropertiesUnion { + #[serde(rename = "Migrate.SqlServer.AzureDbSqlMi.Complete")] + MigrateSqlServerAzureDbSqlMiComplete(MigrateMiSyncCompleteCommandProperties), + #[serde(rename = "Migrate.Sync.Complete.Database")] + MigrateSyncCompleteDatabase(MigrateSyncCompleteCommandProperties), +} #[doc = "Input for the task that validates MySQL database connection"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToSourceMySqlTaskInput { @@ -635,7 +643,7 @@ pub struct ConnectToSourceSqlServerSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl ConnectToSourceSqlServerSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -687,6 +695,14 @@ impl ConnectToSourceSqlServerTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum ConnectToSourceSqlServerTaskOutputUnion { + AgentJobLevelOutput(ConnectToSourceSqlServerTaskOutputAgentJobLevel), + DatabaseLevelOutput(ConnectToSourceSqlServerTaskOutputDatabaseLevel), + LoginLevelOutput(ConnectToSourceSqlServerTaskOutputLoginLevel), + TaskLevelOutput(ConnectToSourceSqlServerTaskOutputTaskLevel), +} #[doc = "AgentJob level output for the task that validates connection to SQL Server and also validates source server requirements"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToSourceSqlServerTaskOutputAgentJobLevel { @@ -851,7 +867,7 @@ pub struct ConnectToSourceSqlServerTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl ConnectToSourceSqlServerTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -1281,6 +1297,14 @@ impl ConnectionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ConnectionInfoUnion { + MiSqlConnectionInfo(MiSqlConnectionInfo), + MySqlConnectionInfo(MySqlConnectionInfo), + PostgreSqlConnectionInfo(PostgreSqlConnectionInfo), + SqlConnectionInfo(SqlConnectionInfo), +} #[doc = "Results for checksum based Data Integrity validation results"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataIntegrityValidationResult { @@ -2611,6 +2635,15 @@ impl MigrateMySqlAzureDbForMySqlSyncTaskOutput { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateMySqlAzureDbForMySqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputError), + MigrationLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -2790,7 +2823,7 @@ pub struct MigrateMySqlAzureDbForMySqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMySqlAzureDbForMySqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -2866,6 +2899,15 @@ impl MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError), + MigrationLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -3045,7 +3087,7 @@ pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3146,6 +3188,15 @@ impl MigrateSqlServerSqlDbSyncTaskOutput { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrateSqlServerSqlDbSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -3328,7 +3379,7 @@ pub struct MigrateSqlServerSqlDbSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlDbSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3375,6 +3426,16 @@ impl MigrateSqlServerSqlDbTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevel), + MigrationDatabaseLevelValidationOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult), + ErrorOutput(MigrateSqlServerSqlDbTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbTaskOutputTableLevel), + MigrationValidationOutput(MigrateSqlServerSqlDbTaskOutputValidationResult), +} #[doc = "Database level result for Sql Server to Azure Sql DB migration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlDbTaskOutputDatabaseLevel { @@ -3681,7 +3742,7 @@ pub struct MigrateSqlServerSqlDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlDbTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3750,6 +3811,13 @@ impl MigrateSqlServerSqlMiSyncTaskOutput { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiSyncTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel { #[serde(flatten)] @@ -3876,7 +3944,7 @@ pub struct MigrateSqlServerSqlMiSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlMiSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3953,6 +4021,15 @@ impl MigrateSqlServerSqlMiTaskOutput { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiTaskOutputUnion { + AgentJobLevelOutput(MigrateSqlServerSqlMiTaskOutputAgentJobLevel), + DatabaseLevelOutput(MigrateSqlServerSqlMiTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiTaskOutputError), + LoginLevelOutput(MigrateSqlServerSqlMiTaskOutputLoginLevel), + MigrationLevelOutput(MigrateSqlServerSqlMiTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrateSqlServerSqlMiTaskOutputAgentJobLevel { #[serde(flatten)] @@ -4159,7 +4236,7 @@ pub struct MigrateSqlServerSqlMiTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlMiTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -4863,10 +4940,10 @@ pub struct ProjectProperties { pub creation_time: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "sourceConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub source_connection_info: Option, + pub source_connection_info: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "targetConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub target_connection_info: Option, + pub target_connection_info: Option, #[doc = "List of DatabaseInfo"] #[serde( rename = "databasesInfo", @@ -5018,7 +5095,7 @@ pub struct ProjectTask { pub etag: Option, #[doc = "Base class for all types of DMS task properties. If task is not supported by current client, this object is returned."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProjectTask { pub fn new() -> Self { @@ -5047,7 +5124,7 @@ pub struct ProjectTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub commands: Vec, + pub commands: Vec, } impl ProjectTaskProperties { pub fn new(task_type: String) -> Self { @@ -5111,6 +5188,54 @@ pub mod project_task_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "taskType")] +pub enum ProjectTaskPropertiesUnion { + #[serde(rename = "ConnectToSource.MySql")] + ConnectToSourceMySql(ConnectToSourceMySqlTaskProperties), + #[serde(rename = "ConnectToSource.PostgreSql.Sync")] + ConnectToSourcePostgreSqlSync(ConnectToSourcePostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer.Sync")] + ConnectToSourceSqlServerSync(ConnectToSourceSqlServerSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer")] + ConnectToSourceSqlServer(ConnectToSourceSqlServerTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForMySql")] + ConnectToTargetAzureDbForMySql(ConnectToTargetAzureDbForMySqlTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForPostgreSql.Sync")] + ConnectToTargetAzureDbForPostgreSqlSync(ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb")] + ConnectToTargetSqlDb(ConnectToTargetSqlDbTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI.Sync.LRS")] + ConnectToTargetAzureSqlDbMiSyncLrs(ConnectToTargetSqlMiSyncTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI")] + ConnectToTargetAzureSqlDbMi(ConnectToTargetSqlMiTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb.Sync")] + ConnectToTargetSqlDbSync(ConnectToTargetSqlSqlDbSyncTaskProperties), + #[serde(rename = "GetTDECertificates.Sql")] + GetTdeCertificatesSql(GetTdeCertificatesSqlTaskProperties), + #[serde(rename = "GetUserTables.AzureSqlDb.Sync")] + GetUserTablesAzureSqlDbSync(GetUserTablesSqlSyncTaskProperties), + #[serde(rename = "GetUserTables.Sql")] + GetUserTablesSql(GetUserTablesSqlTaskProperties), + #[serde(rename = "Migrate.MySql.AzureDbForMySql.Sync")] + MigrateMySqlAzureDbForMySqlSync(MigrateMySqlAzureDbForMySqlSyncTaskProperties), + #[serde(rename = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync")] + MigratePostgreSqlAzureDbForPostgreSqlSync(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDb.Sync")] + MigrateSqlServerAzureSqlDbSync(MigrateSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.SqlDb")] + MigrateSqlServerSqlDb(MigrateSqlServerSqlDbTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS")] + MigrateSqlServerAzureSqlDbMiSyncLrs(MigrateSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI")] + MigrateSqlServerAzureSqlDbMi(MigrateSqlServerSqlMiTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.SqlDb.Sync")] + ValidateMigrationInputSqlServerSqlDbSync(ValidateMigrationInputSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS")] + ValidateMigrationInputSqlServerAzureSqlDbMiSyncLrs(ValidateMigrationInputSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI")] + ValidateMigrationInputSqlServerAzureSqlDbMi(ValidateMigrationInputSqlServerSqlMiTaskProperties), +} #[doc = "Results for query analysis comparison between the source and target"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryAnalysisValidationResult { diff --git a/services/mgmt/datamigration/src/package_2021_06/mod.rs b/services/mgmt/datamigration/src/package_2021_06/mod.rs index 1e9aa410e5..900e7195eb 100644 --- a/services/mgmt/datamigration/src/package_2021_06/mod.rs +++ b/services/mgmt/datamigration/src/package_2021_06/mod.rs @@ -2070,7 +2070,7 @@ pub mod tasks { service_name: impl Into, project_name: impl Into, task_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> command::RequestBuilder { command::RequestBuilder { client: self.0.clone(), @@ -2797,9 +2797,9 @@ pub mod tasks { #[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::CommandProperties = serde_json::from_slice(&bytes)?; + let body: models::CommandPropertiesUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2845,7 +2845,7 @@ pub mod tasks { pub(crate) service_name: String, pub(crate) project_name: String, pub(crate) task_name: String, - pub(crate) parameters: models::CommandProperties, + pub(crate) parameters: models::CommandPropertiesUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2890,8 +2890,8 @@ pub mod tasks { } } 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`."] diff --git a/services/mgmt/datamigration/src/package_2021_06/models.rs b/services/mgmt/datamigration/src/package_2021_06/models.rs index 6e7ee89424..449d407ec7 100644 --- a/services/mgmt/datamigration/src/package_2021_06/models.rs +++ b/services/mgmt/datamigration/src/package_2021_06/models.rs @@ -531,6 +531,20 @@ pub mod command_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "commandType")] +pub enum CommandPropertiesUnion { + #[serde(rename = "Migrate.SqlServer.AzureDbSqlMi.Complete")] + MigrateSqlServerAzureDbSqlMiComplete(MigrateMiSyncCompleteCommandProperties), + #[serde(rename = "Migrate.Sync.Complete.Database")] + MigrateSyncCompleteDatabase(MigrateSyncCompleteCommandProperties), + #[serde(rename = "cancel")] + Cancel(MongoDbCancelCommand), + #[serde(rename = "finish")] + Finish(MongoDbFinishCommand), + #[serde(rename = "restart")] + Restart(MongoDbRestartCommand), +} #[doc = "Properties for the task that validates the connection to and provides information about a MongoDB server"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToMongoDbTaskProperties { @@ -791,7 +805,7 @@ pub struct ConnectToSourceSqlServerSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl ConnectToSourceSqlServerSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -855,6 +869,14 @@ impl ConnectToSourceSqlServerTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum ConnectToSourceSqlServerTaskOutputUnion { + AgentJobLevelOutput(ConnectToSourceSqlServerTaskOutputAgentJobLevel), + DatabaseLevelOutput(ConnectToSourceSqlServerTaskOutputDatabaseLevel), + LoginLevelOutput(ConnectToSourceSqlServerTaskOutputLoginLevel), + TaskLevelOutput(ConnectToSourceSqlServerTaskOutputTaskLevel), +} #[doc = "Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToSourceSqlServerTaskOutputAgentJobLevel { @@ -1032,7 +1054,7 @@ pub struct ConnectToSourceSqlServerTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl ConnectToSourceSqlServerTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -1555,6 +1577,15 @@ impl ConnectionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ConnectionInfoUnion { + MiSqlConnectionInfo(MiSqlConnectionInfo), + MySqlConnectionInfo(MySqlConnectionInfo), + OracleConnectionInfo(OracleConnectionInfo), + PostgreSqlConnectionInfo(PostgreSqlConnectionInfo), + SqlConnectionInfo(SqlConnectionInfo), +} #[doc = "Results for checksum based Data Integrity validation results"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataIntegrityValidationResult { @@ -3140,7 +3171,7 @@ pub struct MigrateMongoDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMongoDbTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3222,6 +3253,9 @@ impl MigrateMySqlAzureDbForMySqlOfflineTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateMySqlAzureDbForMySqlOfflineTaskOutputUnion {} #[doc = "Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateMySqlAzureDbForMySqlOfflineTaskProperties { @@ -3236,7 +3270,7 @@ pub struct MigrateMySqlAzureDbForMySqlOfflineTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMySqlAzureDbForMySqlOfflineTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3315,6 +3349,15 @@ impl MigrateMySqlAzureDbForMySqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateMySqlAzureDbForMySqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputError), + MigrationLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -3541,7 +3584,7 @@ pub struct MigrateMySqlAzureDbForMySqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMySqlAzureDbForMySqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3566,7 +3609,7 @@ pub struct MigrateOracleAzureDbForPostgreSqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateOracleAzureDbForPostgreSqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3651,6 +3694,15 @@ impl MigrateOracleAzureDbPostgreSqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateOracleAzureDbPostgreSqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputError), + MigrationLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -3948,6 +4000,15 @@ impl MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError), + MigrationLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -4186,7 +4247,7 @@ pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -4247,6 +4308,14 @@ impl MigrateSchemaSqlServerSqlDbTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSchemaSqlServerSqlDbTaskOutputUnion { + DatabaseLevelOutput(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel), + SchemaErrorOutput(MigrateSchemaSqlServerSqlDbTaskOutputError), + MigrationLevelOutput(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel), + ErrorOutput(MigrateSchemaSqlTaskOutputError), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel { #[serde(flatten)] @@ -4373,7 +4442,7 @@ pub struct MigrateSchemaSqlServerSqlDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSchemaSqlServerSqlDbTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -4490,6 +4559,15 @@ impl MigrateSqlServerSqlDbSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlDbSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -4720,7 +4798,7 @@ pub struct MigrateSqlServerSqlDbSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlDbSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -4767,6 +4845,16 @@ impl MigrateSqlServerSqlDbTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevel), + MigrationDatabaseLevelValidationOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult), + ErrorOutput(MigrateSqlServerSqlDbTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbTaskOutputTableLevel), + MigrationValidationOutput(MigrateSqlServerSqlDbTaskOutputValidationResult), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlDbTaskOutputDatabaseLevel { #[serde(flatten)] @@ -5029,7 +5117,7 @@ pub struct MigrateSqlServerSqlDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlDbTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -5098,6 +5186,13 @@ impl MigrateSqlServerSqlMiSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiSyncTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel { #[serde(flatten)] @@ -5254,7 +5349,7 @@ pub struct MigrateSqlServerSqlMiSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlMiSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -5335,6 +5430,15 @@ impl MigrateSqlServerSqlMiTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiTaskOutputUnion { + AgentJobLevelOutput(MigrateSqlServerSqlMiTaskOutputAgentJobLevel), + DatabaseLevelOutput(MigrateSqlServerSqlMiTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiTaskOutputError), + LoginLevelOutput(MigrateSqlServerSqlMiTaskOutputLoginLevel), + MigrationLevelOutput(MigrateSqlServerSqlMiTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlMiTaskOutputAgentJobLevel { #[serde(flatten)] @@ -5590,7 +5694,7 @@ pub struct MigrateSqlServerSqlMiTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlMiTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -5659,6 +5763,12 @@ impl MigrateSsisTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSsisTaskOutputUnion { + MigrationLevelOutput(MigrateSsisTaskOutputMigrationLevel), + SsisProjectLevelOutput(MigrateSsisTaskOutputProjectLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSsisTaskOutputMigrationLevel { #[serde(flatten)] @@ -5779,7 +5889,7 @@ pub struct MigrateSsisTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSsisTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -6702,6 +6812,13 @@ pub mod mongo_db_progress { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MongoDbProgressUnion { + Collection(MongoDbCollectionProgress), + Database(MongoDbDatabaseProgress), + Migration(MongoDbMigrationProgress), +} #[doc = "Properties for the command that restarts a migration in whole or in part"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MongoDbRestartCommand { @@ -7340,10 +7457,10 @@ pub struct ProjectProperties { pub creation_time: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "sourceConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub source_connection_info: Option, + pub source_connection_info: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "targetConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub target_connection_info: Option, + pub target_connection_info: Option, #[doc = "List of DatabaseInfo"] #[serde( rename = "databasesInfo", @@ -7511,7 +7628,7 @@ pub struct ProjectTask { pub etag: Option, #[doc = "Base class for all types of DMS task properties. If task is not supported by current client, this object is returned."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: 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, @@ -7543,7 +7660,7 @@ pub struct ProjectTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub commands: Vec, + pub commands: Vec, #[doc = "Key value pairs of client data to attach meta data information to task"] #[serde(rename = "clientData", default, skip_serializing_if = "Option::is_none")] pub client_data: Option, @@ -7611,6 +7728,82 @@ pub mod project_task_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "taskType")] +pub enum ProjectTaskPropertiesUnion { + #[serde(rename = "Service.Check.OCI")] + ServiceCheckOci(CheckOciDriverTaskProperties), + #[serde(rename = "Connect.MongoDb")] + ConnectMongoDb(ConnectToMongoDbTaskProperties), + #[serde(rename = "ConnectToSource.MySql")] + ConnectToSourceMySql(ConnectToSourceMySqlTaskProperties), + #[serde(rename = "ConnectToSource.Oracle.Sync")] + ConnectToSourceOracleSync(ConnectToSourceOracleSyncTaskProperties), + #[serde(rename = "ConnectToSource.PostgreSql.Sync")] + ConnectToSourcePostgreSqlSync(ConnectToSourcePostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer.Sync")] + ConnectToSourceSqlServerSync(ConnectToSourceSqlServerSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer")] + ConnectToSourceSqlServer(ConnectToSourceSqlServerTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForMySql")] + ConnectToTargetAzureDbForMySql(ConnectToTargetAzureDbForMySqlTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForPostgreSql.Sync")] + ConnectToTargetAzureDbForPostgreSqlSync(ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync")] + ConnectToTargetOracleAzureDbForPostgreSqlSync(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb")] + ConnectToTargetSqlDb(ConnectToTargetSqlDbTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI.Sync.LRS")] + ConnectToTargetAzureSqlDbMiSyncLrs(ConnectToTargetSqlMiSyncTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI")] + ConnectToTargetAzureSqlDbMi(ConnectToTargetSqlMiTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb.Sync")] + ConnectToTargetSqlDbSync(ConnectToTargetSqlSqlDbSyncTaskProperties), + #[serde(rename = "GetTDECertificates.Sql")] + GetTdeCertificatesSql(GetTdeCertificatesSqlTaskProperties), + GetUserTablesMySql(GetUserTablesMySqlTaskProperties), + GetUserTablesOracle(GetUserTablesOracleTaskProperties), + GetUserTablesPostgreSql(GetUserTablesPostgreSqlTaskProperties), + #[serde(rename = "GetUserTables.AzureSqlDb.Sync")] + GetUserTablesAzureSqlDbSync(GetUserTablesSqlSyncTaskProperties), + #[serde(rename = "GetUserTables.Sql")] + GetUserTablesSql(GetUserTablesSqlTaskProperties), + #[serde(rename = "Service.Install.OCI")] + ServiceInstallOci(InstallOciDriverTaskProperties), + #[serde(rename = "Migrate.MongoDb")] + MigrateMongoDb(MigrateMongoDbTaskProperties), + #[serde(rename = "Migrate.MySql.AzureDbForMySql")] + MigrateMySqlAzureDbForMySql(MigrateMySqlAzureDbForMySqlOfflineTaskProperties), + #[serde(rename = "Migrate.MySql.AzureDbForMySql.Sync")] + MigrateMySqlAzureDbForMySqlSync(MigrateMySqlAzureDbForMySqlSyncTaskProperties), + #[serde(rename = "Migrate.Oracle.AzureDbForPostgreSql.Sync")] + MigrateOracleAzureDbForPostgreSqlSync(MigrateOracleAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2")] + MigratePostgreSqlAzureDbForPostgreSqlSyncV2(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties), + MigrateSchemaSqlServerSqlDb(MigrateSchemaSqlServerSqlDbTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDb.Sync")] + MigrateSqlServerAzureSqlDbSync(MigrateSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.SqlDb")] + MigrateSqlServerSqlDb(MigrateSqlServerSqlDbTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS")] + MigrateSqlServerAzureSqlDbMiSyncLrs(MigrateSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI")] + MigrateSqlServerAzureSqlDbMi(MigrateSqlServerSqlMiTaskProperties), + #[serde(rename = "Migrate.Ssis")] + MigrateSsis(MigrateSsisTaskProperties), + #[serde(rename = "Service.Upload.OCI")] + ServiceUploadOci(UploadOciDriverTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.SqlDb.Sync")] + ValidateMigrationInputSqlServerSqlDbSync(ValidateMigrationInputSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS")] + ValidateMigrationInputSqlServerAzureSqlDbMiSyncLrs(ValidateMigrationInputSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI")] + ValidateMigrationInputSqlServerAzureSqlDbMi(ValidateMigrationInputSqlServerSqlMiTaskProperties), + #[serde(rename = "Validate.MongoDb")] + ValidateMongoDb(ValidateMongoDbTaskProperties), + #[serde(rename = "Validate.Oracle.AzureDbPostgreSql.Sync")] + ValidateOracleAzureDbPostgreSqlSync(ValidateOracleAzureDbForPostgreSqlSyncTaskProperties), +} #[doc = "Results for query analysis comparison between the source and target"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryAnalysisValidationResult { diff --git a/services/mgmt/datamigration/src/package_preview_2021_10/mod.rs b/services/mgmt/datamigration/src/package_preview_2021_10/mod.rs index 574ae5d86b..9f9a8986ac 100644 --- a/services/mgmt/datamigration/src/package_preview_2021_10/mod.rs +++ b/services/mgmt/datamigration/src/package_preview_2021_10/mod.rs @@ -4777,7 +4777,7 @@ pub mod tasks { service_name: impl Into, project_name: impl Into, task_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> command::RequestBuilder { command::RequestBuilder { client: self.0.clone(), @@ -5504,9 +5504,9 @@ pub mod tasks { #[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::CommandProperties = serde_json::from_slice(&bytes)?; + let body: models::CommandPropertiesUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5552,7 +5552,7 @@ pub mod tasks { pub(crate) service_name: String, pub(crate) project_name: String, pub(crate) task_name: String, - pub(crate) parameters: models::CommandProperties, + pub(crate) parameters: models::CommandPropertiesUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5597,8 +5597,8 @@ pub mod tasks { } } 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`."] diff --git a/services/mgmt/datamigration/src/package_preview_2021_10/models.rs b/services/mgmt/datamigration/src/package_preview_2021_10/models.rs index 1b989968bc..85ccf646e4 100644 --- a/services/mgmt/datamigration/src/package_preview_2021_10/models.rs +++ b/services/mgmt/datamigration/src/package_preview_2021_10/models.rs @@ -630,6 +630,20 @@ pub mod command_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "commandType")] +pub enum CommandPropertiesUnion { + #[serde(rename = "Migrate.SqlServer.AzureDbSqlMi.Complete")] + MigrateSqlServerAzureDbSqlMiComplete(MigrateMiSyncCompleteCommandProperties), + #[serde(rename = "Migrate.Sync.Complete.Database")] + MigrateSyncCompleteDatabase(MigrateSyncCompleteCommandProperties), + #[serde(rename = "cancel")] + Cancel(MongoDbCancelCommand), + #[serde(rename = "finish")] + Finish(MongoDbFinishCommand), + #[serde(rename = "restart")] + Restart(MongoDbRestartCommand), +} #[doc = "Properties for the task that validates the connection to and provides information about a MongoDB server"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToMongoDbTaskProperties { @@ -890,7 +904,7 @@ pub struct ConnectToSourceSqlServerSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl ConnectToSourceSqlServerSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -954,6 +968,14 @@ impl ConnectToSourceSqlServerTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum ConnectToSourceSqlServerTaskOutputUnion { + AgentJobLevelOutput(ConnectToSourceSqlServerTaskOutputAgentJobLevel), + DatabaseLevelOutput(ConnectToSourceSqlServerTaskOutputDatabaseLevel), + LoginLevelOutput(ConnectToSourceSqlServerTaskOutputLoginLevel), + TaskLevelOutput(ConnectToSourceSqlServerTaskOutputTaskLevel), +} #[doc = "Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToSourceSqlServerTaskOutputAgentJobLevel { @@ -1131,7 +1153,7 @@ pub struct ConnectToSourceSqlServerTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl ConnectToSourceSqlServerTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -1654,6 +1676,15 @@ impl ConnectionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ConnectionInfoUnion { + MiSqlConnectionInfo(MiSqlConnectionInfo), + MySqlConnectionInfo(MySqlConnectionInfo), + OracleConnectionInfo(OracleConnectionInfo), + PostgreSqlConnectionInfo(PostgreSqlConnectionInfo), + SqlConnectionInfo(SqlConnectionInfo), +} #[doc = "Results for checksum based Data Integrity validation results"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataIntegrityValidationResult { @@ -2180,7 +2211,7 @@ pub struct DatabaseMigration { pub system_data: Option, #[doc = "Database Migration Resource properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl DatabaseMigration { pub fn new() -> Self { @@ -2301,6 +2332,12 @@ pub mod database_migration_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DatabaseMigrationPropertiesUnion { + SqlMi(DatabaseMigrationPropertiesSqlMi), + SqlVm(DatabaseMigrationPropertiesSqlVm), +} #[doc = "Database Migration Resource properties for SQL Managed Instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatabaseMigrationPropertiesSqlMi { @@ -3494,7 +3531,7 @@ pub struct MigrateMongoDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMongoDbTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3576,6 +3613,9 @@ impl MigrateMySqlAzureDbForMySqlOfflineTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateMySqlAzureDbForMySqlOfflineTaskOutputUnion {} #[doc = "Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateMySqlAzureDbForMySqlOfflineTaskProperties { @@ -3590,7 +3630,7 @@ pub struct MigrateMySqlAzureDbForMySqlOfflineTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMySqlAzureDbForMySqlOfflineTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3669,6 +3709,15 @@ impl MigrateMySqlAzureDbForMySqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateMySqlAzureDbForMySqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputError), + MigrationLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -3895,7 +3944,7 @@ pub struct MigrateMySqlAzureDbForMySqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMySqlAzureDbForMySqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3920,7 +3969,7 @@ pub struct MigrateOracleAzureDbForPostgreSqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateOracleAzureDbForPostgreSqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -4005,6 +4054,15 @@ impl MigrateOracleAzureDbPostgreSqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateOracleAzureDbPostgreSqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputError), + MigrationLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -4306,6 +4364,15 @@ impl MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError), + MigrationLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -4556,7 +4623,7 @@ pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "task id"] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -4636,6 +4703,14 @@ impl MigrateSchemaSqlServerSqlDbTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSchemaSqlServerSqlDbTaskOutputUnion { + DatabaseLevelOutput(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel), + SchemaErrorOutput(MigrateSchemaSqlServerSqlDbTaskOutputError), + MigrationLevelOutput(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel), + ErrorOutput(MigrateSchemaSqlTaskOutputError), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel { #[serde(flatten)] @@ -4762,7 +4837,7 @@ pub struct MigrateSchemaSqlServerSqlDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "DateTime in UTC when the task was created"] #[serde(rename = "createdOn", default, skip_serializing_if = "Option::is_none")] pub created_on: Option, @@ -4893,6 +4968,15 @@ impl MigrateSqlServerSqlDbSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlDbSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -5123,7 +5207,7 @@ pub struct MigrateSqlServerSqlDbSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlDbSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -5178,6 +5262,16 @@ impl MigrateSqlServerSqlDbTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevel), + MigrationDatabaseLevelValidationOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult), + ErrorOutput(MigrateSqlServerSqlDbTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbTaskOutputTableLevel), + MigrationValidationOutput(MigrateSqlServerSqlDbTaskOutputValidationResult), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlDbTaskOutputDatabaseLevel { #[serde(flatten)] @@ -5440,7 +5534,7 @@ pub struct MigrateSqlServerSqlDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "task id"] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -5521,6 +5615,13 @@ impl MigrateSqlServerSqlMiSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiSyncTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel { #[serde(flatten)] @@ -5677,7 +5778,7 @@ pub struct MigrateSqlServerSqlMiSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlMiSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -5762,6 +5863,15 @@ impl MigrateSqlServerSqlMiTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiTaskOutputUnion { + AgentJobLevelOutput(MigrateSqlServerSqlMiTaskOutputAgentJobLevel), + DatabaseLevelOutput(MigrateSqlServerSqlMiTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiTaskOutputError), + LoginLevelOutput(MigrateSqlServerSqlMiTaskOutputLoginLevel), + MigrationLevelOutput(MigrateSqlServerSqlMiTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlMiTaskOutputAgentJobLevel { #[serde(flatten)] @@ -6017,7 +6127,7 @@ pub struct MigrateSqlServerSqlMiTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "task id"] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -6090,6 +6200,12 @@ impl MigrateSsisTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSsisTaskOutputUnion { + MigrationLevelOutput(MigrateSsisTaskOutputMigrationLevel), + SsisProjectLevelOutput(MigrateSsisTaskOutputProjectLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSsisTaskOutputMigrationLevel { #[serde(flatten)] @@ -6210,7 +6326,7 @@ pub struct MigrateSsisTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSsisTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -7231,6 +7347,13 @@ pub mod mongo_db_progress { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MongoDbProgressUnion { + Collection(MongoDbCollectionProgress), + Database(MongoDbDatabaseProgress), + Migration(MongoDbMigrationProgress), +} #[doc = "Properties for the command that restarts a migration in whole or in part"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MongoDbRestartCommand { @@ -8030,10 +8153,10 @@ pub struct ProjectProperties { pub creation_time: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "sourceConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub source_connection_info: Option, + pub source_connection_info: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "targetConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub target_connection_info: Option, + pub target_connection_info: Option, #[doc = "List of DatabaseInfo"] #[serde( rename = "databasesInfo", @@ -8202,7 +8325,7 @@ pub struct ProjectTask { pub etag: Option, #[doc = "Base class for all types of DMS task properties. If task is not supported by current client, this object is returned."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] pub system_data: Option, } @@ -8233,7 +8356,7 @@ pub struct ProjectTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub commands: Vec, + pub commands: Vec, #[doc = "Key value pairs of client data to attach meta data information to task"] #[serde(rename = "clientData", default, skip_serializing_if = "Option::is_none")] pub client_data: Option, @@ -8474,6 +8597,82 @@ pub mod project_task_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "taskType")] +pub enum ProjectTaskPropertiesUnion { + #[serde(rename = "Service.Check.OCI")] + ServiceCheckOci(CheckOciDriverTaskProperties), + #[serde(rename = "Connect.MongoDb")] + ConnectMongoDb(ConnectToMongoDbTaskProperties), + #[serde(rename = "ConnectToSource.MySql")] + ConnectToSourceMySql(ConnectToSourceMySqlTaskProperties), + #[serde(rename = "ConnectToSource.Oracle.Sync")] + ConnectToSourceOracleSync(ConnectToSourceOracleSyncTaskProperties), + #[serde(rename = "ConnectToSource.PostgreSql.Sync")] + ConnectToSourcePostgreSqlSync(ConnectToSourcePostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer.Sync")] + ConnectToSourceSqlServerSync(ConnectToSourceSqlServerSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer")] + ConnectToSourceSqlServer(ConnectToSourceSqlServerTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForMySql")] + ConnectToTargetAzureDbForMySql(ConnectToTargetAzureDbForMySqlTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForPostgreSql.Sync")] + ConnectToTargetAzureDbForPostgreSqlSync(ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync")] + ConnectToTargetOracleAzureDbForPostgreSqlSync(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb")] + ConnectToTargetSqlDb(ConnectToTargetSqlDbTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI.Sync.LRS")] + ConnectToTargetAzureSqlDbMiSyncLrs(ConnectToTargetSqlMiSyncTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI")] + ConnectToTargetAzureSqlDbMi(ConnectToTargetSqlMiTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb.Sync")] + ConnectToTargetSqlDbSync(ConnectToTargetSqlSqlDbSyncTaskProperties), + #[serde(rename = "GetTDECertificates.Sql")] + GetTdeCertificatesSql(GetTdeCertificatesSqlTaskProperties), + GetUserTablesMySql(GetUserTablesMySqlTaskProperties), + GetUserTablesOracle(GetUserTablesOracleTaskProperties), + GetUserTablesPostgreSql(GetUserTablesPostgreSqlTaskProperties), + #[serde(rename = "GetUserTables.AzureSqlDb.Sync")] + GetUserTablesAzureSqlDbSync(GetUserTablesSqlSyncTaskProperties), + #[serde(rename = "GetUserTables.Sql")] + GetUserTablesSql(GetUserTablesSqlTaskProperties), + #[serde(rename = "Service.Install.OCI")] + ServiceInstallOci(InstallOciDriverTaskProperties), + #[serde(rename = "Migrate.MongoDb")] + MigrateMongoDb(MigrateMongoDbTaskProperties), + #[serde(rename = "Migrate.MySql.AzureDbForMySql")] + MigrateMySqlAzureDbForMySql(MigrateMySqlAzureDbForMySqlOfflineTaskProperties), + #[serde(rename = "Migrate.MySql.AzureDbForMySql.Sync")] + MigrateMySqlAzureDbForMySqlSync(MigrateMySqlAzureDbForMySqlSyncTaskProperties), + #[serde(rename = "Migrate.Oracle.AzureDbForPostgreSql.Sync")] + MigrateOracleAzureDbForPostgreSqlSync(MigrateOracleAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2")] + MigratePostgreSqlAzureDbForPostgreSqlSyncV2(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties), + MigrateSchemaSqlServerSqlDb(MigrateSchemaSqlServerSqlDbTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDb.Sync")] + MigrateSqlServerAzureSqlDbSync(MigrateSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.SqlDb")] + MigrateSqlServerSqlDb(MigrateSqlServerSqlDbTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS")] + MigrateSqlServerAzureSqlDbMiSyncLrs(MigrateSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI")] + MigrateSqlServerAzureSqlDbMi(MigrateSqlServerSqlMiTaskProperties), + #[serde(rename = "Migrate.Ssis")] + MigrateSsis(MigrateSsisTaskProperties), + #[serde(rename = "Service.Upload.OCI")] + ServiceUploadOci(UploadOciDriverTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.SqlDb.Sync")] + ValidateMigrationInputSqlServerSqlDbSync(ValidateMigrationInputSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS")] + ValidateMigrationInputSqlServerAzureSqlDbMiSyncLrs(ValidateMigrationInputSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI")] + ValidateMigrationInputSqlServerAzureSqlDbMi(ValidateMigrationInputSqlServerSqlMiTaskProperties), + #[serde(rename = "Validate.MongoDb")] + ValidateMongoDb(ValidateMongoDbTaskProperties), + #[serde(rename = "Validate.Oracle.AzureDbPostgreSql.Sync")] + ValidateOracleAzureDbPostgreSqlSync(ValidateOracleAzureDbForPostgreSqlSyncTaskProperties), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { #[serde(default, skip_serializing_if = "Option::is_none")] diff --git a/services/mgmt/datamigration/src/package_preview_2022_01/mod.rs b/services/mgmt/datamigration/src/package_preview_2022_01/mod.rs index 0ab41cb57d..04fb921ab4 100644 --- a/services/mgmt/datamigration/src/package_preview_2022_01/mod.rs +++ b/services/mgmt/datamigration/src/package_preview_2022_01/mod.rs @@ -4777,7 +4777,7 @@ pub mod tasks { service_name: impl Into, project_name: impl Into, task_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> command::RequestBuilder { command::RequestBuilder { client: self.0.clone(), @@ -5504,9 +5504,9 @@ pub mod tasks { #[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::CommandProperties = serde_json::from_slice(&bytes)?; + let body: models::CommandPropertiesUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5552,7 +5552,7 @@ pub mod tasks { pub(crate) service_name: String, pub(crate) project_name: String, pub(crate) task_name: String, - pub(crate) parameters: models::CommandProperties, + pub(crate) parameters: models::CommandPropertiesUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5597,8 +5597,8 @@ pub mod tasks { } } 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`."] diff --git a/services/mgmt/datamigration/src/package_preview_2022_01/models.rs b/services/mgmt/datamigration/src/package_preview_2022_01/models.rs index 44f60ef6a0..a60c7d1bc8 100644 --- a/services/mgmt/datamigration/src/package_preview_2022_01/models.rs +++ b/services/mgmt/datamigration/src/package_preview_2022_01/models.rs @@ -634,6 +634,20 @@ pub mod command_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "commandType")] +pub enum CommandPropertiesUnion { + #[serde(rename = "Migrate.SqlServer.AzureDbSqlMi.Complete")] + MigrateSqlServerAzureDbSqlMiComplete(MigrateMiSyncCompleteCommandProperties), + #[serde(rename = "Migrate.Sync.Complete.Database")] + MigrateSyncCompleteDatabase(MigrateSyncCompleteCommandProperties), + #[serde(rename = "cancel")] + Cancel(MongoDbCancelCommand), + #[serde(rename = "finish")] + Finish(MongoDbFinishCommand), + #[serde(rename = "restart")] + Restart(MongoDbRestartCommand), +} #[doc = "Properties for the task that validates the connection to and provides information about a MongoDB server"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToMongoDbTaskProperties { @@ -894,7 +908,7 @@ pub struct ConnectToSourceSqlServerSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl ConnectToSourceSqlServerSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -962,6 +976,14 @@ impl ConnectToSourceSqlServerTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum ConnectToSourceSqlServerTaskOutputUnion { + AgentJobLevelOutput(ConnectToSourceSqlServerTaskOutputAgentJobLevel), + DatabaseLevelOutput(ConnectToSourceSqlServerTaskOutputDatabaseLevel), + LoginLevelOutput(ConnectToSourceSqlServerTaskOutputLoginLevel), + TaskLevelOutput(ConnectToSourceSqlServerTaskOutputTaskLevel), +} #[doc = "Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToSourceSqlServerTaskOutputAgentJobLevel { @@ -1139,7 +1161,7 @@ pub struct ConnectToSourceSqlServerTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "Task id "] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -1676,6 +1698,15 @@ impl ConnectionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ConnectionInfoUnion { + MiSqlConnectionInfo(MiSqlConnectionInfo), + MySqlConnectionInfo(MySqlConnectionInfo), + OracleConnectionInfo(OracleConnectionInfo), + PostgreSqlConnectionInfo(PostgreSqlConnectionInfo), + SqlConnectionInfo(SqlConnectionInfo), +} #[doc = "Results for checksum based Data Integrity validation results"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataIntegrityValidationResult { @@ -2205,7 +2236,7 @@ pub struct DatabaseMigration { pub system_data: Option, #[doc = "Database Migration Resource properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl DatabaseMigration { pub fn new() -> Self { @@ -2326,6 +2357,12 @@ pub mod database_migration_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DatabaseMigrationPropertiesUnion { + SqlMi(DatabaseMigrationPropertiesSqlMi), + SqlVm(DatabaseMigrationPropertiesSqlVm), +} #[doc = "Database Migration Resource properties for SQL Managed Instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatabaseMigrationPropertiesSqlMi { @@ -3527,7 +3564,7 @@ pub struct MigrateMongoDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMongoDbTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3613,6 +3650,9 @@ impl MigrateMySqlAzureDbForMySqlOfflineTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateMySqlAzureDbForMySqlOfflineTaskOutputUnion {} #[doc = "Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateMySqlAzureDbForMySqlOfflineTaskProperties { @@ -3627,7 +3667,7 @@ pub struct MigrateMySqlAzureDbForMySqlOfflineTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "whether the task can be cloned or not"] #[serde(rename = "isCloneable", default, skip_serializing_if = "Option::is_none")] pub is_cloneable: Option, @@ -3714,6 +3754,15 @@ impl MigrateMySqlAzureDbForMySqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateMySqlAzureDbForMySqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputError), + MigrationLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -3940,7 +3989,7 @@ pub struct MigrateMySqlAzureDbForMySqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMySqlAzureDbForMySqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3965,7 +4014,7 @@ pub struct MigrateOracleAzureDbForPostgreSqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateOracleAzureDbForPostgreSqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -4050,6 +4099,15 @@ impl MigrateOracleAzureDbPostgreSqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateOracleAzureDbPostgreSqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputError), + MigrationLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -4358,6 +4416,15 @@ impl MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError), + MigrationLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -4608,7 +4675,7 @@ pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "task id"] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -4692,6 +4759,14 @@ impl MigrateSchemaSqlServerSqlDbTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSchemaSqlServerSqlDbTaskOutputUnion { + DatabaseLevelOutput(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel), + SchemaErrorOutput(MigrateSchemaSqlServerSqlDbTaskOutputError), + MigrationLevelOutput(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel), + ErrorOutput(MigrateSchemaSqlTaskOutputError), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel { #[serde(flatten)] @@ -4818,7 +4893,7 @@ pub struct MigrateSchemaSqlServerSqlDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "DateTime in UTC when the task was created"] #[serde(rename = "createdOn", default, skip_serializing_if = "Option::is_none")] pub created_on: Option, @@ -4953,6 +5028,15 @@ impl MigrateSqlServerSqlDbSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlDbSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -5183,7 +5267,7 @@ pub struct MigrateSqlServerSqlDbSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlDbSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -5238,6 +5322,16 @@ impl MigrateSqlServerSqlDbTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevel), + MigrationDatabaseLevelValidationOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult), + ErrorOutput(MigrateSqlServerSqlDbTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbTaskOutputTableLevel), + MigrationValidationOutput(MigrateSqlServerSqlDbTaskOutputValidationResult), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlDbTaskOutputDatabaseLevel { #[serde(flatten)] @@ -5500,7 +5594,7 @@ pub struct MigrateSqlServerSqlDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "task id"] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -5589,6 +5683,13 @@ impl MigrateSqlServerSqlMiSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiSyncTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel { #[serde(flatten)] @@ -5745,7 +5846,7 @@ pub struct MigrateSqlServerSqlMiSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "DateTime in UTC when the task was created"] #[serde(rename = "createdOn", default, skip_serializing_if = "Option::is_none")] pub created_on: Option, @@ -5838,6 +5939,15 @@ impl MigrateSqlServerSqlMiTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiTaskOutputUnion { + AgentJobLevelOutput(MigrateSqlServerSqlMiTaskOutputAgentJobLevel), + DatabaseLevelOutput(MigrateSqlServerSqlMiTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiTaskOutputError), + LoginLevelOutput(MigrateSqlServerSqlMiTaskOutputLoginLevel), + MigrationLevelOutput(MigrateSqlServerSqlMiTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlMiTaskOutputAgentJobLevel { #[serde(flatten)] @@ -6093,7 +6203,7 @@ pub struct MigrateSqlServerSqlMiTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "task id"] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -6178,6 +6288,12 @@ impl MigrateSsisTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSsisTaskOutputUnion { + MigrationLevelOutput(MigrateSsisTaskOutputMigrationLevel), + SsisProjectLevelOutput(MigrateSsisTaskOutputProjectLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSsisTaskOutputMigrationLevel { #[serde(flatten)] @@ -6298,7 +6414,7 @@ pub struct MigrateSsisTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSsisTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -7331,6 +7447,13 @@ pub mod mongo_db_progress { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MongoDbProgressUnion { + Collection(MongoDbCollectionProgress), + Database(MongoDbDatabaseProgress), + Migration(MongoDbMigrationProgress), +} #[doc = "Properties for the command that restarts a migration in whole or in part"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MongoDbRestartCommand { @@ -8146,10 +8269,10 @@ pub struct ProjectProperties { pub creation_time: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "sourceConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub source_connection_info: Option, + pub source_connection_info: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "targetConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub target_connection_info: Option, + pub target_connection_info: Option, #[doc = "List of DatabaseInfo"] #[serde( rename = "databasesInfo", @@ -8318,7 +8441,7 @@ pub struct ProjectTask { pub etag: Option, #[doc = "Base class for all types of DMS task properties. If task is not supported by current client, this object is returned."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] pub system_data: Option, } @@ -8349,7 +8472,7 @@ pub struct ProjectTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub commands: Vec, + pub commands: Vec, #[doc = "Key value pairs of client data to attach meta data information to task"] #[serde(rename = "clientData", default, skip_serializing_if = "Option::is_none")] pub client_data: Option, @@ -8590,6 +8713,82 @@ pub mod project_task_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "taskType")] +pub enum ProjectTaskPropertiesUnion { + #[serde(rename = "Service.Check.OCI")] + ServiceCheckOci(CheckOciDriverTaskProperties), + #[serde(rename = "Connect.MongoDb")] + ConnectMongoDb(ConnectToMongoDbTaskProperties), + #[serde(rename = "ConnectToSource.MySql")] + ConnectToSourceMySql(ConnectToSourceMySqlTaskProperties), + #[serde(rename = "ConnectToSource.Oracle.Sync")] + ConnectToSourceOracleSync(ConnectToSourceOracleSyncTaskProperties), + #[serde(rename = "ConnectToSource.PostgreSql.Sync")] + ConnectToSourcePostgreSqlSync(ConnectToSourcePostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer.Sync")] + ConnectToSourceSqlServerSync(ConnectToSourceSqlServerSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer")] + ConnectToSourceSqlServer(ConnectToSourceSqlServerTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForMySql")] + ConnectToTargetAzureDbForMySql(ConnectToTargetAzureDbForMySqlTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForPostgreSql.Sync")] + ConnectToTargetAzureDbForPostgreSqlSync(ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync")] + ConnectToTargetOracleAzureDbForPostgreSqlSync(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb")] + ConnectToTargetSqlDb(ConnectToTargetSqlDbTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI.Sync.LRS")] + ConnectToTargetAzureSqlDbMiSyncLrs(ConnectToTargetSqlMiSyncTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI")] + ConnectToTargetAzureSqlDbMi(ConnectToTargetSqlMiTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb.Sync")] + ConnectToTargetSqlDbSync(ConnectToTargetSqlSqlDbSyncTaskProperties), + #[serde(rename = "GetTDECertificates.Sql")] + GetTdeCertificatesSql(GetTdeCertificatesSqlTaskProperties), + GetUserTablesMySql(GetUserTablesMySqlTaskProperties), + GetUserTablesOracle(GetUserTablesOracleTaskProperties), + GetUserTablesPostgreSql(GetUserTablesPostgreSqlTaskProperties), + #[serde(rename = "GetUserTables.AzureSqlDb.Sync")] + GetUserTablesAzureSqlDbSync(GetUserTablesSqlSyncTaskProperties), + #[serde(rename = "GetUserTables.Sql")] + GetUserTablesSql(GetUserTablesSqlTaskProperties), + #[serde(rename = "Service.Install.OCI")] + ServiceInstallOci(InstallOciDriverTaskProperties), + #[serde(rename = "Migrate.MongoDb")] + MigrateMongoDb(MigrateMongoDbTaskProperties), + #[serde(rename = "Migrate.MySql.AzureDbForMySql")] + MigrateMySqlAzureDbForMySql(MigrateMySqlAzureDbForMySqlOfflineTaskProperties), + #[serde(rename = "Migrate.MySql.AzureDbForMySql.Sync")] + MigrateMySqlAzureDbForMySqlSync(MigrateMySqlAzureDbForMySqlSyncTaskProperties), + #[serde(rename = "Migrate.Oracle.AzureDbForPostgreSql.Sync")] + MigrateOracleAzureDbForPostgreSqlSync(MigrateOracleAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2")] + MigratePostgreSqlAzureDbForPostgreSqlSyncV2(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties), + MigrateSchemaSqlServerSqlDb(MigrateSchemaSqlServerSqlDbTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDb.Sync")] + MigrateSqlServerAzureSqlDbSync(MigrateSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.SqlDb")] + MigrateSqlServerSqlDb(MigrateSqlServerSqlDbTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS")] + MigrateSqlServerAzureSqlDbMiSyncLrs(MigrateSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI")] + MigrateSqlServerAzureSqlDbMi(MigrateSqlServerSqlMiTaskProperties), + #[serde(rename = "Migrate.Ssis")] + MigrateSsis(MigrateSsisTaskProperties), + #[serde(rename = "Service.Upload.OCI")] + ServiceUploadOci(UploadOciDriverTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.SqlDb.Sync")] + ValidateMigrationInputSqlServerSqlDbSync(ValidateMigrationInputSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS")] + ValidateMigrationInputSqlServerAzureSqlDbMiSyncLrs(ValidateMigrationInputSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI")] + ValidateMigrationInputSqlServerAzureSqlDbMi(ValidateMigrationInputSqlServerSqlMiTaskProperties), + #[serde(rename = "Validate.MongoDb")] + ValidateMongoDb(ValidateMongoDbTaskProperties), + #[serde(rename = "Validate.Oracle.AzureDbPostgreSql.Sync")] + ValidateOracleAzureDbPostgreSqlSync(ValidateOracleAzureDbForPostgreSqlSyncTaskProperties), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { #[serde(default, skip_serializing_if = "Option::is_none")] diff --git a/services/mgmt/datamigration/src/package_preview_2022_03/mod.rs b/services/mgmt/datamigration/src/package_preview_2022_03/mod.rs index e4194be752..528424022e 100644 --- a/services/mgmt/datamigration/src/package_preview_2022_03/mod.rs +++ b/services/mgmt/datamigration/src/package_preview_2022_03/mod.rs @@ -5319,7 +5319,7 @@ pub mod tasks { service_name: impl Into, project_name: impl Into, task_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> command::RequestBuilder { command::RequestBuilder { client: self.0.clone(), @@ -6046,9 +6046,9 @@ pub mod tasks { #[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::CommandProperties = serde_json::from_slice(&bytes)?; + let body: models::CommandPropertiesUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6094,7 +6094,7 @@ pub mod tasks { pub(crate) service_name: String, pub(crate) project_name: String, pub(crate) task_name: String, - pub(crate) parameters: models::CommandProperties, + pub(crate) parameters: models::CommandPropertiesUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6139,8 +6139,8 @@ pub mod tasks { } } 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`."] diff --git a/services/mgmt/datamigration/src/package_preview_2022_03/models.rs b/services/mgmt/datamigration/src/package_preview_2022_03/models.rs index 094182f2c2..0544b0c057 100644 --- a/services/mgmt/datamigration/src/package_preview_2022_03/models.rs +++ b/services/mgmt/datamigration/src/package_preview_2022_03/models.rs @@ -629,6 +629,20 @@ pub mod command_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "commandType")] +pub enum CommandPropertiesUnion { + #[serde(rename = "Migrate.SqlServer.AzureDbSqlMi.Complete")] + MigrateSqlServerAzureDbSqlMiComplete(MigrateMiSyncCompleteCommandProperties), + #[serde(rename = "Migrate.Sync.Complete.Database")] + MigrateSyncCompleteDatabase(MigrateSyncCompleteCommandProperties), + #[serde(rename = "cancel")] + Cancel(MongoDbCancelCommand), + #[serde(rename = "finish")] + Finish(MongoDbFinishCommand), + #[serde(rename = "restart")] + Restart(MongoDbRestartCommand), +} #[doc = "Properties for the task that validates the connection to and provides information about a MongoDB server"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToMongoDbTaskProperties { @@ -889,7 +903,7 @@ pub struct ConnectToSourceSqlServerSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl ConnectToSourceSqlServerSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -957,6 +971,14 @@ impl ConnectToSourceSqlServerTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum ConnectToSourceSqlServerTaskOutputUnion { + AgentJobLevelOutput(ConnectToSourceSqlServerTaskOutputAgentJobLevel), + DatabaseLevelOutput(ConnectToSourceSqlServerTaskOutputDatabaseLevel), + LoginLevelOutput(ConnectToSourceSqlServerTaskOutputLoginLevel), + TaskLevelOutput(ConnectToSourceSqlServerTaskOutputTaskLevel), +} #[doc = "Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectToSourceSqlServerTaskOutputAgentJobLevel { @@ -1134,7 +1156,7 @@ pub struct ConnectToSourceSqlServerTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "Task id "] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -1671,6 +1693,15 @@ impl ConnectionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ConnectionInfoUnion { + MiSqlConnectionInfo(MiSqlConnectionInfo), + MySqlConnectionInfo(MySqlConnectionInfo), + OracleConnectionInfo(OracleConnectionInfo), + PostgreSqlConnectionInfo(PostgreSqlConnectionInfo), + SqlConnectionInfo(SqlConnectionInfo), +} #[doc = "Details on progress of ADF copy activity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CopyProgressDetails { @@ -2242,7 +2273,7 @@ pub struct DatabaseMigration { pub system_data: Option, #[doc = "Database Migration Resource properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl DatabaseMigration { pub fn new() -> Self { @@ -2377,6 +2408,13 @@ pub mod database_migration_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DatabaseMigrationPropertiesUnion { + SqlDb(DatabaseMigrationPropertiesSqlDb), + SqlMi(DatabaseMigrationPropertiesSqlMi), + SqlVm(DatabaseMigrationPropertiesSqlVm), +} #[doc = "Database Migration Resource properties for SQL database."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatabaseMigrationPropertiesSqlDb { @@ -3612,7 +3650,7 @@ pub struct MigrateMongoDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMongoDbTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -3698,6 +3736,9 @@ impl MigrateMySqlAzureDbForMySqlOfflineTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateMySqlAzureDbForMySqlOfflineTaskOutputUnion {} #[doc = "Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateMySqlAzureDbForMySqlOfflineTaskProperties { @@ -3712,7 +3753,7 @@ pub struct MigrateMySqlAzureDbForMySqlOfflineTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "whether the task can be cloned or not"] #[serde(rename = "isCloneable", default, skip_serializing_if = "Option::is_none")] pub is_cloneable: Option, @@ -3799,6 +3840,15 @@ impl MigrateMySqlAzureDbForMySqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateMySqlAzureDbForMySqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputError), + MigrationLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -4025,7 +4075,7 @@ pub struct MigrateMySqlAzureDbForMySqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateMySqlAzureDbForMySqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -4050,7 +4100,7 @@ pub struct MigrateOracleAzureDbForPostgreSqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateOracleAzureDbForPostgreSqlSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -4135,6 +4185,15 @@ impl MigrateOracleAzureDbPostgreSqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateOracleAzureDbPostgreSqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputError), + MigrationLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -4443,6 +4502,15 @@ impl MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel), + ErrorOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError), + MigrationLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel), + TableLevelOutput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -4693,7 +4761,7 @@ pub struct MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "task id"] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -4777,6 +4845,14 @@ impl MigrateSchemaSqlServerSqlDbTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSchemaSqlServerSqlDbTaskOutputUnion { + DatabaseLevelOutput(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel), + SchemaErrorOutput(MigrateSchemaSqlServerSqlDbTaskOutputError), + MigrationLevelOutput(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel), + ErrorOutput(MigrateSchemaSqlTaskOutputError), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel { #[serde(flatten)] @@ -4903,7 +4979,7 @@ pub struct MigrateSchemaSqlServerSqlDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "DateTime in UTC when the task was created"] #[serde(rename = "createdOn", default, skip_serializing_if = "Option::is_none")] pub created_on: Option, @@ -5038,6 +5114,15 @@ impl MigrateSqlServerSqlDbSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbSyncTaskOutputUnion { + DatabaseLevelErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError), + DatabaseLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlDbSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbSyncTaskOutputTableLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlDbSyncTaskOutputDatabaseError { #[serde(flatten)] @@ -5268,7 +5353,7 @@ pub struct MigrateSqlServerSqlDbSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSqlServerSqlDbSyncTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -5323,6 +5408,16 @@ impl MigrateSqlServerSqlDbTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlDbTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevel), + MigrationDatabaseLevelValidationOutput(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult), + ErrorOutput(MigrateSqlServerSqlDbTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlDbTaskOutputMigrationLevel), + TableLevelOutput(MigrateSqlServerSqlDbTaskOutputTableLevel), + MigrationValidationOutput(MigrateSqlServerSqlDbTaskOutputValidationResult), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlDbTaskOutputDatabaseLevel { #[serde(flatten)] @@ -5585,7 +5680,7 @@ pub struct MigrateSqlServerSqlDbTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "task id"] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -5674,6 +5769,13 @@ impl MigrateSqlServerSqlMiSyncTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiSyncTaskOutputUnion { + DatabaseLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiSyncTaskOutputError), + MigrationLevelOutput(MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel { #[serde(flatten)] @@ -5830,7 +5932,7 @@ pub struct MigrateSqlServerSqlMiSyncTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "DateTime in UTC when the task was created"] #[serde(rename = "createdOn", default, skip_serializing_if = "Option::is_none")] pub created_on: Option, @@ -5923,6 +6025,15 @@ impl MigrateSqlServerSqlMiTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSqlServerSqlMiTaskOutputUnion { + AgentJobLevelOutput(MigrateSqlServerSqlMiTaskOutputAgentJobLevel), + DatabaseLevelOutput(MigrateSqlServerSqlMiTaskOutputDatabaseLevel), + ErrorOutput(MigrateSqlServerSqlMiTaskOutputError), + LoginLevelOutput(MigrateSqlServerSqlMiTaskOutputLoginLevel), + MigrationLevelOutput(MigrateSqlServerSqlMiTaskOutputMigrationLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSqlServerSqlMiTaskOutputAgentJobLevel { #[serde(flatten)] @@ -6178,7 +6289,7 @@ pub struct MigrateSqlServerSqlMiTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, #[doc = "task id"] #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] pub task_id: Option, @@ -6263,6 +6374,12 @@ impl MigrateSsisTaskOutput { Self { id: None, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MigrateSsisTaskOutputUnion { + MigrationLevelOutput(MigrateSsisTaskOutputMigrationLevel), + SsisProjectLevelOutput(MigrateSsisTaskOutputProjectLevel), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MigrateSsisTaskOutputMigrationLevel { #[serde(flatten)] @@ -6383,7 +6500,7 @@ pub struct MigrateSsisTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub output: Vec, + pub output: Vec, } impl MigrateSsisTaskProperties { pub fn new(project_task_properties: ProjectTaskProperties) -> Self { @@ -7424,6 +7541,13 @@ pub mod mongo_db_progress { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum MongoDbProgressUnion { + Collection(MongoDbCollectionProgress), + Database(MongoDbDatabaseProgress), + Migration(MongoDbMigrationProgress), +} #[doc = "Properties for the command that restarts a migration in whole or in part"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MongoDbRestartCommand { @@ -8259,10 +8383,10 @@ pub struct ProjectProperties { pub creation_time: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "sourceConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub source_connection_info: Option, + pub source_connection_info: Option, #[doc = "Defines the connection properties of a server"] #[serde(rename = "targetConnectionInfo", default, skip_serializing_if = "Option::is_none")] - pub target_connection_info: Option, + pub target_connection_info: Option, #[doc = "List of DatabaseInfo"] #[serde( rename = "databasesInfo", @@ -8431,7 +8555,7 @@ pub struct ProjectTask { pub etag: Option, #[doc = "Base class for all types of DMS (classic) task properties. If task is not supported by current client, this object is returned."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] pub system_data: Option, } @@ -8462,7 +8586,7 @@ pub struct ProjectTaskProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub commands: Vec, + pub commands: Vec, #[doc = "Key value pairs of client data to attach meta data information to task"] #[serde(rename = "clientData", default, skip_serializing_if = "Option::is_none")] pub client_data: Option, @@ -8703,6 +8827,82 @@ pub mod project_task_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "taskType")] +pub enum ProjectTaskPropertiesUnion { + #[serde(rename = "Service.Check.OCI")] + ServiceCheckOci(CheckOciDriverTaskProperties), + #[serde(rename = "Connect.MongoDb")] + ConnectMongoDb(ConnectToMongoDbTaskProperties), + #[serde(rename = "ConnectToSource.MySql")] + ConnectToSourceMySql(ConnectToSourceMySqlTaskProperties), + #[serde(rename = "ConnectToSource.Oracle.Sync")] + ConnectToSourceOracleSync(ConnectToSourceOracleSyncTaskProperties), + #[serde(rename = "ConnectToSource.PostgreSql.Sync")] + ConnectToSourcePostgreSqlSync(ConnectToSourcePostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer.Sync")] + ConnectToSourceSqlServerSync(ConnectToSourceSqlServerSyncTaskProperties), + #[serde(rename = "ConnectToSource.SqlServer")] + ConnectToSourceSqlServer(ConnectToSourceSqlServerTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForMySql")] + ConnectToTargetAzureDbForMySql(ConnectToTargetAzureDbForMySqlTaskProperties), + #[serde(rename = "ConnectToTarget.AzureDbForPostgreSql.Sync")] + ConnectToTargetAzureDbForPostgreSqlSync(ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync")] + ConnectToTargetOracleAzureDbForPostgreSqlSync(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb")] + ConnectToTargetSqlDb(ConnectToTargetSqlDbTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI.Sync.LRS")] + ConnectToTargetAzureSqlDbMiSyncLrs(ConnectToTargetSqlMiSyncTaskProperties), + #[serde(rename = "ConnectToTarget.AzureSqlDbMI")] + ConnectToTargetAzureSqlDbMi(ConnectToTargetSqlMiTaskProperties), + #[serde(rename = "ConnectToTarget.SqlDb.Sync")] + ConnectToTargetSqlDbSync(ConnectToTargetSqlSqlDbSyncTaskProperties), + #[serde(rename = "GetTDECertificates.Sql")] + GetTdeCertificatesSql(GetTdeCertificatesSqlTaskProperties), + GetUserTablesMySql(GetUserTablesMySqlTaskProperties), + GetUserTablesOracle(GetUserTablesOracleTaskProperties), + GetUserTablesPostgreSql(GetUserTablesPostgreSqlTaskProperties), + #[serde(rename = "GetUserTables.AzureSqlDb.Sync")] + GetUserTablesAzureSqlDbSync(GetUserTablesSqlSyncTaskProperties), + #[serde(rename = "GetUserTables.Sql")] + GetUserTablesSql(GetUserTablesSqlTaskProperties), + #[serde(rename = "Service.Install.OCI")] + ServiceInstallOci(InstallOciDriverTaskProperties), + #[serde(rename = "Migrate.MongoDb")] + MigrateMongoDb(MigrateMongoDbTaskProperties), + #[serde(rename = "Migrate.MySql.AzureDbForMySql")] + MigrateMySqlAzureDbForMySql(MigrateMySqlAzureDbForMySqlOfflineTaskProperties), + #[serde(rename = "Migrate.MySql.AzureDbForMySql.Sync")] + MigrateMySqlAzureDbForMySqlSync(MigrateMySqlAzureDbForMySqlSyncTaskProperties), + #[serde(rename = "Migrate.Oracle.AzureDbForPostgreSql.Sync")] + MigrateOracleAzureDbForPostgreSqlSync(MigrateOracleAzureDbForPostgreSqlSyncTaskProperties), + #[serde(rename = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2")] + MigratePostgreSqlAzureDbForPostgreSqlSyncV2(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties), + MigrateSchemaSqlServerSqlDb(MigrateSchemaSqlServerSqlDbTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDb.Sync")] + MigrateSqlServerAzureSqlDbSync(MigrateSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.SqlDb")] + MigrateSqlServerSqlDb(MigrateSqlServerSqlDbTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS")] + MigrateSqlServerAzureSqlDbMiSyncLrs(MigrateSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "Migrate.SqlServer.AzureSqlDbMI")] + MigrateSqlServerAzureSqlDbMi(MigrateSqlServerSqlMiTaskProperties), + #[serde(rename = "Migrate.Ssis")] + MigrateSsis(MigrateSsisTaskProperties), + #[serde(rename = "Service.Upload.OCI")] + ServiceUploadOci(UploadOciDriverTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.SqlDb.Sync")] + ValidateMigrationInputSqlServerSqlDbSync(ValidateMigrationInputSqlServerSqlDbSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS")] + ValidateMigrationInputSqlServerAzureSqlDbMiSyncLrs(ValidateMigrationInputSqlServerSqlMiSyncTaskProperties), + #[serde(rename = "ValidateMigrationInput.SqlServer.AzureSqlDbMI")] + ValidateMigrationInputSqlServerAzureSqlDbMi(ValidateMigrationInputSqlServerSqlMiTaskProperties), + #[serde(rename = "Validate.MongoDb")] + ValidateMongoDb(ValidateMongoDbTaskProperties), + #[serde(rename = "Validate.Oracle.AzureDbPostgreSql.Sync")] + ValidateOracleAzureDbPostgreSqlSync(ValidateOracleAzureDbForPostgreSqlSyncTaskProperties), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { #[serde(default, skip_serializing_if = "Option::is_none")] diff --git a/services/mgmt/dataprotection/src/package_2022_04/mod.rs b/services/mgmt/dataprotection/src/package_2022_04/mod.rs index 8a4c9c9978..c182e67674 100644 --- a/services/mgmt/dataprotection/src/package_2022_04/mod.rs +++ b/services/mgmt/dataprotection/src/package_2022_04/mod.rs @@ -1846,7 +1846,7 @@ pub mod data_protection { &self, subscription_id: impl Into, location: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> check_feature_support::RequestBuilder { check_feature_support::RequestBuilder { client: self.0.clone(), @@ -1865,9 +1865,9 @@ pub mod data_protection { #[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::FeatureValidationResponseBase = serde_json::from_slice(&bytes)?; + let body: models::FeatureValidationResponseBaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1910,7 +1910,7 @@ pub mod data_protection { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) parameters: models::FeatureValidationRequestBase, + pub(crate) parameters: models::FeatureValidationRequestBaseUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1952,8 +1952,8 @@ pub mod data_protection { } } 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`."] @@ -2839,7 +2839,7 @@ pub mod backup_instances { resource_group_name: impl Into, vault_name: impl Into, backup_instance_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> trigger_restore::RequestBuilder { trigger_restore::RequestBuilder { client: self.0.clone(), @@ -4090,7 +4090,7 @@ pub mod backup_instances { pub(crate) resource_group_name: String, pub(crate) vault_name: String, pub(crate) backup_instance_name: String, - pub(crate) parameters: models::AzureBackupRestoreRequest, + pub(crate) parameters: models::AzureBackupRestoreRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/dataprotection/src/package_2022_04/models.rs b/services/mgmt/dataprotection/src/package_2022_04/models.rs index a79371d2b6..57bd3cb6d7 100644 --- a/services/mgmt/dataprotection/src/package_2022_04/models.rs +++ b/services/mgmt/dataprotection/src/package_2022_04/models.rs @@ -80,6 +80,11 @@ impl AuthCredentials { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AuthCredentialsUnion { + SecretStoreBasedAuthCredentials(SecretStoreBasedAuthCredentials), +} #[doc = "Azure backup discrete RecoveryPoint"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupDiscreteRecoveryPoint { @@ -450,6 +455,11 @@ impl AzureBackupRecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRecoveryPointUnion { + AzureBackupDiscreteRecoveryPoint(AzureBackupDiscreteRecoveryPoint), +} #[doc = "Azure backup recoveryPoint based restore request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRecoveryPointBasedRestoreRequest { @@ -473,7 +483,7 @@ pub struct AzureBackupRecoveryPointResource { pub dpp_resource: DppResource, #[doc = "Azure backup recoveryPoint"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AzureBackupRecoveryPointResource { pub fn new() -> Self { @@ -550,7 +560,7 @@ pub struct AzureBackupRestoreRequest { pub object_type: String, #[doc = "Base class common to RestoreTargetInfo and RestoreFilesTargetInfo"] #[serde(rename = "restoreTargetInfo")] - pub restore_target_info: RestoreTargetInfoBase, + pub restore_target_info: RestoreTargetInfoBaseUnion, #[doc = "Gets or sets the type of the source data store."] #[serde(rename = "sourceDataStoreType")] pub source_data_store_type: azure_backup_restore_request::SourceDataStoreType, @@ -561,7 +571,7 @@ pub struct AzureBackupRestoreRequest { impl AzureBackupRestoreRequest { pub fn new( object_type: String, - restore_target_info: RestoreTargetInfoBase, + restore_target_info: RestoreTargetInfoBaseUnion, source_data_store_type: azure_backup_restore_request::SourceDataStoreType, ) -> Self { Self { @@ -614,6 +624,12 @@ pub mod azure_backup_restore_request { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRestoreRequestUnion { + AzureBackupRecoveryPointBasedRestoreRequest(AzureBackupRecoveryPointBasedRestoreRequest), + AzureBackupRecoveryTimeBasedRestoreRequest(AzureBackupRecoveryTimeBasedRestoreRequest), +} #[doc = "AzureBackup Restore with Rehydration Request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRestoreWithRehydrationRequest { @@ -646,15 +662,15 @@ pub struct AzureBackupRule { pub base_policy_rule: BasePolicyRule, #[doc = "BackupParameters base"] #[serde(rename = "backupParameters", default, skip_serializing_if = "Option::is_none")] - pub backup_parameters: Option, + pub backup_parameters: Option, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, #[doc = "Trigger context"] - pub trigger: TriggerContext, + pub trigger: TriggerContextUnion, } impl AzureBackupRule { - pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContext) -> Self { + pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContextUnion) -> Self { Self { base_policy_rule, backup_parameters: None, @@ -760,6 +776,11 @@ impl BackupCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupCriteriaUnion { + ScheduleBasedBackupCriteria(ScheduleBasedBackupCriteria), +} #[doc = "Backup Instance"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupInstance { @@ -789,7 +810,7 @@ pub struct BackupInstance { pub provisioning_state: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, #[doc = "Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again."] #[serde(rename = "validationType", default, skip_serializing_if = "Option::is_none")] pub validation_type: Option, @@ -966,6 +987,11 @@ impl BackupParameters { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupParametersUnion { + AzureBackupParams(AzureBackupParams), +} #[doc = "Rule based backup policy"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupPolicy { @@ -973,10 +999,10 @@ pub struct BackupPolicy { pub base_backup_policy: BaseBackupPolicy, #[doc = "Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc"] #[serde(rename = "policyRules")] - pub policy_rules: Vec, + pub policy_rules: Vec, } impl BackupPolicy { - pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { + pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { Self { base_backup_policy, policy_rules, @@ -1187,6 +1213,11 @@ impl BaseBackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BaseBackupPolicyUnion { + BackupPolicy(BackupPolicy), +} #[doc = "BaseBackupPolicy resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BaseBackupPolicyResource { @@ -1194,7 +1225,7 @@ pub struct BaseBackupPolicyResource { pub dpp_resource: DppResource, #[doc = "BackupPolicy base"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BaseBackupPolicyResource { pub fn new() -> Self { @@ -1237,6 +1268,12 @@ impl BasePolicyRule { Self { name, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BasePolicyRuleUnion { + AzureBackupRule(AzureBackupRule), + AzureRetentionRule(AzureRetentionRule), +} #[doc = "CheckNameAvailability Request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckNameAvailabilityRequest { @@ -1428,6 +1465,13 @@ impl CopyOption { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum CopyOptionUnion { + CopyOnExpiryOption(CopyOnExpiryOption), + CustomCopyOption(CustomCopyOption), + ImmediateCopyOption(ImmediateCopyOption), +} #[doc = "Duration based custom options to copy"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomCopyOption { @@ -1565,6 +1609,11 @@ pub mod data_store_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DataStoreParametersUnion { + AzureOperationalStoreParameters(AzureOperationalStoreParameters), +} #[doc = "Datasource to be backed up"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Datasource { @@ -1670,6 +1719,11 @@ impl DeleteOption { Self { duration, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DeleteOptionUnion { + AbsoluteDeleteOption(AbsoluteDeleteOption), +} #[doc = "Base resource under Microsoft.DataProtection provider namespace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DppBaseResource { @@ -1976,6 +2030,11 @@ impl FeatureValidationRequestBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationRequestBaseUnion { + FeatureValidationRequest(FeatureValidationRequest), +} #[doc = "Feature Validation Response"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FeatureValidationResponse { @@ -2053,6 +2112,11 @@ impl FeatureValidationResponseBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationResponseBaseUnion { + FeatureValidationResponse(FeatureValidationResponse), +} #[doc = "Immediate copy Option"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImmediateCopyOption { @@ -2094,6 +2158,14 @@ impl ItemLevelRestoreCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum ItemLevelRestoreCriteriaUnion { + #[serde(rename = "KubernetesPVRestoreCriteria")] + KubernetesPvRestoreCriteria(KubernetesPvRestoreCriteria), + KubernetesStorageClassRestoreCriteria(KubernetesStorageClassRestoreCriteria), + RangeBasedItemLevelRestoreCriteria(RangeBasedItemLevelRestoreCriteria), +} #[doc = "Restore target info for Item level restore operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ItemLevelRestoreTargetInfo { @@ -2101,7 +2173,7 @@ pub struct ItemLevelRestoreTargetInfo { pub restore_target_info_base: RestoreTargetInfoBase, #[doc = "Restore Criteria"] #[serde(rename = "restoreCriteria")] - pub restore_criteria: Vec, + pub restore_criteria: Vec, #[doc = "Datasource to be backed up"] #[serde(rename = "datasourceInfo")] pub datasource_info: Datasource, @@ -2110,12 +2182,12 @@ pub struct ItemLevelRestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl ItemLevelRestoreTargetInfo { pub fn new( restore_target_info_base: RestoreTargetInfoBase, - restore_criteria: Vec, + restore_criteria: Vec, datasource_info: Datasource, ) -> Self { Self { @@ -2256,6 +2328,11 @@ impl OperationExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationExtendedInfoUnion { + OperationJobExtendedInfo(OperationJobExtendedInfo), +} #[doc = "Operation Job Extended Info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationJobExtendedInfo { @@ -2290,7 +2367,7 @@ pub struct OperationResource { pub name: Option, #[doc = "Operation Extended Info"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, #[doc = "Start time of the operation"] #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] pub start_time: Option, @@ -2362,7 +2439,7 @@ pub struct PolicyParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub data_store_parameters_list: Vec, + pub data_store_parameters_list: Vec, } impl PolicyParameters { pub fn new() -> Self { @@ -2805,7 +2882,7 @@ pub struct RestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl RestoreTargetInfo { pub fn new(restore_target_info_base: RestoreTargetInfoBase, datasource_info: Datasource) -> Self { @@ -2877,6 +2954,13 @@ pub mod restore_target_info_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreTargetInfoBaseUnion { + ItemLevelRestoreTargetInfo(ItemLevelRestoreTargetInfo), + RestoreFilesTargetInfo(RestoreFilesTargetInfo), + RestoreTargetInfo(RestoreTargetInfo), +} #[doc = "Retention tag"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RetentionTag { @@ -3070,7 +3154,7 @@ pub mod secret_store_resource { pub struct SourceLifeCycle { #[doc = "Delete Option"] #[serde(rename = "deleteAfter")] - pub delete_after: DeleteOption, + pub delete_after: DeleteOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "sourceDataStore")] pub source_data_store: DataStoreInfoBase, @@ -3083,7 +3167,7 @@ pub struct SourceLifeCycle { pub target_data_store_copy_settings: Vec, } impl SourceLifeCycle { - pub fn new(delete_after: DeleteOption, source_data_store: DataStoreInfoBase) -> Self { + pub fn new(delete_after: DeleteOptionUnion, source_data_store: DataStoreInfoBase) -> Self { Self { delete_after, source_data_store, @@ -3317,7 +3401,7 @@ pub struct TaggingCriteria { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub criteria: Vec, + pub criteria: Vec, #[doc = "Specifies if tag is default."] #[serde(rename = "isDefault")] pub is_default: bool, @@ -3343,13 +3427,13 @@ impl TaggingCriteria { pub struct TargetCopySetting { #[doc = "Options to copy"] #[serde(rename = "copyAfter")] - pub copy_after: CopyOption, + pub copy_after: CopyOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, } impl TargetCopySetting { - pub fn new(copy_after: CopyOption, data_store: DataStoreInfoBase) -> Self { + pub fn new(copy_after: CopyOptionUnion, data_store: DataStoreInfoBase) -> Self { Self { copy_after, data_store } } } @@ -3440,6 +3524,12 @@ impl TriggerContext { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum TriggerContextUnion { + AdhocBasedTriggerContext(AdhocBasedTriggerContext), + ScheduleBasedTriggerContext(ScheduleBasedTriggerContext), +} #[doc = "Error object used by layers that have access to localized content, and propagate that to user"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserFacingError { @@ -3501,10 +3591,10 @@ impl ValidateForBackupRequest { pub struct ValidateRestoreRequestObject { #[doc = "Azure backup restore request"] #[serde(rename = "restoreRequestObject")] - pub restore_request_object: AzureBackupRestoreRequest, + pub restore_request_object: AzureBackupRestoreRequestUnion, } impl ValidateRestoreRequestObject { - pub fn new(restore_request_object: AzureBackupRestoreRequest) -> Self { + pub fn new(restore_request_object: AzureBackupRestoreRequestUnion) -> Self { Self { restore_request_object } } } diff --git a/services/mgmt/dataprotection/src/package_2022_05/mod.rs b/services/mgmt/dataprotection/src/package_2022_05/mod.rs index 872eaaf544..985c92004e 100644 --- a/services/mgmt/dataprotection/src/package_2022_05/mod.rs +++ b/services/mgmt/dataprotection/src/package_2022_05/mod.rs @@ -1846,7 +1846,7 @@ pub mod data_protection { &self, subscription_id: impl Into, location: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> check_feature_support::RequestBuilder { check_feature_support::RequestBuilder { client: self.0.clone(), @@ -1865,9 +1865,9 @@ pub mod data_protection { #[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::FeatureValidationResponseBase = serde_json::from_slice(&bytes)?; + let body: models::FeatureValidationResponseBaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1910,7 +1910,7 @@ pub mod data_protection { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) parameters: models::FeatureValidationRequestBase, + pub(crate) parameters: models::FeatureValidationRequestBaseUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1952,8 +1952,8 @@ pub mod data_protection { } } 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`."] @@ -2839,7 +2839,7 @@ pub mod backup_instances { resource_group_name: impl Into, vault_name: impl Into, backup_instance_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> trigger_restore::RequestBuilder { trigger_restore::RequestBuilder { client: self.0.clone(), @@ -4090,7 +4090,7 @@ pub mod backup_instances { pub(crate) resource_group_name: String, pub(crate) vault_name: String, pub(crate) backup_instance_name: String, - pub(crate) parameters: models::AzureBackupRestoreRequest, + pub(crate) parameters: models::AzureBackupRestoreRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/dataprotection/src/package_2022_05/models.rs b/services/mgmt/dataprotection/src/package_2022_05/models.rs index 942d7cc23f..79ef6fbde5 100644 --- a/services/mgmt/dataprotection/src/package_2022_05/models.rs +++ b/services/mgmt/dataprotection/src/package_2022_05/models.rs @@ -80,6 +80,11 @@ impl AuthCredentials { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AuthCredentialsUnion { + SecretStoreBasedAuthCredentials(SecretStoreBasedAuthCredentials), +} #[doc = "Azure backup discrete RecoveryPoint"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupDiscreteRecoveryPoint { @@ -450,6 +455,11 @@ impl AzureBackupRecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRecoveryPointUnion { + AzureBackupDiscreteRecoveryPoint(AzureBackupDiscreteRecoveryPoint), +} #[doc = "Azure backup recoveryPoint based restore request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRecoveryPointBasedRestoreRequest { @@ -473,7 +483,7 @@ pub struct AzureBackupRecoveryPointResource { pub dpp_resource: DppResource, #[doc = "Azure backup recoveryPoint"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AzureBackupRecoveryPointResource { pub fn new() -> Self { @@ -550,7 +560,7 @@ pub struct AzureBackupRestoreRequest { pub object_type: String, #[doc = "Base class common to RestoreTargetInfo and RestoreFilesTargetInfo"] #[serde(rename = "restoreTargetInfo")] - pub restore_target_info: RestoreTargetInfoBase, + pub restore_target_info: RestoreTargetInfoBaseUnion, #[doc = "Gets or sets the type of the source data store."] #[serde(rename = "sourceDataStoreType")] pub source_data_store_type: azure_backup_restore_request::SourceDataStoreType, @@ -561,7 +571,7 @@ pub struct AzureBackupRestoreRequest { impl AzureBackupRestoreRequest { pub fn new( object_type: String, - restore_target_info: RestoreTargetInfoBase, + restore_target_info: RestoreTargetInfoBaseUnion, source_data_store_type: azure_backup_restore_request::SourceDataStoreType, ) -> Self { Self { @@ -614,6 +624,12 @@ pub mod azure_backup_restore_request { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRestoreRequestUnion { + AzureBackupRecoveryPointBasedRestoreRequest(AzureBackupRecoveryPointBasedRestoreRequest), + AzureBackupRecoveryTimeBasedRestoreRequest(AzureBackupRecoveryTimeBasedRestoreRequest), +} #[doc = "AzureBackup Restore with Rehydration Request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRestoreWithRehydrationRequest { @@ -646,15 +662,15 @@ pub struct AzureBackupRule { pub base_policy_rule: BasePolicyRule, #[doc = "BackupParameters base"] #[serde(rename = "backupParameters", default, skip_serializing_if = "Option::is_none")] - pub backup_parameters: Option, + pub backup_parameters: Option, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, #[doc = "Trigger context"] - pub trigger: TriggerContext, + pub trigger: TriggerContextUnion, } impl AzureBackupRule { - pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContext) -> Self { + pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContextUnion) -> Self { Self { base_policy_rule, backup_parameters: None, @@ -760,6 +776,11 @@ impl BackupCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupCriteriaUnion { + ScheduleBasedBackupCriteria(ScheduleBasedBackupCriteria), +} #[doc = "Backup Instance"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupInstance { @@ -789,7 +810,7 @@ pub struct BackupInstance { pub provisioning_state: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, #[doc = "Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again."] #[serde(rename = "validationType", default, skip_serializing_if = "Option::is_none")] pub validation_type: Option, @@ -966,6 +987,11 @@ impl BackupParameters { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupParametersUnion { + AzureBackupParams(AzureBackupParams), +} #[doc = "Rule based backup policy"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupPolicy { @@ -973,10 +999,10 @@ pub struct BackupPolicy { pub base_backup_policy: BaseBackupPolicy, #[doc = "Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc"] #[serde(rename = "policyRules")] - pub policy_rules: Vec, + pub policy_rules: Vec, } impl BackupPolicy { - pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { + pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { Self { base_backup_policy, policy_rules, @@ -1191,6 +1217,11 @@ impl BaseBackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BaseBackupPolicyUnion { + BackupPolicy(BackupPolicy), +} #[doc = "BaseBackupPolicy resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BaseBackupPolicyResource { @@ -1198,7 +1229,7 @@ pub struct BaseBackupPolicyResource { pub dpp_resource: DppResource, #[doc = "BackupPolicy base"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BaseBackupPolicyResource { pub fn new() -> Self { @@ -1241,6 +1272,12 @@ impl BasePolicyRule { Self { name, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BasePolicyRuleUnion { + AzureBackupRule(AzureBackupRule), + AzureRetentionRule(AzureRetentionRule), +} #[doc = "CheckNameAvailability Request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckNameAvailabilityRequest { @@ -1432,6 +1469,13 @@ impl CopyOption { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum CopyOptionUnion { + CopyOnExpiryOption(CopyOnExpiryOption), + CustomCopyOption(CustomCopyOption), + ImmediateCopyOption(ImmediateCopyOption), +} #[doc = "Duration based custom options to copy"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomCopyOption { @@ -1569,6 +1613,11 @@ pub mod data_store_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DataStoreParametersUnion { + AzureOperationalStoreParameters(AzureOperationalStoreParameters), +} #[doc = "Datasource to be backed up"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Datasource { @@ -1674,6 +1723,11 @@ impl DeleteOption { Self { duration, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DeleteOptionUnion { + AbsoluteDeleteOption(AbsoluteDeleteOption), +} #[doc = "Base resource under Microsoft.DataProtection provider namespace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DppBaseResource { @@ -2003,6 +2057,11 @@ impl FeatureValidationRequestBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationRequestBaseUnion { + FeatureValidationRequest(FeatureValidationRequest), +} #[doc = "Feature Validation Response"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FeatureValidationResponse { @@ -2080,6 +2139,11 @@ impl FeatureValidationResponseBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationResponseBaseUnion { + FeatureValidationResponse(FeatureValidationResponse), +} #[doc = "Immediate copy Option"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImmediateCopyOption { @@ -2121,6 +2185,14 @@ impl ItemLevelRestoreCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum ItemLevelRestoreCriteriaUnion { + #[serde(rename = "KubernetesPVRestoreCriteria")] + KubernetesPvRestoreCriteria(KubernetesPvRestoreCriteria), + KubernetesStorageClassRestoreCriteria(KubernetesStorageClassRestoreCriteria), + RangeBasedItemLevelRestoreCriteria(RangeBasedItemLevelRestoreCriteria), +} #[doc = "Restore target info for Item level restore operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ItemLevelRestoreTargetInfo { @@ -2128,7 +2200,7 @@ pub struct ItemLevelRestoreTargetInfo { pub restore_target_info_base: RestoreTargetInfoBase, #[doc = "Restore Criteria"] #[serde(rename = "restoreCriteria")] - pub restore_criteria: Vec, + pub restore_criteria: Vec, #[doc = "Datasource to be backed up"] #[serde(rename = "datasourceInfo")] pub datasource_info: Datasource, @@ -2137,12 +2209,12 @@ pub struct ItemLevelRestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl ItemLevelRestoreTargetInfo { pub fn new( restore_target_info_base: RestoreTargetInfoBase, - restore_criteria: Vec, + restore_criteria: Vec, datasource_info: Datasource, ) -> Self { Self { @@ -2283,6 +2355,11 @@ impl OperationExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationExtendedInfoUnion { + OperationJobExtendedInfo(OperationJobExtendedInfo), +} #[doc = "Operation Job Extended Info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationJobExtendedInfo { @@ -2317,7 +2394,7 @@ pub struct OperationResource { pub name: Option, #[doc = "Operation Extended Info"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, #[doc = "Start time of the operation"] #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] pub start_time: Option, @@ -2389,7 +2466,7 @@ pub struct PolicyParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub data_store_parameters_list: Vec, + pub data_store_parameters_list: Vec, } impl PolicyParameters { pub fn new() -> Self { @@ -2832,7 +2909,7 @@ pub struct RestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl RestoreTargetInfo { pub fn new(restore_target_info_base: RestoreTargetInfoBase, datasource_info: Datasource) -> Self { @@ -2904,6 +2981,13 @@ pub mod restore_target_info_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreTargetInfoBaseUnion { + ItemLevelRestoreTargetInfo(ItemLevelRestoreTargetInfo), + RestoreFilesTargetInfo(RestoreFilesTargetInfo), + RestoreTargetInfo(RestoreTargetInfo), +} #[doc = "Retention tag"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RetentionTag { @@ -3097,7 +3181,7 @@ pub mod secret_store_resource { pub struct SourceLifeCycle { #[doc = "Delete Option"] #[serde(rename = "deleteAfter")] - pub delete_after: DeleteOption, + pub delete_after: DeleteOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "sourceDataStore")] pub source_data_store: DataStoreInfoBase, @@ -3110,7 +3194,7 @@ pub struct SourceLifeCycle { pub target_data_store_copy_settings: Vec, } impl SourceLifeCycle { - pub fn new(delete_after: DeleteOption, source_data_store: DataStoreInfoBase) -> Self { + pub fn new(delete_after: DeleteOptionUnion, source_data_store: DataStoreInfoBase) -> Self { Self { delete_after, source_data_store, @@ -3346,7 +3430,7 @@ pub struct TaggingCriteria { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub criteria: Vec, + pub criteria: Vec, #[doc = "Specifies if tag is default."] #[serde(rename = "isDefault")] pub is_default: bool, @@ -3372,13 +3456,13 @@ impl TaggingCriteria { pub struct TargetCopySetting { #[doc = "Options to copy"] #[serde(rename = "copyAfter")] - pub copy_after: CopyOption, + pub copy_after: CopyOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, } impl TargetCopySetting { - pub fn new(copy_after: CopyOption, data_store: DataStoreInfoBase) -> Self { + pub fn new(copy_after: CopyOptionUnion, data_store: DataStoreInfoBase) -> Self { Self { copy_after, data_store } } } @@ -3469,6 +3553,12 @@ impl TriggerContext { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum TriggerContextUnion { + AdhocBasedTriggerContext(AdhocBasedTriggerContext), + ScheduleBasedTriggerContext(ScheduleBasedTriggerContext), +} #[doc = "Error object used by layers that have access to localized content, and propagate that to user"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserFacingError { @@ -3530,10 +3620,10 @@ impl ValidateForBackupRequest { pub struct ValidateRestoreRequestObject { #[doc = "Azure backup restore request"] #[serde(rename = "restoreRequestObject")] - pub restore_request_object: AzureBackupRestoreRequest, + pub restore_request_object: AzureBackupRestoreRequestUnion, } impl ValidateRestoreRequestObject { - pub fn new(restore_request_object: AzureBackupRestoreRequest) -> Self { + pub fn new(restore_request_object: AzureBackupRestoreRequestUnion) -> Self { Self { restore_request_object } } } diff --git a/services/mgmt/dataprotection/src/package_2022_12/mod.rs b/services/mgmt/dataprotection/src/package_2022_12/mod.rs index 6c6e1108f8..4cb149bde4 100644 --- a/services/mgmt/dataprotection/src/package_2022_12/mod.rs +++ b/services/mgmt/dataprotection/src/package_2022_12/mod.rs @@ -1849,7 +1849,7 @@ pub mod data_protection { &self, subscription_id: impl Into, location: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> check_feature_support::RequestBuilder { check_feature_support::RequestBuilder { client: self.0.clone(), @@ -1868,9 +1868,9 @@ pub mod data_protection { #[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::FeatureValidationResponseBase = serde_json::from_slice(&bytes)?; + let body: models::FeatureValidationResponseBaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1913,7 +1913,7 @@ pub mod data_protection { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) parameters: models::FeatureValidationRequestBase, + pub(crate) parameters: models::FeatureValidationRequestBaseUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1955,8 +1955,8 @@ pub mod data_protection { } } 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`."] @@ -2844,7 +2844,7 @@ pub mod backup_instances { resource_group_name: impl Into, vault_name: impl Into, backup_instance_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> trigger_restore::RequestBuilder { trigger_restore::RequestBuilder { client: self.0.clone(), @@ -4100,7 +4100,7 @@ pub mod backup_instances { pub(crate) resource_group_name: String, pub(crate) vault_name: String, pub(crate) backup_instance_name: String, - pub(crate) parameters: models::AzureBackupRestoreRequest, + pub(crate) parameters: models::AzureBackupRestoreRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/dataprotection/src/package_2022_12/models.rs b/services/mgmt/dataprotection/src/package_2022_12/models.rs index f93f673405..ce7a6a30ce 100644 --- a/services/mgmt/dataprotection/src/package_2022_12/models.rs +++ b/services/mgmt/dataprotection/src/package_2022_12/models.rs @@ -80,6 +80,11 @@ impl AuthCredentials { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AuthCredentialsUnion { + SecretStoreBasedAuthCredentials(SecretStoreBasedAuthCredentials), +} #[doc = "Azure backup discrete RecoveryPoint"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupDiscreteRecoveryPoint { @@ -453,6 +458,11 @@ impl AzureBackupRecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRecoveryPointUnion { + AzureBackupDiscreteRecoveryPoint(AzureBackupDiscreteRecoveryPoint), +} #[doc = "Azure backup recoveryPoint based restore request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRecoveryPointBasedRestoreRequest { @@ -476,7 +486,7 @@ pub struct AzureBackupRecoveryPointResource { pub dpp_resource: DppResource, #[doc = "Azure backup recoveryPoint"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AzureBackupRecoveryPointResource { pub fn new() -> Self { @@ -553,7 +563,7 @@ pub struct AzureBackupRestoreRequest { pub object_type: String, #[doc = "Base class common to RestoreTargetInfo and RestoreFilesTargetInfo"] #[serde(rename = "restoreTargetInfo")] - pub restore_target_info: RestoreTargetInfoBase, + pub restore_target_info: RestoreTargetInfoBaseUnion, #[doc = "Gets or sets the type of the source data store."] #[serde(rename = "sourceDataStoreType")] pub source_data_store_type: azure_backup_restore_request::SourceDataStoreType, @@ -564,7 +574,7 @@ pub struct AzureBackupRestoreRequest { impl AzureBackupRestoreRequest { pub fn new( object_type: String, - restore_target_info: RestoreTargetInfoBase, + restore_target_info: RestoreTargetInfoBaseUnion, source_data_store_type: azure_backup_restore_request::SourceDataStoreType, ) -> Self { Self { @@ -619,6 +629,12 @@ pub mod azure_backup_restore_request { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRestoreRequestUnion { + AzureBackupRecoveryPointBasedRestoreRequest(AzureBackupRecoveryPointBasedRestoreRequest), + AzureBackupRecoveryTimeBasedRestoreRequest(AzureBackupRecoveryTimeBasedRestoreRequest), +} #[doc = "AzureBackup Restore with Rehydration Request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRestoreWithRehydrationRequest { @@ -651,15 +667,15 @@ pub struct AzureBackupRule { pub base_policy_rule: BasePolicyRule, #[doc = "BackupParameters base"] #[serde(rename = "backupParameters", default, skip_serializing_if = "Option::is_none")] - pub backup_parameters: Option, + pub backup_parameters: Option, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, #[doc = "Trigger context"] - pub trigger: TriggerContext, + pub trigger: TriggerContextUnion, } impl AzureBackupRule { - pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContext) -> Self { + pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContextUnion) -> Self { Self { base_policy_rule, backup_parameters: None, @@ -765,6 +781,11 @@ impl BackupCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupCriteriaUnion { + ScheduleBasedBackupCriteria(ScheduleBasedBackupCriteria), +} #[doc = "Backup Instance"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupInstance { @@ -794,7 +815,7 @@ pub struct BackupInstance { pub provisioning_state: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, #[doc = "Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again."] #[serde(rename = "validationType", default, skip_serializing_if = "Option::is_none")] pub validation_type: Option, @@ -971,6 +992,11 @@ impl BackupParameters { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupParametersUnion { + AzureBackupParams(AzureBackupParams), +} #[doc = "Rule based backup policy"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupPolicy { @@ -978,10 +1004,10 @@ pub struct BackupPolicy { pub base_backup_policy: BaseBackupPolicy, #[doc = "Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc"] #[serde(rename = "policyRules")] - pub policy_rules: Vec, + pub policy_rules: Vec, } impl BackupPolicy { - pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { + pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { Self { base_backup_policy, policy_rules, @@ -1204,6 +1230,11 @@ impl BaseBackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BaseBackupPolicyUnion { + BackupPolicy(BackupPolicy), +} #[doc = "BaseBackupPolicy resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BaseBackupPolicyResource { @@ -1211,7 +1242,7 @@ pub struct BaseBackupPolicyResource { pub dpp_resource: DppResource, #[doc = "BackupPolicy base"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BaseBackupPolicyResource { pub fn new() -> Self { @@ -1254,6 +1285,12 @@ impl BasePolicyRule { Self { name, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BasePolicyRuleUnion { + AzureBackupRule(AzureBackupRule), + AzureRetentionRule(AzureRetentionRule), +} #[doc = "CheckNameAvailability Request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckNameAvailabilityRequest { @@ -1445,6 +1482,13 @@ impl CopyOption { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum CopyOptionUnion { + CopyOnExpiryOption(CopyOnExpiryOption), + CustomCopyOption(CustomCopyOption), + ImmediateCopyOption(ImmediateCopyOption), +} #[doc = "CrossSubscriptionRestore Settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CrossSubscriptionRestoreSettings { @@ -1636,6 +1680,11 @@ pub mod data_store_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DataStoreParametersUnion { + AzureOperationalStoreParameters(AzureOperationalStoreParameters), +} #[doc = "Datasource to be backed up"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Datasource { @@ -1741,6 +1790,11 @@ impl DeleteOption { Self { duration, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DeleteOptionUnion { + AbsoluteDeleteOption(AbsoluteDeleteOption), +} #[doc = "Deleted Backup Instance"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeletedBackupInstance { @@ -2168,6 +2222,11 @@ impl FeatureValidationRequestBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationRequestBaseUnion { + FeatureValidationRequest(FeatureValidationRequest), +} #[doc = "Feature Validation Response"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FeatureValidationResponse { @@ -2245,6 +2304,11 @@ impl FeatureValidationResponseBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationResponseBaseUnion { + FeatureValidationResponse(FeatureValidationResponse), +} #[doc = "Immediate copy Option"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImmediateCopyOption { @@ -2340,6 +2404,14 @@ impl ItemLevelRestoreCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum ItemLevelRestoreCriteriaUnion { + #[serde(rename = "KubernetesPVRestoreCriteria")] + KubernetesPvRestoreCriteria(KubernetesPvRestoreCriteria), + KubernetesStorageClassRestoreCriteria(KubernetesStorageClassRestoreCriteria), + RangeBasedItemLevelRestoreCriteria(RangeBasedItemLevelRestoreCriteria), +} #[doc = "Restore target info for Item level restore operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ItemLevelRestoreTargetInfo { @@ -2347,7 +2419,7 @@ pub struct ItemLevelRestoreTargetInfo { pub restore_target_info_base: RestoreTargetInfoBase, #[doc = "Restore Criteria"] #[serde(rename = "restoreCriteria")] - pub restore_criteria: Vec, + pub restore_criteria: Vec, #[doc = "Datasource to be backed up"] #[serde(rename = "datasourceInfo")] pub datasource_info: Datasource, @@ -2356,12 +2428,12 @@ pub struct ItemLevelRestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl ItemLevelRestoreTargetInfo { pub fn new( restore_target_info_base: RestoreTargetInfoBase, - restore_criteria: Vec, + restore_criteria: Vec, datasource_info: Datasource, ) -> Self { Self { @@ -2502,6 +2574,11 @@ impl OperationExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationExtendedInfoUnion { + OperationJobExtendedInfo(OperationJobExtendedInfo), +} #[doc = "Operation Job Extended Info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationJobExtendedInfo { @@ -2536,7 +2613,7 @@ pub struct OperationResource { pub name: Option, #[doc = "Operation Extended Info"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, #[doc = "Start time of the operation"] #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] pub start_time: Option, @@ -2626,7 +2703,7 @@ pub struct PolicyParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub data_store_parameters_list: Vec, + pub data_store_parameters_list: Vec, } impl PolicyParameters { pub fn new() -> Self { @@ -3069,7 +3146,7 @@ pub struct RestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl RestoreTargetInfo { pub fn new(restore_target_info_base: RestoreTargetInfoBase, datasource_info: Datasource) -> Self { @@ -3141,6 +3218,13 @@ pub mod restore_target_info_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreTargetInfoBaseUnion { + ItemLevelRestoreTargetInfo(ItemLevelRestoreTargetInfo), + RestoreFilesTargetInfo(RestoreFilesTargetInfo), + RestoreTargetInfo(RestoreTargetInfo), +} #[doc = "Retention tag"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RetentionTag { @@ -3406,7 +3490,7 @@ pub mod soft_delete_settings { pub struct SourceLifeCycle { #[doc = "Delete Option"] #[serde(rename = "deleteAfter")] - pub delete_after: DeleteOption, + pub delete_after: DeleteOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "sourceDataStore")] pub source_data_store: DataStoreInfoBase, @@ -3419,7 +3503,7 @@ pub struct SourceLifeCycle { pub target_data_store_copy_settings: Vec, } impl SourceLifeCycle { - pub fn new(delete_after: DeleteOption, source_data_store: DataStoreInfoBase) -> Self { + pub fn new(delete_after: DeleteOptionUnion, source_data_store: DataStoreInfoBase) -> Self { Self { delete_after, source_data_store, @@ -3655,7 +3739,7 @@ pub struct TaggingCriteria { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub criteria: Vec, + pub criteria: Vec, #[doc = "Specifies if tag is default."] #[serde(rename = "isDefault")] pub is_default: bool, @@ -3681,13 +3765,13 @@ impl TaggingCriteria { pub struct TargetCopySetting { #[doc = "Options to copy"] #[serde(rename = "copyAfter")] - pub copy_after: CopyOption, + pub copy_after: CopyOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, } impl TargetCopySetting { - pub fn new(copy_after: CopyOption, data_store: DataStoreInfoBase) -> Self { + pub fn new(copy_after: CopyOptionUnion, data_store: DataStoreInfoBase) -> Self { Self { copy_after, data_store } } } @@ -3782,6 +3866,12 @@ impl TriggerContext { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum TriggerContextUnion { + AdhocBasedTriggerContext(AdhocBasedTriggerContext), + ScheduleBasedTriggerContext(ScheduleBasedTriggerContext), +} #[doc = "Error object used by layers that have access to localized content, and propagate that to user"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserFacingError { @@ -3843,10 +3933,10 @@ impl ValidateForBackupRequest { pub struct ValidateRestoreRequestObject { #[doc = "Azure backup restore request"] #[serde(rename = "restoreRequestObject")] - pub restore_request_object: AzureBackupRestoreRequest, + pub restore_request_object: AzureBackupRestoreRequestUnion, } impl ValidateRestoreRequestObject { - pub fn new(restore_request_object: AzureBackupRestoreRequest) -> Self { + pub fn new(restore_request_object: AzureBackupRestoreRequestUnion) -> Self { Self { restore_request_object } } } diff --git a/services/mgmt/dataprotection/src/package_2023_01/mod.rs b/services/mgmt/dataprotection/src/package_2023_01/mod.rs index bc0561617c..ef26fc3319 100644 --- a/services/mgmt/dataprotection/src/package_2023_01/mod.rs +++ b/services/mgmt/dataprotection/src/package_2023_01/mod.rs @@ -1851,7 +1851,7 @@ pub mod data_protection { &self, subscription_id: impl Into, location: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> check_feature_support::RequestBuilder { check_feature_support::RequestBuilder { client: self.0.clone(), @@ -1870,9 +1870,9 @@ pub mod data_protection { #[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::FeatureValidationResponseBase = serde_json::from_slice(&bytes)?; + let body: models::FeatureValidationResponseBaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1915,7 +1915,7 @@ pub mod data_protection { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) parameters: models::FeatureValidationRequestBase, + pub(crate) parameters: models::FeatureValidationRequestBaseUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1957,8 +1957,8 @@ pub mod data_protection { } } 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`."] @@ -2846,7 +2846,7 @@ pub mod backup_instances { resource_group_name: impl Into, vault_name: impl Into, backup_instance_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> trigger_restore::RequestBuilder { trigger_restore::RequestBuilder { client: self.0.clone(), @@ -4172,7 +4172,7 @@ pub mod backup_instances { pub(crate) resource_group_name: String, pub(crate) vault_name: String, pub(crate) backup_instance_name: String, - pub(crate) parameters: models::AzureBackupRestoreRequest, + pub(crate) parameters: models::AzureBackupRestoreRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/dataprotection/src/package_2023_01/models.rs b/services/mgmt/dataprotection/src/package_2023_01/models.rs index 067e7a2e59..f4878e0f6d 100644 --- a/services/mgmt/dataprotection/src/package_2023_01/models.rs +++ b/services/mgmt/dataprotection/src/package_2023_01/models.rs @@ -80,6 +80,11 @@ impl AuthCredentials { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AuthCredentialsUnion { + SecretStoreBasedAuthCredentials(SecretStoreBasedAuthCredentials), +} #[doc = "Azure backup discrete RecoveryPoint"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupDiscreteRecoveryPoint { @@ -453,6 +458,11 @@ impl AzureBackupRecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRecoveryPointUnion { + AzureBackupDiscreteRecoveryPoint(AzureBackupDiscreteRecoveryPoint), +} #[doc = "Azure backup recoveryPoint based restore request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRecoveryPointBasedRestoreRequest { @@ -476,7 +486,7 @@ pub struct AzureBackupRecoveryPointResource { pub dpp_resource: DppResource, #[doc = "Azure backup recoveryPoint"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AzureBackupRecoveryPointResource { pub fn new() -> Self { @@ -553,7 +563,7 @@ pub struct AzureBackupRestoreRequest { pub object_type: String, #[doc = "Base class common to RestoreTargetInfo and RestoreFilesTargetInfo"] #[serde(rename = "restoreTargetInfo")] - pub restore_target_info: RestoreTargetInfoBase, + pub restore_target_info: RestoreTargetInfoBaseUnion, #[doc = "Gets or sets the type of the source data store."] #[serde(rename = "sourceDataStoreType")] pub source_data_store_type: azure_backup_restore_request::SourceDataStoreType, @@ -564,7 +574,7 @@ pub struct AzureBackupRestoreRequest { impl AzureBackupRestoreRequest { pub fn new( object_type: String, - restore_target_info: RestoreTargetInfoBase, + restore_target_info: RestoreTargetInfoBaseUnion, source_data_store_type: azure_backup_restore_request::SourceDataStoreType, ) -> Self { Self { @@ -619,6 +629,12 @@ pub mod azure_backup_restore_request { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRestoreRequestUnion { + AzureBackupRecoveryPointBasedRestoreRequest(AzureBackupRecoveryPointBasedRestoreRequest), + AzureBackupRecoveryTimeBasedRestoreRequest(AzureBackupRecoveryTimeBasedRestoreRequest), +} #[doc = "AzureBackup Restore with Rehydration Request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRestoreWithRehydrationRequest { @@ -651,15 +667,15 @@ pub struct AzureBackupRule { pub base_policy_rule: BasePolicyRule, #[doc = "BackupParameters base"] #[serde(rename = "backupParameters", default, skip_serializing_if = "Option::is_none")] - pub backup_parameters: Option, + pub backup_parameters: Option, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, #[doc = "Trigger context"] - pub trigger: TriggerContext, + pub trigger: TriggerContextUnion, } impl AzureBackupRule { - pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContext) -> Self { + pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContextUnion) -> Self { Self { base_policy_rule, backup_parameters: None, @@ -765,6 +781,11 @@ impl BackupCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupCriteriaUnion { + ScheduleBasedBackupCriteria(ScheduleBasedBackupCriteria), +} #[doc = "Parameters for Backup Datasource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupDatasourceParameters { @@ -777,6 +798,12 @@ impl BackupDatasourceParameters { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupDatasourceParametersUnion { + BlobBackupDatasourceParameters(BlobBackupDatasourceParameters), + KubernetesClusterBackupDatasourceParameters(KubernetesClusterBackupDatasourceParameters), +} #[doc = "Backup Instance"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupInstance { @@ -806,7 +833,7 @@ pub struct BackupInstance { pub provisioning_state: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, #[doc = "Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again."] #[serde(rename = "validationType", default, skip_serializing_if = "Option::is_none")] pub validation_type: Option, @@ -983,6 +1010,11 @@ impl BackupParameters { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupParametersUnion { + AzureBackupParams(AzureBackupParams), +} #[doc = "Rule based backup policy"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupPolicy { @@ -990,10 +1022,10 @@ pub struct BackupPolicy { pub base_backup_policy: BaseBackupPolicy, #[doc = "Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc"] #[serde(rename = "policyRules")] - pub policy_rules: Vec, + pub policy_rules: Vec, } impl BackupPolicy { - pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { + pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { Self { base_backup_policy, policy_rules, @@ -1216,6 +1248,11 @@ impl BaseBackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BaseBackupPolicyUnion { + BackupPolicy(BackupPolicy), +} #[doc = "BaseBackupPolicy resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BaseBackupPolicyResource { @@ -1223,7 +1260,7 @@ pub struct BaseBackupPolicyResource { pub dpp_resource: DppResource, #[doc = "BackupPolicy base"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BaseBackupPolicyResource { pub fn new() -> Self { @@ -1266,6 +1303,12 @@ impl BasePolicyRule { Self { name, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BasePolicyRuleUnion { + AzureBackupRule(AzureBackupRule), + AzureRetentionRule(AzureRetentionRule), +} #[doc = "Parameters to be used during configuration of backup of blobs"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BlobBackupDatasourceParameters { @@ -1474,6 +1517,13 @@ impl CopyOption { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum CopyOptionUnion { + CopyOnExpiryOption(CopyOnExpiryOption), + CustomCopyOption(CustomCopyOption), + ImmediateCopyOption(ImmediateCopyOption), +} #[doc = "CrossSubscriptionRestore Settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CrossSubscriptionRestoreSettings { @@ -1665,6 +1715,11 @@ pub mod data_store_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DataStoreParametersUnion { + AzureOperationalStoreParameters(AzureOperationalStoreParameters), +} #[doc = "Datasource to be backed up"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Datasource { @@ -1770,6 +1825,11 @@ impl DeleteOption { Self { duration, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DeleteOptionUnion { + AbsoluteDeleteOption(AbsoluteDeleteOption), +} #[doc = "Deleted Backup Instance"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeletedBackupInstance { @@ -2197,6 +2257,11 @@ impl FeatureValidationRequestBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationRequestBaseUnion { + FeatureValidationRequest(FeatureValidationRequest), +} #[doc = "Feature Validation Response"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FeatureValidationResponse { @@ -2274,6 +2339,11 @@ impl FeatureValidationResponseBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationResponseBaseUnion { + FeatureValidationResponse(FeatureValidationResponse), +} #[doc = "Immediate copy Option"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImmediateCopyOption { @@ -2369,6 +2439,16 @@ impl ItemLevelRestoreCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum ItemLevelRestoreCriteriaUnion { + ItemPathBasedRestoreCriteria(ItemPathBasedRestoreCriteria), + KubernetesClusterRestoreCriteria(KubernetesClusterRestoreCriteria), + #[serde(rename = "KubernetesPVRestoreCriteria")] + KubernetesPvRestoreCriteria(KubernetesPvRestoreCriteria), + KubernetesStorageClassRestoreCriteria(KubernetesStorageClassRestoreCriteria), + RangeBasedItemLevelRestoreCriteria(RangeBasedItemLevelRestoreCriteria), +} #[doc = "Restore target info for Item level restore operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ItemLevelRestoreTargetInfo { @@ -2376,7 +2456,7 @@ pub struct ItemLevelRestoreTargetInfo { pub restore_target_info_base: RestoreTargetInfoBase, #[doc = "Restore Criteria"] #[serde(rename = "restoreCriteria")] - pub restore_criteria: Vec, + pub restore_criteria: Vec, #[doc = "Datasource to be backed up"] #[serde(rename = "datasourceInfo")] pub datasource_info: Datasource, @@ -2385,12 +2465,12 @@ pub struct ItemLevelRestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl ItemLevelRestoreTargetInfo { pub fn new( restore_target_info_base: RestoreTargetInfoBase, - restore_criteria: Vec, + restore_criteria: Vec, datasource_info: Datasource, ) -> Self { Self { @@ -2786,6 +2866,11 @@ impl OperationExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationExtendedInfoUnion { + OperationJobExtendedInfo(OperationJobExtendedInfo), +} #[doc = "Operation Job Extended Info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationJobExtendedInfo { @@ -2820,7 +2905,7 @@ pub struct OperationResource { pub name: Option, #[doc = "Operation Extended Info"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, #[doc = "Start time of the operation"] #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] pub start_time: Option, @@ -2910,7 +2995,7 @@ pub struct PolicyParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub data_store_parameters_list: Vec, + pub data_store_parameters_list: Vec, #[doc = "Gets or sets the Backup Data Source Parameters"] #[serde( rename = "backupDatasourceParametersList", @@ -2918,7 +3003,7 @@ pub struct PolicyParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub backup_datasource_parameters_list: Vec, + pub backup_datasource_parameters_list: Vec, } impl PolicyParameters { pub fn new() -> Self { @@ -3434,7 +3519,7 @@ pub struct RestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl RestoreTargetInfo { pub fn new(restore_target_info_base: RestoreTargetInfoBase, datasource_info: Datasource) -> Self { @@ -3506,6 +3591,13 @@ pub mod restore_target_info_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreTargetInfoBaseUnion { + ItemLevelRestoreTargetInfo(ItemLevelRestoreTargetInfo), + RestoreFilesTargetInfo(RestoreFilesTargetInfo), + RestoreTargetInfo(RestoreTargetInfo), +} #[doc = "Retention tag"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RetentionTag { @@ -3771,7 +3863,7 @@ pub mod soft_delete_settings { pub struct SourceLifeCycle { #[doc = "Delete Option"] #[serde(rename = "deleteAfter")] - pub delete_after: DeleteOption, + pub delete_after: DeleteOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "sourceDataStore")] pub source_data_store: DataStoreInfoBase, @@ -3784,7 +3876,7 @@ pub struct SourceLifeCycle { pub target_data_store_copy_settings: Vec, } impl SourceLifeCycle { - pub fn new(delete_after: DeleteOption, source_data_store: DataStoreInfoBase) -> Self { + pub fn new(delete_after: DeleteOptionUnion, source_data_store: DataStoreInfoBase) -> Self { Self { delete_after, source_data_store, @@ -4020,7 +4112,7 @@ pub struct TaggingCriteria { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub criteria: Vec, + pub criteria: Vec, #[doc = "Specifies if tag is default."] #[serde(rename = "isDefault")] pub is_default: bool, @@ -4046,13 +4138,13 @@ impl TaggingCriteria { pub struct TargetCopySetting { #[doc = "Options to copy"] #[serde(rename = "copyAfter")] - pub copy_after: CopyOption, + pub copy_after: CopyOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, } impl TargetCopySetting { - pub fn new(copy_after: CopyOption, data_store: DataStoreInfoBase) -> Self { + pub fn new(copy_after: CopyOptionUnion, data_store: DataStoreInfoBase) -> Self { Self { copy_after, data_store } } } @@ -4147,6 +4239,12 @@ impl TriggerContext { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum TriggerContextUnion { + AdhocBasedTriggerContext(AdhocBasedTriggerContext), + ScheduleBasedTriggerContext(ScheduleBasedTriggerContext), +} #[doc = "Request body of unlock delete API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UnlockDeleteRequest { @@ -4238,10 +4336,10 @@ impl ValidateForBackupRequest { pub struct ValidateRestoreRequestObject { #[doc = "Azure backup restore request"] #[serde(rename = "restoreRequestObject")] - pub restore_request_object: AzureBackupRestoreRequest, + pub restore_request_object: AzureBackupRestoreRequestUnion, } impl ValidateRestoreRequestObject { - pub fn new(restore_request_object: AzureBackupRestoreRequest) -> Self { + pub fn new(restore_request_object: AzureBackupRestoreRequestUnion) -> Self { Self { restore_request_object } } } diff --git a/services/mgmt/dataprotection/src/package_2023_05/mod.rs b/services/mgmt/dataprotection/src/package_2023_05/mod.rs index 96552bdbb5..1acaa95b36 100644 --- a/services/mgmt/dataprotection/src/package_2023_05/mod.rs +++ b/services/mgmt/dataprotection/src/package_2023_05/mod.rs @@ -1851,7 +1851,7 @@ pub mod data_protection { &self, subscription_id: impl Into, location: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> check_feature_support::RequestBuilder { check_feature_support::RequestBuilder { client: self.0.clone(), @@ -1870,9 +1870,9 @@ pub mod data_protection { #[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::FeatureValidationResponseBase = serde_json::from_slice(&bytes)?; + let body: models::FeatureValidationResponseBaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1915,7 +1915,7 @@ pub mod data_protection { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) location: String, - pub(crate) parameters: models::FeatureValidationRequestBase, + pub(crate) parameters: models::FeatureValidationRequestBaseUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1957,8 +1957,8 @@ pub mod data_protection { } } 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`."] @@ -2846,7 +2846,7 @@ pub mod backup_instances { resource_group_name: impl Into, vault_name: impl Into, backup_instance_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> trigger_restore::RequestBuilder { trigger_restore::RequestBuilder { client: self.0.clone(), @@ -4172,7 +4172,7 @@ pub mod backup_instances { pub(crate) resource_group_name: String, pub(crate) vault_name: String, pub(crate) backup_instance_name: String, - pub(crate) parameters: models::AzureBackupRestoreRequest, + pub(crate) parameters: models::AzureBackupRestoreRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/dataprotection/src/package_2023_05/models.rs b/services/mgmt/dataprotection/src/package_2023_05/models.rs index 78c9ef8071..b66eedb191 100644 --- a/services/mgmt/dataprotection/src/package_2023_05/models.rs +++ b/services/mgmt/dataprotection/src/package_2023_05/models.rs @@ -80,6 +80,11 @@ impl AuthCredentials { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AuthCredentialsUnion { + SecretStoreBasedAuthCredentials(SecretStoreBasedAuthCredentials), +} #[doc = "Azure backup discrete RecoveryPoint"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupDiscreteRecoveryPoint { @@ -457,6 +462,11 @@ impl AzureBackupRecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRecoveryPointUnion { + AzureBackupDiscreteRecoveryPoint(AzureBackupDiscreteRecoveryPoint), +} #[doc = "Azure backup recoveryPoint based restore request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRecoveryPointBasedRestoreRequest { @@ -480,7 +490,7 @@ pub struct AzureBackupRecoveryPointResource { pub dpp_resource: DppResource, #[doc = "Azure backup recoveryPoint"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AzureBackupRecoveryPointResource { pub fn new() -> Self { @@ -557,7 +567,7 @@ pub struct AzureBackupRestoreRequest { pub object_type: String, #[doc = "Base class common to RestoreTargetInfo and RestoreFilesTargetInfo"] #[serde(rename = "restoreTargetInfo")] - pub restore_target_info: RestoreTargetInfoBase, + pub restore_target_info: RestoreTargetInfoBaseUnion, #[doc = "Gets or sets the type of the source data store."] #[serde(rename = "sourceDataStoreType")] pub source_data_store_type: azure_backup_restore_request::SourceDataStoreType, @@ -570,7 +580,7 @@ pub struct AzureBackupRestoreRequest { impl AzureBackupRestoreRequest { pub fn new( object_type: String, - restore_target_info: RestoreTargetInfoBase, + restore_target_info: RestoreTargetInfoBaseUnion, source_data_store_type: azure_backup_restore_request::SourceDataStoreType, ) -> Self { Self { @@ -626,6 +636,12 @@ pub mod azure_backup_restore_request { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum AzureBackupRestoreRequestUnion { + AzureBackupRecoveryPointBasedRestoreRequest(AzureBackupRecoveryPointBasedRestoreRequest), + AzureBackupRecoveryTimeBasedRestoreRequest(AzureBackupRecoveryTimeBasedRestoreRequest), +} #[doc = "AzureBackup Restore with Rehydration Request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBackupRestoreWithRehydrationRequest { @@ -658,15 +674,15 @@ pub struct AzureBackupRule { pub base_policy_rule: BasePolicyRule, #[doc = "BackupParameters base"] #[serde(rename = "backupParameters", default, skip_serializing_if = "Option::is_none")] - pub backup_parameters: Option, + pub backup_parameters: Option, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, #[doc = "Trigger context"] - pub trigger: TriggerContext, + pub trigger: TriggerContextUnion, } impl AzureBackupRule { - pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContext) -> Self { + pub fn new(base_policy_rule: BasePolicyRule, data_store: DataStoreInfoBase, trigger: TriggerContextUnion) -> Self { Self { base_policy_rule, backup_parameters: None, @@ -772,6 +788,11 @@ impl BackupCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupCriteriaUnion { + ScheduleBasedBackupCriteria(ScheduleBasedBackupCriteria), +} #[doc = "Parameters for Backup Datasource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupDatasourceParameters { @@ -784,6 +805,12 @@ impl BackupDatasourceParameters { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupDatasourceParametersUnion { + BlobBackupDatasourceParameters(BlobBackupDatasourceParameters), + KubernetesClusterBackupDatasourceParameters(KubernetesClusterBackupDatasourceParameters), +} #[doc = "Backup Instance"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupInstance { @@ -813,7 +840,7 @@ pub struct BackupInstance { pub provisioning_state: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, #[doc = "Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again."] #[serde(rename = "validationType", default, skip_serializing_if = "Option::is_none")] pub validation_type: Option, @@ -993,6 +1020,11 @@ impl BackupParameters { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupParametersUnion { + AzureBackupParams(AzureBackupParams), +} #[doc = "Rule based backup policy"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupPolicy { @@ -1000,10 +1032,10 @@ pub struct BackupPolicy { pub base_backup_policy: BaseBackupPolicy, #[doc = "Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc"] #[serde(rename = "policyRules")] - pub policy_rules: Vec, + pub policy_rules: Vec, } impl BackupPolicy { - pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { + pub fn new(base_backup_policy: BaseBackupPolicy, policy_rules: Vec) -> Self { Self { base_backup_policy, policy_rules, @@ -1273,6 +1305,11 @@ impl BaseBackupPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BaseBackupPolicyUnion { + BackupPolicy(BackupPolicy), +} #[doc = "BaseBackupPolicy resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BaseBackupPolicyResource { @@ -1280,7 +1317,7 @@ pub struct BaseBackupPolicyResource { pub dpp_resource: DppResource, #[doc = "BackupPolicy base"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BaseBackupPolicyResource { pub fn new() -> Self { @@ -1323,6 +1360,12 @@ impl BasePolicyRule { Self { name, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BasePolicyRuleUnion { + AzureBackupRule(AzureBackupRule), + AzureRetentionRule(AzureRetentionRule), +} #[doc = "Properties which are specific to datasource/datasourceSets"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BaseResourceProperties { @@ -1373,6 +1416,11 @@ pub mod base_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BaseResourcePropertiesUnion { + DefaultResourceProperties(DefaultResourceProperties), +} #[doc = "Parameters to be used during configuration of backup of blobs"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BlobBackupDatasourceParameters { @@ -1581,6 +1629,13 @@ impl CopyOption { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum CopyOptionUnion { + CopyOnExpiryOption(CopyOnExpiryOption), + CustomCopyOption(CustomCopyOption), + ImmediateCopyOption(ImmediateCopyOption), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CrossRegionRestoreSettings { #[doc = "CrossRegionRestore state"] @@ -1823,6 +1878,11 @@ pub mod data_store_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DataStoreParametersUnion { + AzureOperationalStoreParameters(AzureOperationalStoreParameters), +} #[doc = "Datasource to be backed up"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Datasource { @@ -1849,7 +1909,7 @@ pub struct Datasource { pub resource_uri: Option, #[doc = "Properties which are specific to datasource/datasourceSets"] #[serde(rename = "resourceProperties", default, skip_serializing_if = "Option::is_none")] - pub resource_properties: Option, + pub resource_properties: Option, } impl Datasource { pub fn new(resource_id: String) -> Self { @@ -1891,7 +1951,7 @@ pub struct DatasourceSet { pub resource_uri: Option, #[doc = "Properties which are specific to datasource/datasourceSets"] #[serde(rename = "resourceProperties", default, skip_serializing_if = "Option::is_none")] - pub resource_properties: Option, + pub resource_properties: Option, } impl DatasourceSet { pub fn new(resource_id: String) -> Self { @@ -1947,6 +2007,11 @@ impl DeleteOption { Self { duration, object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DeleteOptionUnion { + AbsoluteDeleteOption(AbsoluteDeleteOption), +} #[doc = "Deleted Backup Instance"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeletedBackupInstance { @@ -2379,6 +2444,11 @@ impl FeatureValidationRequestBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationRequestBaseUnion { + FeatureValidationRequest(FeatureValidationRequest), +} #[doc = "Feature Validation Response"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FeatureValidationResponse { @@ -2456,6 +2526,11 @@ impl FeatureValidationResponseBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum FeatureValidationResponseBaseUnion { + FeatureValidationResponse(FeatureValidationResponse), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityDetails { #[doc = "Specifies if the BI is protected by System Identity."] @@ -2565,6 +2640,16 @@ impl ItemLevelRestoreCriteria { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum ItemLevelRestoreCriteriaUnion { + ItemPathBasedRestoreCriteria(ItemPathBasedRestoreCriteria), + KubernetesClusterRestoreCriteria(KubernetesClusterRestoreCriteria), + #[serde(rename = "KubernetesPVRestoreCriteria")] + KubernetesPvRestoreCriteria(KubernetesPvRestoreCriteria), + KubernetesStorageClassRestoreCriteria(KubernetesStorageClassRestoreCriteria), + RangeBasedItemLevelRestoreCriteria(RangeBasedItemLevelRestoreCriteria), +} #[doc = "Restore target info for Item level restore operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ItemLevelRestoreTargetInfo { @@ -2572,7 +2657,7 @@ pub struct ItemLevelRestoreTargetInfo { pub restore_target_info_base: RestoreTargetInfoBase, #[doc = "Restore Criteria"] #[serde(rename = "restoreCriteria")] - pub restore_criteria: Vec, + pub restore_criteria: Vec, #[doc = "Datasource to be backed up"] #[serde(rename = "datasourceInfo")] pub datasource_info: Datasource, @@ -2581,12 +2666,12 @@ pub struct ItemLevelRestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl ItemLevelRestoreTargetInfo { pub fn new( restore_target_info_base: RestoreTargetInfoBase, - restore_criteria: Vec, + restore_criteria: Vec, datasource_info: Datasource, ) -> Self { Self { @@ -3015,6 +3100,11 @@ impl OperationExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationExtendedInfoUnion { + OperationJobExtendedInfo(OperationJobExtendedInfo), +} #[doc = "Operation Job Extended Info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationJobExtendedInfo { @@ -3049,7 +3139,7 @@ pub struct OperationResource { pub name: Option, #[doc = "Operation Extended Info"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, #[doc = "Start time of the operation"] #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] pub start_time: Option, @@ -3139,7 +3229,7 @@ pub struct PolicyParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub data_store_parameters_list: Vec, + pub data_store_parameters_list: Vec, #[doc = "Gets or sets the Backup Data Source Parameters"] #[serde( rename = "backupDatasourceParametersList", @@ -3147,7 +3237,7 @@ pub struct PolicyParameters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub backup_datasource_parameters_list: Vec, + pub backup_datasource_parameters_list: Vec, } impl PolicyParameters { pub fn new() -> Self { @@ -3663,7 +3753,7 @@ pub struct RestoreTargetInfo { pub datasource_set_info: Option, #[doc = "Base class for different types of authentication credentials."] #[serde(rename = "datasourceAuthCredentials", default, skip_serializing_if = "Option::is_none")] - pub datasource_auth_credentials: Option, + pub datasource_auth_credentials: Option, } impl RestoreTargetInfo { pub fn new(restore_target_info_base: RestoreTargetInfoBase, datasource_info: Datasource) -> Self { @@ -3735,6 +3825,13 @@ pub mod restore_target_info_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreTargetInfoBaseUnion { + ItemLevelRestoreTargetInfo(ItemLevelRestoreTargetInfo), + RestoreFilesTargetInfo(RestoreFilesTargetInfo), + RestoreTargetInfo(RestoreTargetInfo), +} #[doc = "Retention tag"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RetentionTag { @@ -4000,7 +4097,7 @@ pub mod soft_delete_settings { pub struct SourceLifeCycle { #[doc = "Delete Option"] #[serde(rename = "deleteAfter")] - pub delete_after: DeleteOption, + pub delete_after: DeleteOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "sourceDataStore")] pub source_data_store: DataStoreInfoBase, @@ -4013,7 +4110,7 @@ pub struct SourceLifeCycle { pub target_data_store_copy_settings: Vec, } impl SourceLifeCycle { - pub fn new(delete_after: DeleteOption, source_data_store: DataStoreInfoBase) -> Self { + pub fn new(delete_after: DeleteOptionUnion, source_data_store: DataStoreInfoBase) -> Self { Self { delete_after, source_data_store, @@ -4249,7 +4346,7 @@ pub struct TaggingCriteria { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub criteria: Vec, + pub criteria: Vec, #[doc = "Specifies if tag is default."] #[serde(rename = "isDefault")] pub is_default: bool, @@ -4275,13 +4372,13 @@ impl TaggingCriteria { pub struct TargetCopySetting { #[doc = "Options to copy"] #[serde(rename = "copyAfter")] - pub copy_after: CopyOption, + pub copy_after: CopyOptionUnion, #[doc = "DataStoreInfo base"] #[serde(rename = "dataStore")] pub data_store: DataStoreInfoBase, } impl TargetCopySetting { - pub fn new(copy_after: CopyOption, data_store: DataStoreInfoBase) -> Self { + pub fn new(copy_after: CopyOptionUnion, data_store: DataStoreInfoBase) -> Self { Self { copy_after, data_store } } } @@ -4376,6 +4473,12 @@ impl TriggerContext { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum TriggerContextUnion { + AdhocBasedTriggerContext(AdhocBasedTriggerContext), + ScheduleBasedTriggerContext(ScheduleBasedTriggerContext), +} #[doc = "Request body of unlock delete API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UnlockDeleteRequest { @@ -4482,10 +4585,10 @@ impl ValidateForBackupRequest { pub struct ValidateRestoreRequestObject { #[doc = "Azure backup restore request"] #[serde(rename = "restoreRequestObject")] - pub restore_request_object: AzureBackupRestoreRequest, + pub restore_request_object: AzureBackupRestoreRequestUnion, } impl ValidateRestoreRequestObject { - pub fn new(restore_request_object: AzureBackupRestoreRequest) -> Self { + pub fn new(restore_request_object: AzureBackupRestoreRequestUnion) -> Self { Self { restore_request_object } } } diff --git a/services/mgmt/datashare/src/package_2018_11_01_preview/mod.rs b/services/mgmt/datashare/src/package_2018_11_01_preview/mod.rs index 1c062a8e64..23f926ccdc 100644 --- a/services/mgmt/datashare/src/package_2018_11_01_preview/mod.rs +++ b/services/mgmt/datashare/src/package_2018_11_01_preview/mod.rs @@ -1458,7 +1458,7 @@ pub mod data_sets { account_name: impl Into, share_name: impl Into, data_set_name: impl Into, - data_set: impl Into, + data_set: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -1532,9 +1532,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1623,8 +1623,8 @@ pub mod data_sets { } } 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`."] @@ -1644,9 +1644,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1692,7 +1692,7 @@ pub mod data_sets { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) data_set_name: String, - pub(crate) data_set: models::DataSet, + pub(crate) data_set: models::DataSetUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1737,8 +1737,8 @@ pub mod data_sets { } } 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`."] @@ -2050,7 +2050,7 @@ pub mod data_set_mappings { account_name: impl Into, share_subscription_name: impl Into, data_set_mapping_name: impl Into, - data_set_mapping: impl Into, + data_set_mapping: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -2124,9 +2124,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2207,8 +2207,8 @@ pub mod data_set_mappings { } } 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`."] @@ -2228,9 +2228,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2276,7 +2276,7 @@ pub mod data_set_mappings { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) data_set_mapping_name: String, - pub(crate) data_set_mapping: models::DataSetMapping, + pub(crate) data_set_mapping: models::DataSetMappingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2313,8 +2313,8 @@ pub mod data_set_mappings { } } 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`."] @@ -6637,7 +6637,7 @@ pub mod synchronization_settings { account_name: impl Into, share_name: impl Into, synchronization_setting_name: impl Into, - synchronization_setting: impl Into, + synchronization_setting: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -6709,9 +6709,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6800,8 +6800,8 @@ pub mod synchronization_settings { } } 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`."] @@ -6821,9 +6821,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6869,7 +6869,7 @@ pub mod synchronization_settings { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) synchronization_setting_name: String, - pub(crate) synchronization_setting: models::SynchronizationSetting, + pub(crate) synchronization_setting: models::SynchronizationSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6914,8 +6914,8 @@ pub mod synchronization_settings { } } 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`."] @@ -7254,7 +7254,7 @@ pub mod triggers { account_name: impl Into, share_subscription_name: impl Into, trigger_name: impl Into, - trigger: impl Into, + trigger: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -7326,9 +7326,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7417,8 +7417,8 @@ pub mod triggers { } } 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`."] @@ -7438,9 +7438,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7485,7 +7485,7 @@ pub mod triggers { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) trigger_name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7530,8 +7530,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/datashare/src/package_2018_11_01_preview/models.rs b/services/mgmt/datashare/src/package_2018_11_01_preview/models.rs index 0b7c36f019..5804d5d407 100644 --- a/services/mgmt/datashare/src/package_2018_11_01_preview/models.rs +++ b/services/mgmt/datashare/src/package_2018_11_01_preview/models.rs @@ -1812,6 +1812,24 @@ pub mod data_set { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetUnion { + AdlsGen1File(AdlsGen1FileDataSet), + AdlsGen1Folder(AdlsGen1FolderDataSet), + AdlsGen2File(AdlsGen2FileDataSet), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSet), + AdlsGen2Folder(AdlsGen2FolderDataSet), + Container(BlobContainerDataSet), + Blob(BlobDataSet), + BlobFolder(BlobFolderDataSet), + KustoCluster(KustoClusterDataSet), + KustoDatabase(KustoDatabaseDataSet), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSet), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSet), +} #[doc = "List response for get DataSets"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetList { @@ -1819,7 +1837,7 @@ pub struct DataSetList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetList { type Continuation = String; @@ -1828,7 +1846,7 @@ impl azure_core::Continuable for DataSetList { } } impl DataSetList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -1906,6 +1924,22 @@ pub mod data_set_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetMappingUnion { + AdlsGen2File(AdlsGen2FileDataSetMapping), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSetMapping), + AdlsGen2Folder(AdlsGen2FolderDataSetMapping), + Container(BlobContainerDataSetMapping), + Blob(BlobDataSetMapping), + BlobFolder(BlobFolderDataSetMapping), + KustoCluster(KustoClusterDataSetMapping), + KustoDatabase(KustoDatabaseDataSetMapping), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSetMapping), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSetMapping), +} #[doc = "List response for get DataSetMappings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetMappingList { @@ -1913,7 +1947,7 @@ pub struct DataSetMappingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetMappingList { type Continuation = String; @@ -1922,7 +1956,7 @@ impl azure_core::Continuable for DataSetMappingList { } } impl DataSetMappingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4013,6 +4047,11 @@ pub mod source_share_synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SourceShareSynchronizationSettingUnion { + ScheduleBased(ScheduledSourceSynchronizationSetting), +} #[doc = "List response for get source share Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SourceShareSynchronizationSettingList { @@ -4020,7 +4059,7 @@ pub struct SourceShareSynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SourceShareSynchronizationSettingList { type Continuation = String; @@ -4029,7 +4068,7 @@ impl azure_core::Continuable for SourceShareSynchronizationSettingList { } } impl SourceShareSynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4603,6 +4642,11 @@ pub mod synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SynchronizationSettingUnion { + ScheduleBased(ScheduledSynchronizationSetting), +} #[doc = "List response for get Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SynchronizationSettingList { @@ -4610,7 +4654,7 @@ pub struct SynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SynchronizationSettingList { type Continuation = String; @@ -4619,7 +4663,7 @@ impl azure_core::Continuable for SynchronizationSettingList { } } impl SynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4729,6 +4773,11 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + ScheduleBased(ScheduledTrigger), +} #[doc = "List response for get triggers"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TriggerList { @@ -4736,7 +4785,7 @@ pub struct TriggerList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for TriggerList { type Continuation = String; @@ -4745,7 +4794,7 @@ impl azure_core::Continuable for TriggerList { } } impl TriggerList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/datashare/src/package_2019_11_01/mod.rs b/services/mgmt/datashare/src/package_2019_11_01/mod.rs index bdf170a0eb..f1d054e868 100644 --- a/services/mgmt/datashare/src/package_2019_11_01/mod.rs +++ b/services/mgmt/datashare/src/package_2019_11_01/mod.rs @@ -1461,7 +1461,7 @@ pub mod data_sets { account_name: impl Into, share_name: impl Into, data_set_name: impl Into, - data_set: impl Into, + data_set: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -1535,9 +1535,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1626,8 +1626,8 @@ pub mod data_sets { } } 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`."] @@ -1647,9 +1647,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1695,7 +1695,7 @@ pub mod data_sets { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) data_set_name: String, - pub(crate) data_set: models::DataSet, + pub(crate) data_set: models::DataSetUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1740,8 +1740,8 @@ pub mod data_sets { } } 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`."] @@ -2053,7 +2053,7 @@ pub mod data_set_mappings { account_name: impl Into, share_subscription_name: impl Into, data_set_mapping_name: impl Into, - data_set_mapping: impl Into, + data_set_mapping: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -2127,9 +2127,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2210,8 +2210,8 @@ pub mod data_set_mappings { } } 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`."] @@ -2231,9 +2231,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2279,7 +2279,7 @@ pub mod data_set_mappings { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) data_set_mapping_name: String, - pub(crate) data_set_mapping: models::DataSetMapping, + pub(crate) data_set_mapping: models::DataSetMappingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2316,8 +2316,8 @@ pub mod data_set_mappings { } } 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`."] @@ -6889,7 +6889,7 @@ pub mod synchronization_settings { account_name: impl Into, share_name: impl Into, synchronization_setting_name: impl Into, - synchronization_setting: impl Into, + synchronization_setting: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -6961,9 +6961,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7052,8 +7052,8 @@ pub mod synchronization_settings { } } 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`."] @@ -7073,9 +7073,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7121,7 +7121,7 @@ pub mod synchronization_settings { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) synchronization_setting_name: String, - pub(crate) synchronization_setting: models::SynchronizationSetting, + pub(crate) synchronization_setting: models::SynchronizationSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7166,8 +7166,8 @@ pub mod synchronization_settings { } } 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`."] @@ -7506,7 +7506,7 @@ pub mod triggers { account_name: impl Into, share_subscription_name: impl Into, trigger_name: impl Into, - trigger: impl Into, + trigger: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -7578,9 +7578,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7669,8 +7669,8 @@ pub mod triggers { } } 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`."] @@ -7690,9 +7690,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7737,7 +7737,7 @@ pub mod triggers { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) trigger_name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7782,8 +7782,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/datashare/src/package_2019_11_01/models.rs b/services/mgmt/datashare/src/package_2019_11_01/models.rs index 8ffefd166c..b2181b7192 100644 --- a/services/mgmt/datashare/src/package_2019_11_01/models.rs +++ b/services/mgmt/datashare/src/package_2019_11_01/models.rs @@ -1812,6 +1812,24 @@ pub mod data_set { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetUnion { + AdlsGen1File(AdlsGen1FileDataSet), + AdlsGen1Folder(AdlsGen1FolderDataSet), + AdlsGen2File(AdlsGen2FileDataSet), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSet), + AdlsGen2Folder(AdlsGen2FolderDataSet), + Container(BlobContainerDataSet), + Blob(BlobDataSet), + BlobFolder(BlobFolderDataSet), + KustoCluster(KustoClusterDataSet), + KustoDatabase(KustoDatabaseDataSet), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSet), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSet), +} #[doc = "List response for get DataSets"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetList { @@ -1819,7 +1837,7 @@ pub struct DataSetList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetList { type Continuation = String; @@ -1828,7 +1846,7 @@ impl azure_core::Continuable for DataSetList { } } impl DataSetList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -1906,6 +1924,22 @@ pub mod data_set_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetMappingUnion { + AdlsGen2File(AdlsGen2FileDataSetMapping), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSetMapping), + AdlsGen2Folder(AdlsGen2FolderDataSetMapping), + Container(BlobContainerDataSetMapping), + Blob(BlobDataSetMapping), + BlobFolder(BlobFolderDataSetMapping), + KustoCluster(KustoClusterDataSetMapping), + KustoDatabase(KustoDatabaseDataSetMapping), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSetMapping), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSetMapping), +} #[doc = "List response for get DataSetMappings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetMappingList { @@ -1913,7 +1947,7 @@ pub struct DataSetMappingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetMappingList { type Continuation = String; @@ -1922,7 +1956,7 @@ impl azure_core::Continuable for DataSetMappingList { } } impl DataSetMappingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4085,6 +4119,11 @@ pub mod source_share_synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SourceShareSynchronizationSettingUnion { + ScheduleBased(ScheduledSourceSynchronizationSetting), +} #[doc = "List response for get source share Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SourceShareSynchronizationSettingList { @@ -4092,7 +4131,7 @@ pub struct SourceShareSynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SourceShareSynchronizationSettingList { type Continuation = String; @@ -4101,7 +4140,7 @@ impl azure_core::Continuable for SourceShareSynchronizationSettingList { } } impl SourceShareSynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4675,6 +4714,11 @@ pub mod synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SynchronizationSettingUnion { + ScheduleBased(ScheduledSynchronizationSetting), +} #[doc = "List response for get Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SynchronizationSettingList { @@ -4682,7 +4726,7 @@ pub struct SynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SynchronizationSettingList { type Continuation = String; @@ -4691,7 +4735,7 @@ impl azure_core::Continuable for SynchronizationSettingList { } } impl SynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4801,6 +4845,11 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + ScheduleBased(ScheduledTrigger), +} #[doc = "List response for get triggers"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TriggerList { @@ -4808,7 +4857,7 @@ pub struct TriggerList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for TriggerList { type Continuation = String; @@ -4817,7 +4866,7 @@ impl azure_core::Continuable for TriggerList { } } impl TriggerList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/datashare/src/package_2020_09_01/mod.rs b/services/mgmt/datashare/src/package_2020_09_01/mod.rs index 740f962230..a7b9c4e0a1 100644 --- a/services/mgmt/datashare/src/package_2020_09_01/mod.rs +++ b/services/mgmt/datashare/src/package_2020_09_01/mod.rs @@ -1461,7 +1461,7 @@ pub mod data_sets { account_name: impl Into, share_name: impl Into, data_set_name: impl Into, - data_set: impl Into, + data_set: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -1535,9 +1535,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1626,8 +1626,8 @@ pub mod data_sets { } } 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`."] @@ -1647,9 +1647,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1695,7 +1695,7 @@ pub mod data_sets { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) data_set_name: String, - pub(crate) data_set: models::DataSet, + pub(crate) data_set: models::DataSetUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1740,8 +1740,8 @@ pub mod data_sets { } } 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`."] @@ -2053,7 +2053,7 @@ pub mod data_set_mappings { account_name: impl Into, share_subscription_name: impl Into, data_set_mapping_name: impl Into, - data_set_mapping: impl Into, + data_set_mapping: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -2127,9 +2127,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2210,8 +2210,8 @@ pub mod data_set_mappings { } } 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`."] @@ -2231,9 +2231,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2279,7 +2279,7 @@ pub mod data_set_mappings { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) data_set_mapping_name: String, - pub(crate) data_set_mapping: models::DataSetMapping, + pub(crate) data_set_mapping: models::DataSetMappingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2316,8 +2316,8 @@ pub mod data_set_mappings { } } 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`."] @@ -7028,7 +7028,7 @@ pub mod synchronization_settings { account_name: impl Into, share_name: impl Into, synchronization_setting_name: impl Into, - synchronization_setting: impl Into, + synchronization_setting: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -7100,9 +7100,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7191,8 +7191,8 @@ pub mod synchronization_settings { } } 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`."] @@ -7212,9 +7212,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7260,7 +7260,7 @@ pub mod synchronization_settings { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) synchronization_setting_name: String, - pub(crate) synchronization_setting: models::SynchronizationSetting, + pub(crate) synchronization_setting: models::SynchronizationSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7305,8 +7305,8 @@ pub mod synchronization_settings { } } 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`."] @@ -7645,7 +7645,7 @@ pub mod triggers { account_name: impl Into, share_subscription_name: impl Into, trigger_name: impl Into, - trigger: impl Into, + trigger: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -7717,9 +7717,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7808,8 +7808,8 @@ pub mod triggers { } } 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`."] @@ -7829,9 +7829,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7876,7 +7876,7 @@ pub mod triggers { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) trigger_name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7921,8 +7921,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/datashare/src/package_2020_09_01/models.rs b/services/mgmt/datashare/src/package_2020_09_01/models.rs index a30187a9ee..39a06d2a14 100644 --- a/services/mgmt/datashare/src/package_2020_09_01/models.rs +++ b/services/mgmt/datashare/src/package_2020_09_01/models.rs @@ -1822,6 +1822,25 @@ pub mod data_set { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetUnion { + AdlsGen1File(AdlsGen1FileDataSet), + AdlsGen1Folder(AdlsGen1FolderDataSet), + AdlsGen2File(AdlsGen2FileDataSet), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSet), + AdlsGen2Folder(AdlsGen2FolderDataSet), + Container(BlobContainerDataSet), + Blob(BlobDataSet), + BlobFolder(BlobFolderDataSet), + KustoCluster(KustoClusterDataSet), + KustoDatabase(KustoDatabaseDataSet), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSet), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSet), + SynapseWorkspaceSqlPoolTable(SynapseWorkspaceSqlPoolTableDataSet), +} #[doc = "List response for get DataSets"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetList { @@ -1829,7 +1848,7 @@ pub struct DataSetList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetList { type Continuation = String; @@ -1838,7 +1857,7 @@ impl azure_core::Continuable for DataSetList { } } impl DataSetList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -1918,6 +1937,23 @@ pub mod data_set_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetMappingUnion { + AdlsGen2File(AdlsGen2FileDataSetMapping), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSetMapping), + AdlsGen2Folder(AdlsGen2FolderDataSetMapping), + Container(BlobContainerDataSetMapping), + Blob(BlobDataSetMapping), + BlobFolder(BlobFolderDataSetMapping), + KustoCluster(KustoClusterDataSetMapping), + KustoDatabase(KustoDatabaseDataSetMapping), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSetMapping), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSetMapping), + SynapseWorkspaceSqlPoolTable(SynapseWorkspaceSqlPoolTableDataSetMapping), +} #[doc = "List response for get DataSetMappings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetMappingList { @@ -1925,7 +1961,7 @@ pub struct DataSetMappingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetMappingList { type Continuation = String; @@ -1934,7 +1970,7 @@ impl azure_core::Continuable for DataSetMappingList { } } impl DataSetMappingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4110,6 +4146,11 @@ pub mod source_share_synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SourceShareSynchronizationSettingUnion { + ScheduleBased(ScheduledSourceSynchronizationSetting), +} #[doc = "List response for get source share Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SourceShareSynchronizationSettingList { @@ -4117,7 +4158,7 @@ pub struct SourceShareSynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SourceShareSynchronizationSettingList { type Continuation = String; @@ -4126,7 +4167,7 @@ impl azure_core::Continuable for SourceShareSynchronizationSettingList { } } impl SourceShareSynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4860,6 +4901,11 @@ pub mod synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SynchronizationSettingUnion { + ScheduleBased(ScheduledSynchronizationSetting), +} #[doc = "List response for get Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SynchronizationSettingList { @@ -4867,7 +4913,7 @@ pub struct SynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SynchronizationSettingList { type Continuation = String; @@ -4876,7 +4922,7 @@ impl azure_core::Continuable for SynchronizationSettingList { } } impl SynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5098,6 +5144,11 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + ScheduleBased(ScheduledTrigger), +} #[doc = "List response for get triggers"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TriggerList { @@ -5105,7 +5156,7 @@ pub struct TriggerList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for TriggerList { type Continuation = String; @@ -5114,7 +5165,7 @@ impl azure_core::Continuable for TriggerList { } } impl TriggerList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/datashare/src/package_2020_10_01_preview/mod.rs b/services/mgmt/datashare/src/package_2020_10_01_preview/mod.rs index b1d42a5d10..2334274b74 100644 --- a/services/mgmt/datashare/src/package_2020_10_01_preview/mod.rs +++ b/services/mgmt/datashare/src/package_2020_10_01_preview/mod.rs @@ -1458,7 +1458,7 @@ pub mod data_sets { account_name: impl Into, share_name: impl Into, data_set_name: impl Into, - data_set: impl Into, + data_set: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -1532,9 +1532,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1623,8 +1623,8 @@ pub mod data_sets { } } 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`."] @@ -1644,9 +1644,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1692,7 +1692,7 @@ pub mod data_sets { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) data_set_name: String, - pub(crate) data_set: models::DataSet, + pub(crate) data_set: models::DataSetUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1737,8 +1737,8 @@ pub mod data_sets { } } 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`."] @@ -2050,7 +2050,7 @@ pub mod data_set_mappings { account_name: impl Into, share_subscription_name: impl Into, data_set_mapping_name: impl Into, - data_set_mapping: impl Into, + data_set_mapping: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -2124,9 +2124,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2207,8 +2207,8 @@ pub mod data_set_mappings { } } 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`."] @@ -2228,9 +2228,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2276,7 +2276,7 @@ pub mod data_set_mappings { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) data_set_mapping_name: String, - pub(crate) data_set_mapping: models::DataSetMapping, + pub(crate) data_set_mapping: models::DataSetMappingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2313,8 +2313,8 @@ pub mod data_set_mappings { } } 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`."] @@ -6776,7 +6776,7 @@ pub mod synchronization_settings { account_name: impl Into, share_name: impl Into, synchronization_setting_name: impl Into, - synchronization_setting: impl Into, + synchronization_setting: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -6848,9 +6848,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6939,8 +6939,8 @@ pub mod synchronization_settings { } } 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`."] @@ -6960,9 +6960,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7008,7 +7008,7 @@ pub mod synchronization_settings { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) synchronization_setting_name: String, - pub(crate) synchronization_setting: models::SynchronizationSetting, + pub(crate) synchronization_setting: models::SynchronizationSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7053,8 +7053,8 @@ pub mod synchronization_settings { } } 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`."] @@ -7393,7 +7393,7 @@ pub mod triggers { account_name: impl Into, share_subscription_name: impl Into, trigger_name: impl Into, - trigger: impl Into, + trigger: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -7465,9 +7465,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7556,8 +7556,8 @@ pub mod triggers { } } 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`."] @@ -7577,9 +7577,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7624,7 +7624,7 @@ pub mod triggers { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) trigger_name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7669,8 +7669,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/datashare/src/package_2020_10_01_preview/models.rs b/services/mgmt/datashare/src/package_2020_10_01_preview/models.rs index 91f06f34be..ce2bc2d113 100644 --- a/services/mgmt/datashare/src/package_2020_10_01_preview/models.rs +++ b/services/mgmt/datashare/src/package_2020_10_01_preview/models.rs @@ -2230,6 +2230,27 @@ pub mod data_set { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetUnion { + AdlsGen1File(AdlsGen1FileDataSet), + AdlsGen1Folder(AdlsGen1FolderDataSet), + AdlsGen2File(AdlsGen2FileDataSet), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSet), + AdlsGen2Folder(AdlsGen2FolderDataSet), + AdlsGen2StorageAccount(AdlsGen2StorageAccountDataSet), + Container(BlobContainerDataSet), + Blob(BlobDataSet), + BlobFolder(BlobFolderDataSet), + BlobStorageAccount(BlobStorageAccountDataSet), + KustoCluster(KustoClusterDataSet), + KustoDatabase(KustoDatabaseDataSet), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSet), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSet), + SynapseWorkspaceSqlPoolTable(SynapseWorkspaceSqlPoolTableDataSet), +} #[doc = "List response for get DataSets"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetList { @@ -2237,7 +2258,7 @@ pub struct DataSetList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetList { type Continuation = String; @@ -2246,7 +2267,7 @@ impl azure_core::Continuable for DataSetList { } } impl DataSetList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -2330,6 +2351,25 @@ pub mod data_set_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetMappingUnion { + AdlsGen2File(AdlsGen2FileDataSetMapping), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSetMapping), + AdlsGen2Folder(AdlsGen2FolderDataSetMapping), + AdlsGen2StorageAccount(AdlsGen2StorageAccountDataSetMapping), + Container(BlobContainerDataSetMapping), + Blob(BlobDataSetMapping), + BlobFolder(BlobFolderDataSetMapping), + BlobStorageAccount(BlobStorageAccountDataSetMapping), + KustoCluster(KustoClusterDataSetMapping), + KustoDatabase(KustoDatabaseDataSetMapping), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSetMapping), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSetMapping), + SynapseWorkspaceSqlPoolTable(SynapseWorkspaceSqlPoolTableDataSetMapping), +} #[doc = "List response for get DataSetMappings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetMappingList { @@ -2337,7 +2377,7 @@ pub struct DataSetMappingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetMappingList { type Continuation = String; @@ -2346,7 +2386,7 @@ impl azure_core::Continuable for DataSetMappingList { } } impl DataSetMappingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4454,6 +4494,11 @@ pub mod source_share_synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SourceShareSynchronizationSettingUnion { + ScheduleBased(ScheduledSourceSynchronizationSetting), +} #[doc = "List response for get source share Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SourceShareSynchronizationSettingList { @@ -4461,7 +4506,7 @@ pub struct SourceShareSynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SourceShareSynchronizationSettingList { type Continuation = String; @@ -4470,7 +4515,7 @@ impl azure_core::Continuable for SourceShareSynchronizationSettingList { } } impl SourceShareSynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5208,6 +5253,11 @@ pub mod synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SynchronizationSettingUnion { + ScheduleBased(ScheduledSynchronizationSetting), +} #[doc = "List response for get Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SynchronizationSettingList { @@ -5215,7 +5265,7 @@ pub struct SynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SynchronizationSettingList { type Continuation = String; @@ -5224,7 +5274,7 @@ impl azure_core::Continuable for SynchronizationSettingList { } } impl SynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5446,6 +5496,11 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + ScheduleBased(ScheduledTrigger), +} #[doc = "List response for get triggers"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TriggerList { @@ -5453,7 +5508,7 @@ pub struct TriggerList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for TriggerList { type Continuation = String; @@ -5462,7 +5517,7 @@ impl azure_core::Continuable for TriggerList { } } impl TriggerList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/datashare/src/package_2021_08_01/mod.rs b/services/mgmt/datashare/src/package_2021_08_01/mod.rs index a8f9843f17..d3564e4fb0 100644 --- a/services/mgmt/datashare/src/package_2021_08_01/mod.rs +++ b/services/mgmt/datashare/src/package_2021_08_01/mod.rs @@ -1461,7 +1461,7 @@ pub mod data_sets { account_name: impl Into, share_name: impl Into, data_set_name: impl Into, - data_set: impl Into, + data_set: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -1535,9 +1535,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1626,8 +1626,8 @@ pub mod data_sets { } } 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`."] @@ -1647,9 +1647,9 @@ pub mod data_sets { #[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::DataSet = serde_json::from_slice(&bytes)?; + let body: models::DataSetUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1695,7 +1695,7 @@ pub mod data_sets { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) data_set_name: String, - pub(crate) data_set: models::DataSet, + pub(crate) data_set: models::DataSetUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1740,8 +1740,8 @@ pub mod data_sets { } } 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`."] @@ -2053,7 +2053,7 @@ pub mod data_set_mappings { account_name: impl Into, share_subscription_name: impl Into, data_set_mapping_name: impl Into, - data_set_mapping: impl Into, + data_set_mapping: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -2127,9 +2127,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2210,8 +2210,8 @@ pub mod data_set_mappings { } } 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`."] @@ -2231,9 +2231,9 @@ pub mod data_set_mappings { #[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::DataSetMapping = serde_json::from_slice(&bytes)?; + let body: models::DataSetMappingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2279,7 +2279,7 @@ pub mod data_set_mappings { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) data_set_mapping_name: String, - pub(crate) data_set_mapping: models::DataSetMapping, + pub(crate) data_set_mapping: models::DataSetMappingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2316,8 +2316,8 @@ pub mod data_set_mappings { } } 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`."] @@ -7028,7 +7028,7 @@ pub mod synchronization_settings { account_name: impl Into, share_name: impl Into, synchronization_setting_name: impl Into, - synchronization_setting: impl Into, + synchronization_setting: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -7100,9 +7100,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7191,8 +7191,8 @@ pub mod synchronization_settings { } } 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`."] @@ -7212,9 +7212,9 @@ pub mod synchronization_settings { #[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::SynchronizationSetting = serde_json::from_slice(&bytes)?; + let body: models::SynchronizationSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7260,7 +7260,7 @@ pub mod synchronization_settings { pub(crate) account_name: String, pub(crate) share_name: String, pub(crate) synchronization_setting_name: String, - pub(crate) synchronization_setting: models::SynchronizationSetting, + pub(crate) synchronization_setting: models::SynchronizationSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7305,8 +7305,8 @@ pub mod synchronization_settings { } } 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`."] @@ -7645,7 +7645,7 @@ pub mod triggers { account_name: impl Into, share_subscription_name: impl Into, trigger_name: impl Into, - trigger: impl Into, + trigger: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -7717,9 +7717,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7808,8 +7808,8 @@ pub mod triggers { } } 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`."] @@ -7829,9 +7829,9 @@ pub mod triggers { #[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::Trigger = serde_json::from_slice(&bytes)?; + let body: models::TriggerUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7876,7 +7876,7 @@ pub mod triggers { pub(crate) account_name: String, pub(crate) share_subscription_name: String, pub(crate) trigger_name: String, - pub(crate) trigger: models::Trigger, + pub(crate) trigger: models::TriggerUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7921,8 +7921,8 @@ pub mod triggers { } } 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."] diff --git a/services/mgmt/datashare/src/package_2021_08_01/models.rs b/services/mgmt/datashare/src/package_2021_08_01/models.rs index f0b3233003..3a5f0141c8 100644 --- a/services/mgmt/datashare/src/package_2021_08_01/models.rs +++ b/services/mgmt/datashare/src/package_2021_08_01/models.rs @@ -1826,6 +1826,26 @@ pub mod data_set { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetUnion { + AdlsGen1File(AdlsGen1FileDataSet), + AdlsGen1Folder(AdlsGen1FolderDataSet), + AdlsGen2File(AdlsGen2FileDataSet), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSet), + AdlsGen2Folder(AdlsGen2FolderDataSet), + Container(BlobContainerDataSet), + Blob(BlobDataSet), + BlobFolder(BlobFolderDataSet), + KustoCluster(KustoClusterDataSet), + KustoDatabase(KustoDatabaseDataSet), + KustoTable(KustoTableDataSet), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSet), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSet), + SynapseWorkspaceSqlPoolTable(SynapseWorkspaceSqlPoolTableDataSet), +} #[doc = "List response for get DataSets"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetList { @@ -1833,7 +1853,7 @@ pub struct DataSetList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetList { type Continuation = String; @@ -1842,7 +1862,7 @@ impl azure_core::Continuable for DataSetList { } } impl DataSetList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -1924,6 +1944,24 @@ pub mod data_set_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataSetMappingUnion { + AdlsGen2File(AdlsGen2FileDataSetMapping), + AdlsGen2FileSystem(AdlsGen2FileSystemDataSetMapping), + AdlsGen2Folder(AdlsGen2FolderDataSetMapping), + Container(BlobContainerDataSetMapping), + Blob(BlobDataSetMapping), + BlobFolder(BlobFolderDataSetMapping), + KustoCluster(KustoClusterDataSetMapping), + KustoDatabase(KustoDatabaseDataSetMapping), + KustoTable(KustoTableDataSetMapping), + #[serde(rename = "SqlDBTable")] + SqlDbTable(SqlDbTableDataSetMapping), + #[serde(rename = "SqlDWTable")] + SqlDwTable(SqlDwTableDataSetMapping), + SynapseWorkspaceSqlPoolTable(SynapseWorkspaceSqlPoolTableDataSetMapping), +} #[doc = "List response for get DataSetMappings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataSetMappingList { @@ -1931,7 +1969,7 @@ pub struct DataSetMappingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataSetMappingList { type Continuation = String; @@ -1940,7 +1978,7 @@ impl azure_core::Continuable for DataSetMappingList { } } impl DataSetMappingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4334,6 +4372,11 @@ pub mod source_share_synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SourceShareSynchronizationSettingUnion { + ScheduleBased(ScheduledSourceSynchronizationSetting), +} #[doc = "List response for get source share Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SourceShareSynchronizationSettingList { @@ -4341,7 +4384,7 @@ pub struct SourceShareSynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SourceShareSynchronizationSettingList { type Continuation = String; @@ -4350,7 +4393,7 @@ impl azure_core::Continuable for SourceShareSynchronizationSettingList { } } impl SourceShareSynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5086,6 +5129,11 @@ pub mod synchronization_setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SynchronizationSettingUnion { + ScheduleBased(ScheduledSynchronizationSetting), +} #[doc = "List response for get Synchronization settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SynchronizationSettingList { @@ -5093,7 +5141,7 @@ pub struct SynchronizationSettingList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SynchronizationSettingList { type Continuation = String; @@ -5102,7 +5150,7 @@ impl azure_core::Continuable for SynchronizationSettingList { } } impl SynchronizationSettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5381,6 +5429,11 @@ pub mod trigger { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerUnion { + ScheduleBased(ScheduledTrigger), +} #[doc = "List response for get triggers"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TriggerList { @@ -5388,7 +5441,7 @@ pub struct TriggerList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for TriggerList { type Continuation = String; @@ -5397,7 +5450,7 @@ impl azure_core::Continuable for TriggerList { } } impl TriggerList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/deploymentmanager/src/package_2019_11_01_preview/models.rs b/services/mgmt/deploymentmanager/src/package_2019_11_01_preview/models.rs index e85cf473b1..067fe24ba6 100644 --- a/services/mgmt/deploymentmanager/src/package_2019_11_01_preview/models.rs +++ b/services/mgmt/deploymentmanager/src/package_2019_11_01_preview/models.rs @@ -68,10 +68,10 @@ pub struct ArtifactSourceProperties { #[serde(rename = "artifactRoot", default, skip_serializing_if = "Option::is_none")] pub artifact_root: Option, #[doc = "Defines the authentication method and properties to access the artifacts."] - pub authentication: Authentication, + pub authentication: AuthenticationUnion, } impl ArtifactSourceProperties { - pub fn new(source_type: String, authentication: Authentication) -> Self { + pub fn new(source_type: String, authentication: AuthenticationUnion) -> Self { Self { source_type, artifact_root: None, @@ -91,6 +91,11 @@ impl Authentication { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AuthenticationUnion { + Sas(SasAuthentication), +} #[doc = "The error information object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloudError { @@ -154,16 +159,22 @@ impl HealthCheckStepAttributes { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum HealthCheckStepAttributesUnion { + #[serde(rename = "REST")] + Rest(RestHealthCheckStepAttributes), +} #[doc = "Defines the properties of a health check step."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HealthCheckStepProperties { #[serde(flatten)] pub step_properties: StepProperties, #[doc = "The attributes for the health check step."] - pub attributes: HealthCheckStepAttributes, + pub attributes: HealthCheckStepAttributesUnion, } impl HealthCheckStepProperties { - pub fn new(step_properties: StepProperties, attributes: HealthCheckStepAttributes) -> Self { + pub fn new(step_properties: StepProperties, attributes: HealthCheckStepAttributesUnion) -> Self { Self { step_properties, attributes, @@ -368,10 +379,10 @@ pub struct RestRequest { #[doc = "The HTTP URI to use for the request."] pub uri: String, #[doc = "The authentication information required in the REST health check request to the health provider."] - pub authentication: RestRequestAuthentication, + pub authentication: RestRequestAuthenticationUnion, } impl RestRequest { - pub fn new(method: rest_request::Method, uri: String, authentication: RestRequestAuthentication) -> Self { + pub fn new(method: rest_request::Method, uri: String, authentication: RestRequestAuthenticationUnion) -> Self { Self { method, uri, @@ -411,6 +422,12 @@ pub mod rest_request_authentication { RolloutIdentity, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum RestRequestAuthenticationUnion { + ApiKey(ApiKeyAuthentication), + RolloutIdentity(RolloutIdentityAuthentication), +} #[doc = "The properties that make up the expected REST response"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestResponse { @@ -938,16 +955,22 @@ pub mod step_properties { HealthCheck, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "stepType")] +pub enum StepPropertiesUnion { + HealthCheck(HealthCheckStepProperties), + Wait(WaitStepProperties), +} #[doc = "The resource representation of a rollout step."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StepResource { #[serde(flatten)] pub tracked_resource: TrackedResource, #[doc = "The properties of a step resource."] - pub properties: StepProperties, + pub properties: StepPropertiesUnion, } impl StepResource { - pub fn new(tracked_resource: TrackedResource, properties: StepProperties) -> Self { + pub fn new(tracked_resource: TrackedResource, properties: StepPropertiesUnion) -> Self { Self { tracked_resource, properties, diff --git a/services/mgmt/devops/src/package_2020_07_13_preview/models.rs b/services/mgmt/devops/src/package_2020_07_13_preview/models.rs index bb359ed3fc..a393bff3cf 100644 --- a/services/mgmt/devops/src/package_2020_07_13_preview/models.rs +++ b/services/mgmt/devops/src/package_2020_07_13_preview/models.rs @@ -366,13 +366,13 @@ pub struct Pipeline { #[serde(flatten)] pub resource: Resource, #[doc = "Custom properties of a Pipeline."] - pub properties: PipelineProperties, + pub properties: PipelinePropertiesUnion, #[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 Pipeline { - pub fn new(properties: PipelineProperties) -> Self { + pub fn new(properties: PipelinePropertiesUnion) -> Self { Self { resource: Resource::default(), properties, @@ -469,6 +469,14 @@ pub mod pipeline_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "pipelineType")] +pub enum PipelinePropertiesUnion { + #[serde(rename = "azurePipeline")] + AzurePipeline(AzurePipelineProperties), + #[serde(rename = "githubWorkflow")] + GithubWorkflow(GithubWorkflowProperties), +} #[doc = "Template used to bootstrap the pipeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PipelineTemplate { diff --git a/services/mgmt/devspaces/src/package_2019_04_01/models.rs b/services/mgmt/devspaces/src/package_2019_04_01/models.rs index ac8d285d8a..684129a394 100644 --- a/services/mgmt/devspaces/src/package_2019_04_01/models.rs +++ b/services/mgmt/devspaces/src/package_2019_04_01/models.rs @@ -39,7 +39,7 @@ impl Controller { pub struct ControllerConnectionDetails { #[doc = "Base class for types that supply values used to connect to container orchestrators"] #[serde(rename = "orchestratorSpecificConnectionDetails", default, skip_serializing_if = "Option::is_none")] - pub orchestrator_specific_connection_details: Option, + pub orchestrator_specific_connection_details: Option, } impl ControllerConnectionDetails { pub fn new() -> Self { @@ -268,6 +268,11 @@ impl OrchestratorSpecificConnectionDetails { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum OrchestratorSpecificConnectionDetailsUnion { + Kubernetes(KubernetesConnectionDetails), +} #[doc = "An Azure resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Resource { diff --git a/services/mgmt/digitaltwins/src/package_2020_12/models.rs b/services/mgmt/digitaltwins/src/package_2020_12/models.rs index 1a08c0ef23..efe2d7f0c2 100644 --- a/services/mgmt/digitaltwins/src/package_2020_12/models.rs +++ b/services/mgmt/digitaltwins/src/package_2020_12/models.rs @@ -264,10 +264,10 @@ pub struct DigitalTwinsEndpointResource { #[serde(flatten)] pub external_resource: ExternalResource, #[doc = "Properties related to Digital Twins Endpoint"] - pub properties: DigitalTwinsEndpointResourceProperties, + pub properties: DigitalTwinsEndpointResourcePropertiesUnion, } impl DigitalTwinsEndpointResource { - pub fn new(properties: DigitalTwinsEndpointResourceProperties) -> Self { + pub fn new(properties: DigitalTwinsEndpointResourcePropertiesUnion) -> Self { Self { external_resource: ExternalResource::default(), properties, @@ -467,6 +467,13 @@ pub mod digital_twins_endpoint_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum DigitalTwinsEndpointResourcePropertiesUnion { + EventGrid(EventGrid), + EventHub(EventHub), + ServiceBus(ServiceBus), +} #[doc = "The managed identity for the DigitalTwinsInstance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DigitalTwinsIdentity { diff --git a/services/mgmt/digitaltwins/src/package_2021_06_30_preview/models.rs b/services/mgmt/digitaltwins/src/package_2021_06_30_preview/models.rs index d19997f24f..f0da452c5a 100644 --- a/services/mgmt/digitaltwins/src/package_2021_06_30_preview/models.rs +++ b/services/mgmt/digitaltwins/src/package_2021_06_30_preview/models.rs @@ -319,10 +319,10 @@ pub struct DigitalTwinsEndpointResource { #[serde(flatten)] pub external_resource: ExternalResource, #[doc = "Properties related to Digital Twins Endpoint"] - pub properties: DigitalTwinsEndpointResourceProperties, + pub properties: DigitalTwinsEndpointResourcePropertiesUnion, } impl DigitalTwinsEndpointResource { - pub fn new(properties: DigitalTwinsEndpointResourceProperties) -> Self { + pub fn new(properties: DigitalTwinsEndpointResourcePropertiesUnion) -> Self { Self { external_resource: ExternalResource::default(), properties, @@ -522,6 +522,13 @@ pub mod digital_twins_endpoint_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum DigitalTwinsEndpointResourcePropertiesUnion { + EventGrid(EventGrid), + EventHub(EventHub), + ServiceBus(ServiceBus), +} #[doc = "The managed identity for the DigitalTwinsInstance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DigitalTwinsIdentity { @@ -1278,7 +1285,7 @@ pub struct TimeSeriesDatabaseConnection { pub external_resource: ExternalResource, #[doc = "Properties of a time series database connection resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl TimeSeriesDatabaseConnection { pub fn new() -> Self { @@ -1421,3 +1428,8 @@ pub mod time_series_database_connection_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "connectionType")] +pub enum TimeSeriesDatabaseConnectionPropertiesUnion { + AzureDataExplorer(AzureDataExplorerConnectionProperties), +} diff --git a/services/mgmt/digitaltwins/src/package_2022_05/models.rs b/services/mgmt/digitaltwins/src/package_2022_05/models.rs index 6d234d8f62..e574a908a1 100644 --- a/services/mgmt/digitaltwins/src/package_2022_05/models.rs +++ b/services/mgmt/digitaltwins/src/package_2022_05/models.rs @@ -319,10 +319,10 @@ pub struct DigitalTwinsEndpointResource { #[serde(flatten)] pub external_resource: ExternalResource, #[doc = "Properties related to Digital Twins Endpoint"] - pub properties: DigitalTwinsEndpointResourceProperties, + pub properties: DigitalTwinsEndpointResourcePropertiesUnion, } impl DigitalTwinsEndpointResource { - pub fn new(properties: DigitalTwinsEndpointResourceProperties) -> Self { + pub fn new(properties: DigitalTwinsEndpointResourcePropertiesUnion) -> Self { Self { external_resource: ExternalResource::default(), properties, @@ -524,6 +524,13 @@ pub mod digital_twins_endpoint_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum DigitalTwinsEndpointResourcePropertiesUnion { + EventGrid(EventGrid), + EventHub(EventHub), + ServiceBus(ServiceBus), +} #[doc = "The managed identity for the DigitalTwinsInstance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DigitalTwinsIdentity { @@ -1280,7 +1287,7 @@ pub struct TimeSeriesDatabaseConnection { pub external_resource: ExternalResource, #[doc = "Properties of a time series database connection resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl TimeSeriesDatabaseConnection { pub fn new() -> Self { @@ -1425,3 +1432,8 @@ pub mod time_series_database_connection_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "connectionType")] +pub enum TimeSeriesDatabaseConnectionPropertiesUnion { + AzureDataExplorer(AzureDataExplorerConnectionProperties), +} diff --git a/services/mgmt/digitaltwins/src/package_2022_10/models.rs b/services/mgmt/digitaltwins/src/package_2022_10/models.rs index f577aae778..b2c412ebb2 100644 --- a/services/mgmt/digitaltwins/src/package_2022_10/models.rs +++ b/services/mgmt/digitaltwins/src/package_2022_10/models.rs @@ -319,10 +319,10 @@ pub struct DigitalTwinsEndpointResource { #[serde(flatten)] pub external_resource: ExternalResource, #[doc = "Properties related to Digital Twins Endpoint"] - pub properties: DigitalTwinsEndpointResourceProperties, + pub properties: DigitalTwinsEndpointResourcePropertiesUnion, } impl DigitalTwinsEndpointResource { - pub fn new(properties: DigitalTwinsEndpointResourceProperties) -> Self { + pub fn new(properties: DigitalTwinsEndpointResourcePropertiesUnion) -> Self { Self { external_resource: ExternalResource::default(), properties, @@ -528,6 +528,13 @@ pub mod digital_twins_endpoint_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum DigitalTwinsEndpointResourcePropertiesUnion { + EventGrid(EventGrid), + EventHub(EventHub), + ServiceBus(ServiceBus), +} #[doc = "The managed identity for the DigitalTwinsInstance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DigitalTwinsIdentity { @@ -1347,7 +1354,7 @@ pub struct TimeSeriesDatabaseConnection { pub external_resource: ExternalResource, #[doc = "Properties of a time series database connection resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl TimeSeriesDatabaseConnection { pub fn new() -> Self { @@ -1496,6 +1503,11 @@ pub mod time_series_database_connection_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "connectionType")] +pub enum TimeSeriesDatabaseConnectionPropertiesUnion { + AzureDataExplorer(AzureDataExplorerConnectionProperties), +} #[doc = "The information about the user assigned identity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserAssignedIdentity { diff --git a/services/mgmt/digitaltwins/src/package_2023_01/models.rs b/services/mgmt/digitaltwins/src/package_2023_01/models.rs index a795fcf3a3..cb651a2b17 100644 --- a/services/mgmt/digitaltwins/src/package_2023_01/models.rs +++ b/services/mgmt/digitaltwins/src/package_2023_01/models.rs @@ -382,10 +382,10 @@ pub struct DigitalTwinsEndpointResource { #[serde(flatten)] pub external_resource: ExternalResource, #[doc = "Properties related to Digital Twins Endpoint"] - pub properties: DigitalTwinsEndpointResourceProperties, + pub properties: DigitalTwinsEndpointResourcePropertiesUnion, } impl DigitalTwinsEndpointResource { - pub fn new(properties: DigitalTwinsEndpointResourceProperties) -> Self { + pub fn new(properties: DigitalTwinsEndpointResourcePropertiesUnion) -> Self { Self { external_resource: ExternalResource::default(), properties, @@ -591,6 +591,13 @@ pub mod digital_twins_endpoint_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum DigitalTwinsEndpointResourcePropertiesUnion { + EventGrid(EventGrid), + EventHub(EventHub), + ServiceBus(ServiceBus), +} #[doc = "The managed identity for the DigitalTwinsInstance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DigitalTwinsIdentity { @@ -1410,7 +1417,7 @@ pub struct TimeSeriesDatabaseConnection { pub external_resource: ExternalResource, #[doc = "Properties of a time series database connection resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl TimeSeriesDatabaseConnection { pub fn new() -> Self { @@ -1559,6 +1566,11 @@ pub mod time_series_database_connection_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "connectionType")] +pub enum TimeSeriesDatabaseConnectionPropertiesUnion { + AzureDataExplorer(AzureDataExplorerConnectionProperties), +} #[doc = "The information about the user assigned identity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserAssignedIdentity { diff --git a/services/mgmt/edgeorder/src/package_2020_12_preview/models.rs b/services/mgmt/edgeorder/src/package_2020_12_preview/models.rs index cf17b5ae84..949f7a478e 100644 --- a/services/mgmt/edgeorder/src/package_2020_12_preview/models.rs +++ b/services/mgmt/edgeorder/src/package_2020_12_preview/models.rs @@ -269,7 +269,7 @@ pub struct BillingMeterDetails { pub name: Option, #[doc = "Holds details about billing type and its meter guids"] #[serde(rename = "meterDetails", default, skip_serializing_if = "Option::is_none")] - pub meter_details: Option, + pub meter_details: Option, #[doc = "Represents Metering type (eg one-time or recurrent)"] #[serde(rename = "meteringType", default, skip_serializing_if = "Option::is_none")] pub metering_type: Option, @@ -1211,6 +1211,12 @@ pub mod meter_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "billingType")] +pub enum MeterDetailsUnion { + Pav2(Pav2MeterDetails), + Purchase(PurchaseMeterDetails), +} #[doc = "Notification preference for a job stage."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NotificationPreference { diff --git a/services/mgmt/edgeorder/src/package_2021_12/models.rs b/services/mgmt/edgeorder/src/package_2021_12/models.rs index 9269df47db..0c3b2fe70d 100644 --- a/services/mgmt/edgeorder/src/package_2021_12/models.rs +++ b/services/mgmt/edgeorder/src/package_2021_12/models.rs @@ -315,7 +315,7 @@ pub struct BillingMeterDetails { pub name: Option, #[doc = "Holds details about billing type and its meter guids"] #[serde(rename = "meterDetails", default, skip_serializing_if = "Option::is_none")] - pub meter_details: Option, + pub meter_details: Option, #[doc = "Represents Metering type (eg one-time or recurrent)"] #[serde(rename = "meteringType", default, skip_serializing_if = "Option::is_none")] pub metering_type: Option, @@ -1257,6 +1257,12 @@ pub mod meter_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "billingType")] +pub enum MeterDetailsUnion { + Pav2(Pav2MeterDetails), + Purchase(PurchaseMeterDetails), +} #[doc = "Notification preference for a job stage."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NotificationPreference { diff --git a/services/mgmt/edgeorder/src/package_2022_05_preview/models.rs b/services/mgmt/edgeorder/src/package_2022_05_preview/models.rs index 5d950915a8..b9d57d6638 100644 --- a/services/mgmt/edgeorder/src/package_2022_05_preview/models.rs +++ b/services/mgmt/edgeorder/src/package_2022_05_preview/models.rs @@ -377,7 +377,7 @@ pub struct BillingMeterDetails { pub name: Option, #[doc = "Holds details about billing type and its meter guids."] #[serde(rename = "meterDetails", default, skip_serializing_if = "Option::is_none")] - pub meter_details: Option, + pub meter_details: Option, #[doc = "Represents Metering type (eg one-time or recurrent)."] #[serde(rename = "meteringType", default, skip_serializing_if = "Option::is_none")] pub metering_type: Option, @@ -1649,6 +1649,12 @@ pub mod meter_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "billingType")] +pub enum MeterDetailsUnion { + Pav2(Pav2MeterDetails), + Purchase(PurchaseMeterDetails), +} #[doc = "Notification preference for a job stage."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NotificationPreference { diff --git a/services/mgmt/eventgrid/src/package_2021_10_preview/models.rs b/services/mgmt/eventgrid/src/package_2021_10_preview/models.rs index cde067222f..0a5424fbc2 100644 --- a/services/mgmt/eventgrid/src/package_2021_10_preview/models.rs +++ b/services/mgmt/eventgrid/src/package_2021_10_preview/models.rs @@ -92,6 +92,29 @@ pub mod advanced_filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "operatorType")] +pub enum AdvancedFilterUnion { + BoolEquals(BoolEqualsAdvancedFilter), + IsNotNull(IsNotNullAdvancedFilter), + IsNullOrUndefined(IsNullOrUndefinedAdvancedFilter), + NumberGreaterThan(NumberGreaterThanAdvancedFilter), + NumberGreaterThanOrEquals(NumberGreaterThanOrEqualsAdvancedFilter), + NumberIn(NumberInAdvancedFilter), + NumberInRange(NumberInRangeAdvancedFilter), + NumberLessThan(NumberLessThanAdvancedFilter), + NumberLessThanOrEquals(NumberLessThanOrEqualsAdvancedFilter), + NumberNotIn(NumberNotInAdvancedFilter), + NumberNotInRange(NumberNotInRangeAdvancedFilter), + StringBeginsWith(StringBeginsWithAdvancedFilter), + StringContains(StringContainsAdvancedFilter), + StringEndsWith(StringEndsWithAdvancedFilter), + StringIn(StringInAdvancedFilter), + StringNotBeginsWith(StringNotBeginsWithAdvancedFilter), + StringNotContains(StringNotContainsAdvancedFilter), + StringNotEndsWith(StringNotEndsWithAdvancedFilter), + StringNotIn(StringNotInAdvancedFilter), +} #[doc = "Azure Active Directory Partner Client Authentication"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureAdPartnerClientAuthentication { @@ -164,7 +187,7 @@ pub struct AzureFunctionEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl AzureFunctionEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -216,7 +239,7 @@ pub struct ChannelProperties { pub partner_topic_info: Option, #[doc = "Properties of the corresponding partner destination of a Channel."] #[serde(rename = "partnerDestinationInfo", default, skip_serializing_if = "Option::is_none")] - pub partner_destination_info: Option, + pub partner_destination_info: Option, #[doc = "Context or helpful message that can be used during the approval process by the subscriber."] #[serde(rename = "messageForActivation", default, skip_serializing_if = "Option::is_none")] pub message_for_activation: Option, @@ -377,7 +400,7 @@ pub struct ChannelUpdateParametersProperties { pub expiration_time_if_not_activated_utc: Option, #[doc = "Properties of the corresponding partner destination of a Channel."] #[serde(rename = "partnerDestinationInfo", default, skip_serializing_if = "Option::is_none")] - pub partner_destination_info: Option, + pub partner_destination_info: Option, #[doc = "Update properties for the corresponding partner topic of a channel."] #[serde(rename = "partnerTopicInfo", default, skip_serializing_if = "Option::is_none")] pub partner_topic_info: Option, @@ -524,6 +547,11 @@ pub mod dead_letter_destination { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum DeadLetterDestinationUnion { + StorageBlob(StorageBlobDeadLetterDestination), +} #[doc = "Information about the deadletter destination with resource identity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeadLetterWithResourceIdentity { @@ -532,7 +560,7 @@ pub struct DeadLetterWithResourceIdentity { pub identity: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, } impl DeadLetterWithResourceIdentity { pub fn new() -> Self { @@ -548,7 +576,7 @@ pub struct DeliveryAttributeListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl DeliveryAttributeListResult { pub fn new() -> Self { @@ -610,6 +638,12 @@ pub mod delivery_attribute_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DeliveryAttributeMappingUnion { + Dynamic(DynamicDeliveryAttributeMapping), + Static(StaticDeliveryAttributeMapping), +} #[doc = "Information about the delivery for an event subscription with resource identity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeliveryWithResourceIdentity { @@ -618,7 +652,7 @@ pub struct DeliveryWithResourceIdentity { pub identity: Option, #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, } impl DeliveryWithResourceIdentity { pub fn new() -> Self { @@ -676,7 +710,7 @@ pub struct DomainProperties { pub input_schema: Option, #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] - pub input_schema_mapping: Option, + pub input_schema_mapping: Option, #[doc = "Metric resource id for the Event Grid Domain Resource."] #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] pub metric_resource_id: Option, @@ -1247,7 +1281,7 @@ pub struct EventChannelFilter { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub advanced_filters: Vec, + pub advanced_filters: Vec, } impl EventChannelFilter { pub fn new() -> Self { @@ -1442,7 +1476,7 @@ pub struct EventHubEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl EventHubEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -1530,6 +1564,18 @@ pub mod event_subscription_destination { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum EventSubscriptionDestinationUnion { + AzureFunction(AzureFunctionEventSubscriptionDestination), + EventHub(EventHubEventSubscriptionDestination), + HybridConnection(HybridConnectionEventSubscriptionDestination), + PartnerDestination(PartnerEventSubscriptionDestination), + ServiceBusQueue(ServiceBusQueueEventSubscriptionDestination), + ServiceBusTopic(ServiceBusTopicEventSubscriptionDestination), + StorageQueue(StorageQueueEventSubscriptionDestination), + WebHook(WebHookEventSubscriptionDestination), +} #[doc = "Filter for the Event Subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSubscriptionFilter { @@ -1560,7 +1606,7 @@ pub struct EventSubscriptionFilter { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub advanced_filters: Vec, + pub advanced_filters: Vec, } impl EventSubscriptionFilter { pub fn new() -> Self { @@ -1645,7 +1691,7 @@ pub struct EventSubscriptionProperties { pub provisioning_state: Option, #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, #[doc = "Information about the delivery for an event subscription with resource identity."] #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub delivery_with_resource_identity: Option, @@ -1670,7 +1716,7 @@ pub struct EventSubscriptionProperties { pub retry_policy: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, #[doc = "Information about the deadletter destination with resource identity."] #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub dead_letter_with_resource_identity: Option, @@ -1780,7 +1826,7 @@ pub mod event_subscription_properties { pub struct EventSubscriptionUpdateParameters { #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, #[doc = "Information about the delivery for an event subscription with resource identity."] #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub delivery_with_resource_identity: Option, @@ -1805,7 +1851,7 @@ pub struct EventSubscriptionUpdateParameters { pub retry_policy: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, #[doc = "Information about the deadletter destination with resource identity."] #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub dead_letter_with_resource_identity: Option, @@ -2070,7 +2116,7 @@ pub struct HybridConnectionEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl HybridConnectionEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -2263,6 +2309,11 @@ pub mod input_schema_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inputSchemaMappingType")] +pub enum InputSchemaMappingUnion { + Json(JsonInputSchemaMapping), +} #[doc = "IsNotNull Advanced Filter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IsNotNullAdvancedFilter { @@ -2671,6 +2722,12 @@ pub mod partner_client_authentication { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "clientAuthenticationType")] +pub enum PartnerClientAuthenticationUnion { + #[serde(rename = "AzureAD")] + AzureAd(AzureAdPartnerClientAuthentication), +} #[doc = "Partner configuration information"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PartnerConfiguration { @@ -2912,6 +2969,11 @@ pub mod partner_destination_info { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum PartnerDestinationInfoUnion { + WebHook(WebhookPartnerDestinationInfo), +} #[doc = "Properties of the Partner Destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PartnerDestinationProperties { @@ -3926,6 +3988,11 @@ pub mod partner_update_destination_info { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum PartnerUpdateDestinationInfoUnion { + WebHook(WebhookUpdatePartnerDestinationInfo), +} #[doc = "Update properties for the corresponding partner topic of a channel."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PartnerUpdateTopicInfo { @@ -4271,7 +4338,7 @@ pub struct ServiceBusQueueEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl ServiceBusQueueEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -4308,7 +4375,7 @@ pub struct ServiceBusTopicEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl ServiceBusTopicEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -4819,7 +4886,7 @@ pub struct TopicProperties { pub input_schema: Option, #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] - pub input_schema_mapping: Option, + pub input_schema_mapping: Option, #[doc = "Metric resource id for the topic."] #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] pub metric_resource_id: Option, @@ -5564,7 +5631,7 @@ pub struct WebHookEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl WebHookEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -5608,7 +5675,7 @@ pub struct WebhookPartnerDestinationProperties { pub endpoint_base_url: Option, #[doc = "Partner client authentication"] #[serde(rename = "clientAuthentication", default, skip_serializing_if = "Option::is_none")] - pub client_authentication: Option, + pub client_authentication: Option, } impl WebhookPartnerDestinationProperties { pub fn new() -> Self { diff --git a/services/mgmt/eventgrid/src/package_2021_12/models.rs b/services/mgmt/eventgrid/src/package_2021_12/models.rs index 1d733f3cc5..79e0f7ed52 100644 --- a/services/mgmt/eventgrid/src/package_2021_12/models.rs +++ b/services/mgmt/eventgrid/src/package_2021_12/models.rs @@ -92,6 +92,29 @@ pub mod advanced_filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "operatorType")] +pub enum AdvancedFilterUnion { + BoolEquals(BoolEqualsAdvancedFilter), + IsNotNull(IsNotNullAdvancedFilter), + IsNullOrUndefined(IsNullOrUndefinedAdvancedFilter), + NumberGreaterThan(NumberGreaterThanAdvancedFilter), + NumberGreaterThanOrEquals(NumberGreaterThanOrEqualsAdvancedFilter), + NumberIn(NumberInAdvancedFilter), + NumberInRange(NumberInRangeAdvancedFilter), + NumberLessThan(NumberLessThanAdvancedFilter), + NumberLessThanOrEquals(NumberLessThanOrEqualsAdvancedFilter), + NumberNotIn(NumberNotInAdvancedFilter), + NumberNotInRange(NumberNotInRangeAdvancedFilter), + StringBeginsWith(StringBeginsWithAdvancedFilter), + StringContains(StringContainsAdvancedFilter), + StringEndsWith(StringEndsWithAdvancedFilter), + StringIn(StringInAdvancedFilter), + StringNotBeginsWith(StringNotBeginsWithAdvancedFilter), + StringNotContains(StringNotContainsAdvancedFilter), + StringNotEndsWith(StringNotEndsWithAdvancedFilter), + StringNotIn(StringNotInAdvancedFilter), +} #[doc = "Information about the azure function destination for an event subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureFunctionEventSubscriptionDestination { @@ -128,7 +151,7 @@ pub struct AzureFunctionEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl AzureFunctionEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -264,6 +287,11 @@ pub mod dead_letter_destination { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum DeadLetterDestinationUnion { + StorageBlob(StorageBlobDeadLetterDestination), +} #[doc = "Information about the deadletter destination with resource identity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeadLetterWithResourceIdentity { @@ -272,7 +300,7 @@ pub struct DeadLetterWithResourceIdentity { pub identity: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, } impl DeadLetterWithResourceIdentity { pub fn new() -> Self { @@ -288,7 +316,7 @@ pub struct DeliveryAttributeListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl DeliveryAttributeListResult { pub fn new() -> Self { @@ -350,6 +378,12 @@ pub mod delivery_attribute_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DeliveryAttributeMappingUnion { + Dynamic(DynamicDeliveryAttributeMapping), + Static(StaticDeliveryAttributeMapping), +} #[doc = "Information about the delivery for an event subscription with resource identity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeliveryWithResourceIdentity { @@ -358,7 +392,7 @@ pub struct DeliveryWithResourceIdentity { pub identity: Option, #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, } impl DeliveryWithResourceIdentity { pub fn new() -> Self { @@ -412,7 +446,7 @@ pub struct DomainProperties { pub input_schema: Option, #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] - pub input_schema_mapping: Option, + pub input_schema_mapping: Option, #[doc = "Metric resource id for the domain."] #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] pub metric_resource_id: Option, @@ -882,7 +916,7 @@ pub struct EventHubEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl EventHubEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -968,6 +1002,17 @@ pub mod event_subscription_destination { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum EventSubscriptionDestinationUnion { + AzureFunction(AzureFunctionEventSubscriptionDestination), + EventHub(EventHubEventSubscriptionDestination), + HybridConnection(HybridConnectionEventSubscriptionDestination), + ServiceBusQueue(ServiceBusQueueEventSubscriptionDestination), + ServiceBusTopic(ServiceBusTopicEventSubscriptionDestination), + StorageQueue(StorageQueueEventSubscriptionDestination), + WebHook(WebHookEventSubscriptionDestination), +} #[doc = "Filter for the Event Subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSubscriptionFilter { @@ -998,7 +1043,7 @@ pub struct EventSubscriptionFilter { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub advanced_filters: Vec, + pub advanced_filters: Vec, } impl EventSubscriptionFilter { pub fn new() -> Self { @@ -1083,7 +1128,7 @@ pub struct EventSubscriptionProperties { pub provisioning_state: Option, #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, #[doc = "Information about the delivery for an event subscription with resource identity."] #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub delivery_with_resource_identity: Option, @@ -1108,7 +1153,7 @@ pub struct EventSubscriptionProperties { pub retry_policy: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, #[doc = "Information about the deadletter destination with resource identity."] #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub dead_letter_with_resource_identity: Option, @@ -1218,7 +1263,7 @@ pub mod event_subscription_properties { pub struct EventSubscriptionUpdateParameters { #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, #[doc = "Information about the delivery for an event subscription with resource identity."] #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub delivery_with_resource_identity: Option, @@ -1243,7 +1288,7 @@ pub struct EventSubscriptionUpdateParameters { pub retry_policy: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, #[doc = "Information about the deadletter destination with resource identity."] #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub dead_letter_with_resource_identity: Option, @@ -1440,7 +1485,7 @@ pub struct HybridConnectionEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl HybridConnectionEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -1615,6 +1660,11 @@ pub mod input_schema_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inputSchemaMappingType")] +pub enum InputSchemaMappingUnion { + Json(JsonInputSchemaMapping), +} #[doc = "IsNotNull Advanced Filter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IsNotNullAdvancedFilter { @@ -2185,7 +2235,7 @@ pub struct ServiceBusQueueEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl ServiceBusQueueEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -2222,7 +2272,7 @@ pub struct ServiceBusTopicEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl ServiceBusTopicEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -2676,7 +2726,7 @@ pub struct TopicProperties { pub input_schema: Option, #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] - pub input_schema_mapping: Option, + pub input_schema_mapping: Option, #[doc = "Metric resource id for the topic."] #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] pub metric_resource_id: Option, @@ -3221,7 +3271,7 @@ pub struct WebHookEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl WebHookEventSubscriptionDestinationProperties { pub fn new() -> Self { diff --git a/services/mgmt/eventgrid/src/package_2022_06/models.rs b/services/mgmt/eventgrid/src/package_2022_06/models.rs index 6470e4b186..e2e7dd742e 100644 --- a/services/mgmt/eventgrid/src/package_2022_06/models.rs +++ b/services/mgmt/eventgrid/src/package_2022_06/models.rs @@ -92,6 +92,29 @@ pub mod advanced_filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "operatorType")] +pub enum AdvancedFilterUnion { + BoolEquals(BoolEqualsAdvancedFilter), + IsNotNull(IsNotNullAdvancedFilter), + IsNullOrUndefined(IsNullOrUndefinedAdvancedFilter), + NumberGreaterThan(NumberGreaterThanAdvancedFilter), + NumberGreaterThanOrEquals(NumberGreaterThanOrEqualsAdvancedFilter), + NumberIn(NumberInAdvancedFilter), + NumberInRange(NumberInRangeAdvancedFilter), + NumberLessThan(NumberLessThanAdvancedFilter), + NumberLessThanOrEquals(NumberLessThanOrEqualsAdvancedFilter), + NumberNotIn(NumberNotInAdvancedFilter), + NumberNotInRange(NumberNotInRangeAdvancedFilter), + StringBeginsWith(StringBeginsWithAdvancedFilter), + StringContains(StringContainsAdvancedFilter), + StringEndsWith(StringEndsWithAdvancedFilter), + StringIn(StringInAdvancedFilter), + StringNotBeginsWith(StringNotBeginsWithAdvancedFilter), + StringNotContains(StringNotContainsAdvancedFilter), + StringNotEndsWith(StringNotEndsWithAdvancedFilter), + StringNotIn(StringNotInAdvancedFilter), +} #[doc = "Information about the azure function destination for an event subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureFunctionEventSubscriptionDestination { @@ -128,7 +151,7 @@ pub struct AzureFunctionEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl AzureFunctionEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -484,6 +507,11 @@ pub mod dead_letter_destination { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum DeadLetterDestinationUnion { + StorageBlob(StorageBlobDeadLetterDestination), +} #[doc = "Information about the deadletter destination with resource identity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeadLetterWithResourceIdentity { @@ -492,7 +520,7 @@ pub struct DeadLetterWithResourceIdentity { pub identity: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, } impl DeadLetterWithResourceIdentity { pub fn new() -> Self { @@ -508,7 +536,7 @@ pub struct DeliveryAttributeListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl DeliveryAttributeListResult { pub fn new() -> Self { @@ -570,6 +598,12 @@ pub mod delivery_attribute_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DeliveryAttributeMappingUnion { + Dynamic(DynamicDeliveryAttributeMapping), + Static(StaticDeliveryAttributeMapping), +} #[doc = "Information about the delivery for an event subscription with resource identity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeliveryWithResourceIdentity { @@ -578,7 +612,7 @@ pub struct DeliveryWithResourceIdentity { pub identity: Option, #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, } impl DeliveryWithResourceIdentity { pub fn new() -> Self { @@ -632,7 +666,7 @@ pub struct DomainProperties { pub input_schema: Option, #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] - pub input_schema_mapping: Option, + pub input_schema_mapping: Option, #[doc = "Metric resource id for the Event Grid Domain Resource."] #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] pub metric_resource_id: Option, @@ -1182,7 +1216,7 @@ pub struct EventHubEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl EventHubEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -1268,6 +1302,17 @@ pub mod event_subscription_destination { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum EventSubscriptionDestinationUnion { + AzureFunction(AzureFunctionEventSubscriptionDestination), + EventHub(EventHubEventSubscriptionDestination), + HybridConnection(HybridConnectionEventSubscriptionDestination), + ServiceBusQueue(ServiceBusQueueEventSubscriptionDestination), + ServiceBusTopic(ServiceBusTopicEventSubscriptionDestination), + StorageQueue(StorageQueueEventSubscriptionDestination), + WebHook(WebHookEventSubscriptionDestination), +} #[doc = "Filter for the Event Subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSubscriptionFilter { @@ -1298,7 +1343,7 @@ pub struct EventSubscriptionFilter { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub advanced_filters: Vec, + pub advanced_filters: Vec, } impl EventSubscriptionFilter { pub fn new() -> Self { @@ -1383,7 +1428,7 @@ pub struct EventSubscriptionProperties { pub provisioning_state: Option, #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, #[doc = "Information about the delivery for an event subscription with resource identity."] #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub delivery_with_resource_identity: Option, @@ -1408,7 +1453,7 @@ pub struct EventSubscriptionProperties { pub retry_policy: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, #[doc = "Information about the deadletter destination with resource identity."] #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub dead_letter_with_resource_identity: Option, @@ -1518,7 +1563,7 @@ pub mod event_subscription_properties { pub struct EventSubscriptionUpdateParameters { #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, #[doc = "Information about the delivery for an event subscription with resource identity."] #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub delivery_with_resource_identity: Option, @@ -1543,7 +1588,7 @@ pub struct EventSubscriptionUpdateParameters { pub retry_policy: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, #[doc = "Information about the deadletter destination with resource identity."] #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub dead_letter_with_resource_identity: Option, @@ -1793,7 +1838,7 @@ pub struct HybridConnectionEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl HybridConnectionEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -1989,6 +2034,11 @@ pub mod input_schema_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inputSchemaMappingType")] +pub enum InputSchemaMappingUnion { + Json(JsonInputSchemaMapping), +} #[doc = "IsNotNull Advanced Filter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IsNotNullAdvancedFilter { @@ -3429,7 +3479,7 @@ pub struct ServiceBusQueueEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl ServiceBusQueueEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -3466,7 +3516,7 @@ pub struct ServiceBusTopicEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl ServiceBusTopicEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -3920,7 +3970,7 @@ pub struct TopicProperties { pub input_schema: Option, #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] - pub input_schema_mapping: Option, + pub input_schema_mapping: Option, #[doc = "Metric resource id for the topic."] #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] pub metric_resource_id: Option, @@ -4659,7 +4709,7 @@ pub struct WebHookEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl WebHookEventSubscriptionDestinationProperties { pub fn new() -> Self { diff --git a/services/mgmt/eventgrid/src/package_2023_06_preview/models.rs b/services/mgmt/eventgrid/src/package_2023_06_preview/models.rs index 209466e00a..414c2a39fe 100644 --- a/services/mgmt/eventgrid/src/package_2023_06_preview/models.rs +++ b/services/mgmt/eventgrid/src/package_2023_06_preview/models.rs @@ -92,6 +92,29 @@ pub mod advanced_filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "operatorType")] +pub enum AdvancedFilterUnion { + BoolEquals(BoolEqualsAdvancedFilter), + IsNotNull(IsNotNullAdvancedFilter), + IsNullOrUndefined(IsNullOrUndefinedAdvancedFilter), + NumberGreaterThan(NumberGreaterThanAdvancedFilter), + NumberGreaterThanOrEquals(NumberGreaterThanOrEqualsAdvancedFilter), + NumberIn(NumberInAdvancedFilter), + NumberInRange(NumberInRangeAdvancedFilter), + NumberLessThan(NumberLessThanAdvancedFilter), + NumberLessThanOrEquals(NumberLessThanOrEqualsAdvancedFilter), + NumberNotIn(NumberNotInAdvancedFilter), + NumberNotInRange(NumberNotInRangeAdvancedFilter), + StringBeginsWith(StringBeginsWithAdvancedFilter), + StringContains(StringContainsAdvancedFilter), + StringEndsWith(StringEndsWithAdvancedFilter), + StringIn(StringInAdvancedFilter), + StringNotBeginsWith(StringNotBeginsWithAdvancedFilter), + StringNotContains(StringNotContainsAdvancedFilter), + StringNotEndsWith(StringNotEndsWithAdvancedFilter), + StringNotIn(StringNotInAdvancedFilter), +} #[doc = "Azure Active Directory Partner Client Authentication"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureAdPartnerClientAuthentication { @@ -164,7 +187,7 @@ pub struct AzureFunctionEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl AzureFunctionEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -346,7 +369,7 @@ pub struct ChannelProperties { pub partner_topic_info: Option, #[doc = "Properties of the corresponding partner destination of a Channel."] #[serde(rename = "partnerDestinationInfo", default, skip_serializing_if = "Option::is_none")] - pub partner_destination_info: Option, + pub partner_destination_info: Option, #[doc = "Context or helpful message that can be used during the approval process by the subscriber."] #[serde(rename = "messageForActivation", default, skip_serializing_if = "Option::is_none")] pub message_for_activation: Option, @@ -515,7 +538,7 @@ pub struct ChannelUpdateParametersProperties { pub expiration_time_if_not_activated_utc: Option, #[doc = "Properties of the corresponding partner destination of a Channel."] #[serde(rename = "partnerDestinationInfo", default, skip_serializing_if = "Option::is_none")] - pub partner_destination_info: Option, + pub partner_destination_info: Option, #[doc = "Update properties for the corresponding partner topic of a channel."] #[serde(rename = "partnerTopicInfo", default, skip_serializing_if = "Option::is_none")] pub partner_topic_info: Option, @@ -1082,6 +1105,11 @@ pub mod dead_letter_destination { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum DeadLetterDestinationUnion { + StorageBlob(StorageBlobDeadLetterDestination), +} #[doc = "Information about the deadletter destination with resource identity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeadLetterWithResourceIdentity { @@ -1090,7 +1118,7 @@ pub struct DeadLetterWithResourceIdentity { pub identity: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, } impl DeadLetterWithResourceIdentity { pub fn new() -> Self { @@ -1106,7 +1134,7 @@ pub struct DeliveryAttributeListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl DeliveryAttributeListResult { pub fn new() -> Self { @@ -1168,6 +1196,12 @@ pub mod delivery_attribute_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DeliveryAttributeMappingUnion { + Dynamic(DynamicDeliveryAttributeMapping), + Static(StaticDeliveryAttributeMapping), +} #[doc = "Properties of the delivery configuration information of the event subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeliveryConfiguration { @@ -1229,7 +1263,7 @@ pub struct DeliveryWithResourceIdentity { pub identity: Option, #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, } impl DeliveryWithResourceIdentity { pub fn new() -> Self { @@ -1292,7 +1326,7 @@ pub struct DomainProperties { pub event_type_info: Option, #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] - pub input_schema_mapping: Option, + pub input_schema_mapping: Option, #[doc = "Metric resource id for the Event Grid Domain Resource."] #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] pub metric_resource_id: Option, @@ -2015,7 +2049,7 @@ pub struct EventHubEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl EventHubEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -2103,6 +2137,18 @@ pub mod event_subscription_destination { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum EventSubscriptionDestinationUnion { + AzureFunction(AzureFunctionEventSubscriptionDestination), + EventHub(EventHubEventSubscriptionDestination), + HybridConnection(HybridConnectionEventSubscriptionDestination), + PartnerDestination(PartnerEventSubscriptionDestination), + ServiceBusQueue(ServiceBusQueueEventSubscriptionDestination), + ServiceBusTopic(ServiceBusTopicEventSubscriptionDestination), + StorageQueue(StorageQueueEventSubscriptionDestination), + WebHook(WebHookEventSubscriptionDestination), +} #[doc = "Filter for the Event Subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSubscriptionFilter { @@ -2133,7 +2179,7 @@ pub struct EventSubscriptionFilter { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub advanced_filters: Vec, + pub advanced_filters: Vec, } impl EventSubscriptionFilter { pub fn new() -> Self { @@ -2218,7 +2264,7 @@ pub struct EventSubscriptionProperties { pub provisioning_state: Option, #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, #[doc = "Information about the delivery for an event subscription with resource identity."] #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub delivery_with_resource_identity: Option, @@ -2243,7 +2289,7 @@ pub struct EventSubscriptionProperties { pub retry_policy: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, #[doc = "Information about the deadletter destination with resource identity."] #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub dead_letter_with_resource_identity: Option, @@ -2353,7 +2399,7 @@ pub mod event_subscription_properties { pub struct EventSubscriptionUpdateParameters { #[doc = "Information about the destination for an event subscription."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, + pub destination: Option, #[doc = "Information about the delivery for an event subscription with resource identity."] #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub delivery_with_resource_identity: Option, @@ -2378,7 +2424,7 @@ pub struct EventSubscriptionUpdateParameters { pub retry_policy: Option, #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] - pub dead_letter_destination: Option, + pub dead_letter_destination: Option, #[doc = "Information about the deadletter destination with resource identity."] #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] pub dead_letter_with_resource_identity: Option, @@ -2702,6 +2748,29 @@ pub mod filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "operatorType")] +pub enum FilterUnion { + BoolEquals(BoolEqualsFilter), + IsNotNull(IsNotNullFilter), + IsNullOrUndefined(IsNullOrUndefinedFilter), + NumberGreaterThan(NumberGreaterThanFilter), + NumberGreaterThanOrEquals(NumberGreaterThanOrEqualsFilter), + NumberIn(NumberInFilter), + NumberInRange(NumberInRangeFilter), + NumberLessThan(NumberLessThanFilter), + NumberLessThanOrEquals(NumberLessThanOrEqualsFilter), + NumberNotIn(NumberNotInFilter), + NumberNotInRange(NumberNotInRangeFilter), + StringBeginsWith(StringBeginsWithFilter), + StringContains(StringContainsFilter), + StringEndsWith(StringEndsWithFilter), + StringIn(StringInFilter), + StringNotBeginsWith(StringNotBeginsWithFilter), + StringNotContains(StringNotContainsFilter), + StringNotEndsWith(StringNotEndsWithFilter), + StringNotIn(StringNotInFilter), +} #[doc = "Filters configuration for the Event Subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FiltersConfiguration { @@ -2719,7 +2788,7 @@ pub struct FiltersConfiguration { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub filters: Vec, + pub filters: Vec, } impl FiltersConfiguration { pub fn new() -> Self { @@ -2756,7 +2825,7 @@ pub struct HybridConnectionEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl HybridConnectionEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -2952,6 +3021,11 @@ pub mod input_schema_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inputSchemaMappingType")] +pub enum InputSchemaMappingUnion { + Json(JsonInputSchemaMapping), +} #[doc = "IsNotNull Advanced Filter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IsNotNullAdvancedFilter { @@ -4136,6 +4210,12 @@ pub mod partner_client_authentication { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "clientAuthenticationType")] +pub enum PartnerClientAuthenticationUnion { + #[serde(rename = "AzureAD")] + AzureAd(AzureAdPartnerClientAuthentication), +} #[doc = "Partner configuration information"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PartnerConfiguration { @@ -4377,6 +4457,11 @@ pub mod partner_destination_info { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum PartnerDestinationInfoUnion { + WebHook(WebhookPartnerDestinationInfo), +} #[doc = "Properties of the Partner Destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PartnerDestinationProperties { @@ -5386,6 +5471,11 @@ pub mod partner_update_destination_info { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum PartnerUpdateDestinationInfoUnion { + WebHook(WebhookUpdatePartnerDestinationInfo), +} #[doc = "Update properties for the corresponding partner topic of a channel."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PartnerUpdateTopicInfo { @@ -5984,7 +6074,7 @@ pub struct ServiceBusQueueEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl ServiceBusQueueEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -6021,7 +6111,7 @@ pub struct ServiceBusTopicEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, } impl ServiceBusTopicEventSubscriptionDestinationProperties { pub fn new() -> Self { @@ -6984,7 +7074,7 @@ pub struct TopicProperties { pub input_schema: Option, #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] - pub input_schema_mapping: Option, + pub input_schema_mapping: Option, #[doc = "Metric resource id for the topic."] #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] pub metric_resource_id: Option, @@ -8103,7 +8193,7 @@ pub struct WebHookEventSubscriptionDestinationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub delivery_attribute_mappings: Vec, + pub delivery_attribute_mappings: Vec, #[doc = "Minimum TLS version that should be supported by webhook endpoint"] #[serde(rename = "minimumTlsVersionAllowed", default, skip_serializing_if = "Option::is_none")] pub minimum_tls_version_allowed: Option, @@ -8195,7 +8285,7 @@ pub struct WebhookPartnerDestinationProperties { pub endpoint_base_url: Option, #[doc = "Partner client authentication"] #[serde(rename = "clientAuthentication", default, skip_serializing_if = "Option::is_none")] - pub client_authentication: Option, + pub client_authentication: Option, } impl WebhookPartnerDestinationProperties { pub fn new() -> Self { diff --git a/services/mgmt/eventhub/src/package_2022_01_preview/models.rs b/services/mgmt/eventhub/src/package_2022_01_preview/models.rs index a107b346e1..7333e2eda5 100644 --- a/services/mgmt/eventhub/src/package_2022_01_preview/models.rs +++ b/services/mgmt/eventhub/src/package_2022_01_preview/models.rs @@ -65,7 +65,7 @@ pub mod application_group { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub policies: Vec, + pub policies: Vec, } impl Properties { pub fn new(client_app_group_identifier: String) -> Self { @@ -154,6 +154,11 @@ pub mod application_group_policy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ApplicationGroupPolicyUnion { + ThrottlingPolicy(ThrottlingPolicy), +} #[doc = "Single item in List or Get Alias(Disaster Recovery configuration) operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArmDisasterRecovery { diff --git a/services/mgmt/eventhub/src/package_2022_10_preview/models.rs b/services/mgmt/eventhub/src/package_2022_10_preview/models.rs index ed8202e634..2c179fbb2e 100644 --- a/services/mgmt/eventhub/src/package_2022_10_preview/models.rs +++ b/services/mgmt/eventhub/src/package_2022_10_preview/models.rs @@ -65,7 +65,7 @@ pub mod application_group { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub policies: Vec, + pub policies: Vec, } impl Properties { pub fn new(client_app_group_identifier: String) -> Self { @@ -154,6 +154,11 @@ pub mod application_group_policy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ApplicationGroupPolicyUnion { + ThrottlingPolicy(ThrottlingPolicy), +} #[doc = "Single item in List or Get Alias(Disaster Recovery configuration) operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArmDisasterRecovery { diff --git a/services/mgmt/eventhub/src/package_2023_01_preview/models.rs b/services/mgmt/eventhub/src/package_2023_01_preview/models.rs index 42b4edbe01..26cdfe049a 100644 --- a/services/mgmt/eventhub/src/package_2023_01_preview/models.rs +++ b/services/mgmt/eventhub/src/package_2023_01_preview/models.rs @@ -65,7 +65,7 @@ pub mod application_group { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub policies: Vec, + pub policies: Vec, } impl Properties { pub fn new(client_app_group_identifier: String) -> Self { @@ -154,6 +154,11 @@ pub mod application_group_policy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ApplicationGroupPolicyUnion { + ThrottlingPolicy(ThrottlingPolicy), +} #[doc = "Single item in List or Get Alias(Disaster Recovery configuration) operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArmDisasterRecovery { diff --git a/services/mgmt/frontdoor/src/package_2020_04/models.rs b/services/mgmt/frontdoor/src/package_2020_04/models.rs index 53ecc408e7..9de5379a52 100644 --- a/services/mgmt/frontdoor/src/package_2020_04/models.rs +++ b/services/mgmt/frontdoor/src/package_2020_04/models.rs @@ -3247,6 +3247,14 @@ impl RouteConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum RouteConfigurationUnion { + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration(ForwardingConfiguration), + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration(RedirectConfiguration), +} #[doc = "A routing rule represents a specification for traffic to treat and where to send it, along with health probe information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoutingRule { @@ -3343,7 +3351,7 @@ pub struct RoutingRuleUpdateParameters { pub enabled_state: Option, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub route_configuration: Option, + pub route_configuration: Option, #[doc = "Reference to another subresource."] #[serde(rename = "rulesEngine", default, skip_serializing_if = "Option::is_none")] pub rules_engine: Option, @@ -3450,7 +3458,7 @@ pub struct RulesEngineAction { pub response_header_actions: Vec, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfigurationOverride", default, skip_serializing_if = "Option::is_none")] - pub route_configuration_override: Option, + pub route_configuration_override: Option, } impl RulesEngineAction { pub fn new() -> Self { diff --git a/services/mgmt/frontdoor/src/package_2020_05/models.rs b/services/mgmt/frontdoor/src/package_2020_05/models.rs index edfcccb367..7fd1e763c4 100644 --- a/services/mgmt/frontdoor/src/package_2020_05/models.rs +++ b/services/mgmt/frontdoor/src/package_2020_05/models.rs @@ -3253,6 +3253,14 @@ impl RouteConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum RouteConfigurationUnion { + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration(ForwardingConfiguration), + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration(RedirectConfiguration), +} #[doc = "A routing rule represents a specification for traffic to treat and where to send it, along with health probe information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoutingRule { @@ -3349,7 +3357,7 @@ pub struct RoutingRuleUpdateParameters { pub enabled_state: Option, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub route_configuration: Option, + pub route_configuration: Option, #[doc = "Reference to another subresource."] #[serde(rename = "rulesEngine", default, skip_serializing_if = "Option::is_none")] pub rules_engine: Option, @@ -3456,7 +3464,7 @@ pub struct RulesEngineAction { pub response_header_actions: Vec, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfigurationOverride", default, skip_serializing_if = "Option::is_none")] - pub route_configuration_override: Option, + pub route_configuration_override: Option, } impl RulesEngineAction { pub fn new() -> Self { diff --git a/services/mgmt/frontdoor/src/package_2020_11/models.rs b/services/mgmt/frontdoor/src/package_2020_11/models.rs index 277155abe4..921e4d5d93 100644 --- a/services/mgmt/frontdoor/src/package_2020_11/models.rs +++ b/services/mgmt/frontdoor/src/package_2020_11/models.rs @@ -3338,6 +3338,14 @@ impl RouteConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum RouteConfigurationUnion { + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration(ForwardingConfiguration), + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration(RedirectConfiguration), +} #[doc = "A routing rule represents a specification for traffic to treat and where to send it, along with health probe information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoutingRule { @@ -3434,7 +3442,7 @@ pub struct RoutingRuleUpdateParameters { pub enabled_state: Option, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub route_configuration: Option, + pub route_configuration: Option, #[doc = "Reference to another subresource."] #[serde(rename = "rulesEngine", default, skip_serializing_if = "Option::is_none")] pub rules_engine: Option, @@ -3541,7 +3549,7 @@ pub struct RulesEngineAction { pub response_header_actions: Vec, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfigurationOverride", default, skip_serializing_if = "Option::is_none")] - pub route_configuration_override: Option, + pub route_configuration_override: Option, } impl RulesEngineAction { pub fn new() -> Self { diff --git a/services/mgmt/frontdoor/src/package_2021_06/models.rs b/services/mgmt/frontdoor/src/package_2021_06/models.rs index 1c32cf0c92..339f320361 100644 --- a/services/mgmt/frontdoor/src/package_2021_06/models.rs +++ b/services/mgmt/frontdoor/src/package_2021_06/models.rs @@ -3345,6 +3345,14 @@ impl RouteConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum RouteConfigurationUnion { + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration(ForwardingConfiguration), + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration(RedirectConfiguration), +} #[doc = "A routing rule represents a specification for traffic to treat and where to send it, along with health probe information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoutingRule { @@ -3441,7 +3449,7 @@ pub struct RoutingRuleUpdateParameters { pub enabled_state: Option, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub route_configuration: Option, + pub route_configuration: Option, #[doc = "Reference to another subresource."] #[serde(rename = "rulesEngine", default, skip_serializing_if = "Option::is_none")] pub rules_engine: Option, @@ -3548,7 +3556,7 @@ pub struct RulesEngineAction { pub response_header_actions: Vec, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfigurationOverride", default, skip_serializing_if = "Option::is_none")] - pub route_configuration_override: Option, + pub route_configuration_override: Option, } impl RulesEngineAction { pub fn new() -> Self { diff --git a/services/mgmt/frontdoor/src/package_2022_05/models.rs b/services/mgmt/frontdoor/src/package_2022_05/models.rs index ff1e8e744e..4f5e448e90 100644 --- a/services/mgmt/frontdoor/src/package_2022_05/models.rs +++ b/services/mgmt/frontdoor/src/package_2022_05/models.rs @@ -3383,6 +3383,14 @@ impl RouteConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum RouteConfigurationUnion { + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration(ForwardingConfiguration), + #[serde(rename = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration")] + MicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration(RedirectConfiguration), +} #[doc = "A routing rule represents a specification for traffic to treat and where to send it, along with health probe information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoutingRule { @@ -3479,7 +3487,7 @@ pub struct RoutingRuleUpdateParameters { pub enabled_state: Option, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub route_configuration: Option, + pub route_configuration: Option, #[doc = "Reference to another subresource."] #[serde(rename = "rulesEngine", default, skip_serializing_if = "Option::is_none")] pub rules_engine: Option, @@ -3586,7 +3594,7 @@ pub struct RulesEngineAction { pub response_header_actions: Vec, #[doc = "Base class for all types of Route."] #[serde(rename = "routeConfigurationOverride", default, skip_serializing_if = "Option::is_none")] - pub route_configuration_override: Option, + pub route_configuration_override: Option, } impl RulesEngineAction { pub fn new() -> Self { diff --git a/services/mgmt/healthcareapis/src/package_preview_2022_10/models.rs b/services/mgmt/healthcareapis/src/package_preview_2022_10/models.rs index 96ff0130d7..3013f49fcd 100644 --- a/services/mgmt/healthcareapis/src/package_preview_2022_10/models.rs +++ b/services/mgmt/healthcareapis/src/package_preview_2022_10/models.rs @@ -101,6 +101,12 @@ pub mod analytics_connector_data_destination { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AnalyticsConnectorDataDestinationUnion { + #[serde(rename = "datalake")] + Datalake(AnalyticsConnectorDataLakeDataDestination), +} #[doc = "The Data Lake data destination for Analytics Connector."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AnalyticsConnectorDataLakeDataDestination { @@ -169,6 +175,12 @@ pub mod analytics_connector_data_source { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AnalyticsConnectorDataSourceUnion { + #[serde(rename = "fhirservice")] + Fhirservice(AnalyticsConnectorFhirServiceDataSource), +} #[doc = "The FHIR service data source for Analytics Connector."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AnalyticsConnectorFhirServiceDataSource { @@ -305,6 +317,12 @@ pub mod analytics_connector_mapping { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AnalyticsConnectorMappingUnion { + #[serde(rename = "fhirToParquet")] + FhirToParquet(AnalyticsConnectorFhirToParquetMapping), +} #[doc = "AnalyticsConnector patch properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AnalyticsConnectorPatchResource { @@ -326,19 +344,19 @@ pub struct AnalyticsConnectorProperties { pub provisioning_state: Option, #[doc = "Data source for Analytics Connector. The target resource must be in the same workspace with the Analytics Connector."] #[serde(rename = "dataSourceConfiguration")] - pub data_source_configuration: AnalyticsConnectorDataSource, + pub data_source_configuration: AnalyticsConnectorDataSourceUnion, #[doc = "Data mapping configuration for Analytics Connector."] #[serde(rename = "dataMappingConfiguration")] - pub data_mapping_configuration: AnalyticsConnectorMapping, + pub data_mapping_configuration: AnalyticsConnectorMappingUnion, #[doc = "Data destination configuration for Analytics Connector."] #[serde(rename = "dataDestinationConfiguration")] - pub data_destination_configuration: AnalyticsConnectorDataDestination, + pub data_destination_configuration: AnalyticsConnectorDataDestinationUnion, } impl AnalyticsConnectorProperties { pub fn new( - data_source_configuration: AnalyticsConnectorDataSource, - data_mapping_configuration: AnalyticsConnectorMapping, - data_destination_configuration: AnalyticsConnectorDataDestination, + data_source_configuration: AnalyticsConnectorDataSourceUnion, + data_mapping_configuration: AnalyticsConnectorMappingUnion, + data_destination_configuration: AnalyticsConnectorDataDestinationUnion, ) -> Self { Self { provisioning_state: None, diff --git a/services/mgmt/hybridnetwork/src/package_2020_01_01_preview/models.rs b/services/mgmt/hybridnetwork/src/package_2020_01_01_preview/models.rs index 90d112a73d..a6437d1483 100644 --- a/services/mgmt/hybridnetwork/src/package_2020_01_01_preview/models.rs +++ b/services/mgmt/hybridnetwork/src/package_2020_01_01_preview/models.rs @@ -97,7 +97,7 @@ pub struct Device { pub tracked_resource: TrackedResource, #[doc = "Device properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Device { pub fn new(tracked_resource: TrackedResource) -> Self { @@ -244,6 +244,11 @@ pub mod device_properties_format { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "deviceType")] +pub enum DevicePropertiesFormatUnion { + AzureStackEdge(AzureStackEdgeFormat), +} #[doc = "The device registration key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeviceRegistrationKey { diff --git a/services/mgmt/hybridnetwork/src/package_2021_05_01/models.rs b/services/mgmt/hybridnetwork/src/package_2021_05_01/models.rs index a40076982f..bee2ea2a93 100644 --- a/services/mgmt/hybridnetwork/src/package_2021_05_01/models.rs +++ b/services/mgmt/hybridnetwork/src/package_2021_05_01/models.rs @@ -97,7 +97,7 @@ pub struct Device { pub tracked_resource: TrackedResource, #[doc = "Device properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: 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, @@ -248,6 +248,11 @@ pub mod device_properties_format { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "deviceType")] +pub enum DevicePropertiesFormatUnion { + AzureStackEdge(AzureStackEdgeFormat), +} #[doc = "The device registration key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeviceRegistrationKey { diff --git a/services/mgmt/hybridnetwork/src/package_2022_01_01_preview/models.rs b/services/mgmt/hybridnetwork/src/package_2022_01_01_preview/models.rs index 31233a4614..078511db0d 100644 --- a/services/mgmt/hybridnetwork/src/package_2022_01_01_preview/models.rs +++ b/services/mgmt/hybridnetwork/src/package_2022_01_01_preview/models.rs @@ -97,7 +97,7 @@ pub struct Device { pub tracked_resource: TrackedResource, #[doc = "Device properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: 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, @@ -248,6 +248,11 @@ pub mod device_properties_format { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "deviceType")] +pub enum DevicePropertiesFormatUnion { + AzureStackEdge(AzureStackEdgeFormat), +} #[doc = "The device registration key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeviceRegistrationKey { diff --git a/services/mgmt/imagebuilder/src/package_2020_02/models.rs b/services/mgmt/imagebuilder/src/package_2020_02/models.rs index e6347656df..ff54ae55bb 100644 --- a/services/mgmt/imagebuilder/src/package_2020_02/models.rs +++ b/services/mgmt/imagebuilder/src/package_2020_02/models.rs @@ -90,6 +90,15 @@ impl ImageTemplateCustomizer { Self { type_, name: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateCustomizerUnion { + File(ImageTemplateFileCustomizer), + PowerShell(ImageTemplatePowerShellCustomizer), + WindowsRestart(ImageTemplateRestartCustomizer), + Shell(ImageTemplateShellCustomizer), + WindowsUpdate(ImageTemplateWindowsUpdateCustomizer), +} #[doc = "Generic distribution object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateDistributor { @@ -112,6 +121,14 @@ impl ImageTemplateDistributor { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateDistributorUnion { + ManagedImage(ImageTemplateManagedImageDistributor), + SharedImage(ImageTemplateSharedImageDistributor), + #[serde(rename = "VHD")] + Vhd(ImageTemplateVhdDistributor), +} #[doc = "Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateFileCustomizer { @@ -351,16 +368,16 @@ impl ImageTemplatePowerShellCustomizer { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateProperties { #[doc = "Describes a virtual machine image source for building, customizing and distributing"] - pub source: ImageTemplateSource, + pub source: ImageTemplateSourceUnion, #[doc = "Specifies the properties used to describe the customization steps of the image, like Image source etc"] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub customize: Vec, + pub customize: Vec, #[doc = "The distribution targets where the image output needs to go to."] - pub distribute: Vec, + pub distribute: Vec, #[doc = "Provisioning state of the resource"] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -378,7 +395,7 @@ pub struct ImageTemplateProperties { pub vm_profile: Option, } impl ImageTemplateProperties { - pub fn new(source: ImageTemplateSource, distribute: Vec) -> Self { + pub fn new(source: ImageTemplateSourceUnion, distribute: Vec) -> Self { Self { source, customize: Vec::new(), @@ -545,6 +562,13 @@ impl ImageTemplateSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateSourceUnion { + ManagedImage(ImageTemplateManagedImageSource), + PlatformImage(ImageTemplatePlatformImageSource), + SharedImageVersion(ImageTemplateSharedImageVersionSource), +} #[doc = "Parameters for updating an image template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageTemplateUpdateParameters { diff --git a/services/mgmt/imagebuilder/src/package_2021_10/models.rs b/services/mgmt/imagebuilder/src/package_2021_10/models.rs index 48058088b7..04c2dc9df0 100644 --- a/services/mgmt/imagebuilder/src/package_2021_10/models.rs +++ b/services/mgmt/imagebuilder/src/package_2021_10/models.rs @@ -85,6 +85,15 @@ impl ImageTemplateCustomizer { Self { type_, name: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateCustomizerUnion { + File(ImageTemplateFileCustomizer), + PowerShell(ImageTemplatePowerShellCustomizer), + WindowsRestart(ImageTemplateRestartCustomizer), + Shell(ImageTemplateShellCustomizer), + WindowsUpdate(ImageTemplateWindowsUpdateCustomizer), +} #[doc = "Generic distribution object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateDistributor { @@ -107,6 +116,14 @@ impl ImageTemplateDistributor { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateDistributorUnion { + ManagedImage(ImageTemplateManagedImageDistributor), + SharedImage(ImageTemplateSharedImageDistributor), + #[serde(rename = "VHD")] + Vhd(ImageTemplateVhdDistributor), +} #[doc = "Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateFileCustomizer { @@ -350,16 +367,16 @@ impl ImageTemplatePowerShellCustomizer { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateProperties { #[doc = "Describes a virtual machine image source for building, customizing and distributing"] - pub source: ImageTemplateSource, + pub source: ImageTemplateSourceUnion, #[doc = "Specifies the properties used to describe the customization steps of the image, like Image source etc"] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub customize: Vec, + pub customize: Vec, #[doc = "The distribution targets where the image output needs to go to."] - pub distribute: Vec, + pub distribute: Vec, #[doc = "Provisioning state of the resource"] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -377,7 +394,7 @@ pub struct ImageTemplateProperties { pub vm_profile: Option, } impl ImageTemplateProperties { - pub fn new(source: ImageTemplateSource, distribute: Vec) -> Self { + pub fn new(source: ImageTemplateSourceUnion, distribute: Vec) -> Self { Self { source, customize: Vec::new(), @@ -544,6 +561,13 @@ impl ImageTemplateSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateSourceUnion { + ManagedImage(ImageTemplateManagedImageSource), + PlatformImage(ImageTemplatePlatformImageSource), + SharedImageVersion(ImageTemplateSharedImageVersionSource), +} #[doc = "Parameters for updating an image template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageTemplateUpdateParameters { diff --git a/services/mgmt/imagebuilder/src/package_2022_02/models.rs b/services/mgmt/imagebuilder/src/package_2022_02/models.rs index a8193e05a2..2a66849a23 100644 --- a/services/mgmt/imagebuilder/src/package_2022_02/models.rs +++ b/services/mgmt/imagebuilder/src/package_2022_02/models.rs @@ -81,6 +81,15 @@ impl ImageTemplateCustomizer { Self { type_, name: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateCustomizerUnion { + File(ImageTemplateFileCustomizer), + PowerShell(ImageTemplatePowerShellCustomizer), + WindowsRestart(ImageTemplateRestartCustomizer), + Shell(ImageTemplateShellCustomizer), + WindowsUpdate(ImageTemplateWindowsUpdateCustomizer), +} #[doc = "Generic distribution object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateDistributor { @@ -103,6 +112,14 @@ impl ImageTemplateDistributor { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateDistributorUnion { + ManagedImage(ImageTemplateManagedImageDistributor), + SharedImage(ImageTemplateSharedImageDistributor), + #[serde(rename = "VHD")] + Vhd(ImageTemplateVhdDistributor), +} #[doc = "Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateFileCustomizer { @@ -167,6 +184,12 @@ impl ImageTemplateInVmValidator { Self { type_, name: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateInVmValidatorUnion { + PowerShell(ImageTemplatePowerShellValidator), + Shell(ImageTemplateShellValidator), +} #[doc = "Describes the latest status of running an image template"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageTemplateLastRunStatus { @@ -408,19 +431,19 @@ impl ImageTemplatePowerShellValidator { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateProperties { #[doc = "Describes a virtual machine image source for building, customizing and distributing"] - pub source: ImageTemplateSource, + pub source: ImageTemplateSourceUnion, #[doc = "Specifies the properties used to describe the customization steps of the image, like Image source etc"] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub customize: Vec, + pub customize: Vec, #[doc = "Configuration options and list of validations to be performed on the resulting image."] #[serde(default, skip_serializing_if = "Option::is_none")] pub validate: Option, #[doc = "The distribution targets where the image output needs to go to."] - pub distribute: Vec, + pub distribute: Vec, #[doc = "Provisioning state of the resource"] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -444,7 +467,7 @@ pub struct ImageTemplateProperties { pub exact_staging_resource_group: Option, } impl ImageTemplateProperties { - pub fn new(source: ImageTemplateSource, distribute: Vec) -> Self { + pub fn new(source: ImageTemplateSourceUnion, distribute: Vec) -> Self { Self { source, customize: Vec::new(), @@ -478,7 +501,7 @@ pub mod image_template_properties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub in_vm_validations: Vec, + pub in_vm_validations: Vec, } impl Validate { pub fn new() -> Self { @@ -669,6 +692,13 @@ impl ImageTemplateSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateSourceUnion { + ManagedImage(ImageTemplateManagedImageSource), + PlatformImage(ImageTemplatePlatformImageSource), + SharedImageVersion(ImageTemplateSharedImageVersionSource), +} #[doc = "Parameters for updating an image template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageTemplateUpdateParameters { diff --git a/services/mgmt/imagebuilder/src/package_2022_07/models.rs b/services/mgmt/imagebuilder/src/package_2022_07/models.rs index 7af402ae8b..865079fa70 100644 --- a/services/mgmt/imagebuilder/src/package_2022_07/models.rs +++ b/services/mgmt/imagebuilder/src/package_2022_07/models.rs @@ -57,6 +57,12 @@ impl DistributeVersioner { Self { scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "scheme")] +pub enum DistributeVersionerUnion { + Latest(DistributeVersionerLatest), + Source(DistributeVersionerSource), +} #[doc = "Generates version number that will be latest based on existing version numbers."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DistributeVersionerLatest { @@ -120,6 +126,15 @@ impl ImageTemplateCustomizer { Self { type_, name: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateCustomizerUnion { + File(ImageTemplateFileCustomizer), + PowerShell(ImageTemplatePowerShellCustomizer), + WindowsRestart(ImageTemplateRestartCustomizer), + Shell(ImageTemplateShellCustomizer), + WindowsUpdate(ImageTemplateWindowsUpdateCustomizer), +} #[doc = "Generic distribution object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateDistributor { @@ -142,6 +157,14 @@ impl ImageTemplateDistributor { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateDistributorUnion { + ManagedImage(ImageTemplateManagedImageDistributor), + SharedImage(ImageTemplateSharedImageDistributor), + #[serde(rename = "VHD")] + Vhd(ImageTemplateVhdDistributor), +} #[doc = "Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateFileCustomizer { @@ -231,6 +254,13 @@ impl ImageTemplateInVmValidator { Self { type_, name: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateInVmValidatorUnion { + File(ImageTemplateFileValidator), + PowerShell(ImageTemplatePowerShellValidator), + Shell(ImageTemplateShellValidator), +} #[doc = "Describes the latest status of running an image template"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageTemplateLastRunStatus { @@ -473,14 +503,14 @@ impl ImageTemplatePowerShellValidator { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateProperties { #[doc = "Describes a virtual machine image source for building, customizing and distributing"] - pub source: ImageTemplateSource, + pub source: ImageTemplateSourceUnion, #[doc = "Specifies the properties used to describe the customization steps of the image, like Image source etc"] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub customize: Vec, + pub customize: Vec, #[doc = "Specifies optimization to be performed on image."] #[serde(default, skip_serializing_if = "Option::is_none")] pub optimize: Option, @@ -488,7 +518,7 @@ pub struct ImageTemplateProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub validate: Option, #[doc = "The distribution targets where the image output needs to go to."] - pub distribute: Vec, + pub distribute: Vec, #[doc = "Provisioning state of the resource"] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -512,7 +542,7 @@ pub struct ImageTemplateProperties { pub exact_staging_resource_group: Option, } impl ImageTemplateProperties { - pub fn new(source: ImageTemplateSource, distribute: Vec) -> Self { + pub fn new(source: ImageTemplateSourceUnion, distribute: Vec) -> Self { Self { source, customize: Vec::new(), @@ -583,7 +613,7 @@ pub mod image_template_properties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub in_vm_validations: Vec, + pub in_vm_validations: Vec, } impl Validate { pub fn new() -> Self { @@ -648,7 +678,7 @@ pub struct ImageTemplateSharedImageDistributor { pub target_regions: Vec, #[doc = "Describes how to generate new x.y.z version number for distribution."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub versioning: Option, + pub versioning: Option, } impl ImageTemplateSharedImageDistributor { pub fn new(image_template_distributor: ImageTemplateDistributor, gallery_image_id: String) -> Self { @@ -754,6 +784,13 @@ impl ImageTemplateSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateSourceUnion { + ManagedImage(ImageTemplateManagedImageSource), + PlatformImage(ImageTemplatePlatformImageSource), + SharedImageVersion(ImageTemplateSharedImageVersionSource), +} #[doc = "Parameters for updating an image template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageTemplateUpdateParameters { @@ -1216,7 +1253,7 @@ pub struct Trigger { pub proxy_resource: ProxyResource, #[doc = "Describes the properties of a trigger"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Trigger { pub fn new() -> Self { @@ -1264,6 +1301,11 @@ impl TriggerProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum TriggerPropertiesUnion { + SourceImage(SourceImageTriggerProperties), +} #[doc = "Describes the status of a trigger"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TriggerStatus { diff --git a/services/mgmt/imagebuilder/src/package_preview_2019_05/models.rs b/services/mgmt/imagebuilder/src/package_preview_2019_05/models.rs index 451154de43..224a555949 100644 --- a/services/mgmt/imagebuilder/src/package_preview_2019_05/models.rs +++ b/services/mgmt/imagebuilder/src/package_preview_2019_05/models.rs @@ -91,6 +91,14 @@ impl ImageTemplateCustomizer { Self { type_, name: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateCustomizerUnion { + File(ImageTemplateFileCustomizer), + PowerShell(ImageTemplatePowerShellCustomizer), + WindowsRestart(ImageTemplateRestartCustomizer), + Shell(ImageTemplateShellCustomizer), +} #[doc = "Generic distribution object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateDistributor { @@ -113,6 +121,14 @@ impl ImageTemplateDistributor { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateDistributorUnion { + ManagedImage(ImageTemplateManagedImageDistributor), + SharedImage(ImageTemplateSharedImageDistributor), + #[serde(rename = "VHD")] + Vhd(ImageTemplateVhdDistributor), +} #[doc = "Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateFileCustomizer { @@ -363,16 +379,16 @@ impl ImageTemplatePowerShellCustomizer { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageTemplateProperties { #[doc = "Describes a virtual machine image source for building, customizing and distributing"] - pub source: ImageTemplateSource, + pub source: ImageTemplateSourceUnion, #[doc = "Specifies the properties used to describe the customization steps of the image, like Image source etc"] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub customize: Vec, + pub customize: Vec, #[doc = "The distribution targets where the image output needs to go to."] - pub distribute: Vec, + pub distribute: Vec, #[doc = "Provisioning state of the resource"] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -390,7 +406,7 @@ pub struct ImageTemplateProperties { pub vm_profile: Option, } impl ImageTemplateProperties { - pub fn new(source: ImageTemplateSource, distribute: Vec) -> Self { + pub fn new(source: ImageTemplateSourceUnion, distribute: Vec) -> Self { Self { source, customize: Vec::new(), @@ -507,6 +523,15 @@ impl ImageTemplateSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ImageTemplateSourceUnion { + #[serde(rename = "ISO")] + Iso(ImageTemplateIsoSource), + ManagedImage(ImageTemplateManagedImageSource), + PlatformImage(ImageTemplatePlatformImageSource), + SharedImageVersion(ImageTemplateSharedImageVersionSource), +} #[doc = "Parameters for updating an image template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageTemplateUpdateParameters { diff --git a/services/mgmt/kusto/src/schema_2019_01_21/mod.rs b/services/mgmt/kusto/src/schema_2019_01_21/mod.rs index 450d410f9d..060ff4d432 100644 --- a/services/mgmt/kusto/src/schema_2019_01_21/mod.rs +++ b/services/mgmt/kusto/src/schema_2019_01_21/mod.rs @@ -2814,7 +2814,7 @@ pub mod data_connections { cluster_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { @@ -2842,7 +2842,7 @@ pub mod data_connections { cluster_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { @@ -3214,9 +3214,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3305,8 +3305,8 @@ pub mod data_connections { } } 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`."] @@ -3326,9 +3326,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3372,7 +3372,7 @@ pub mod data_connections { pub(crate) cluster_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -3418,8 +3418,8 @@ pub mod data_connections { } } 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."] @@ -3467,9 +3467,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3513,7 +3513,7 @@ pub mod data_connections { pub(crate) cluster_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -3559,8 +3559,8 @@ pub mod data_connections { } } 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."] diff --git a/services/mgmt/kusto/src/schema_2019_01_21/models.rs b/services/mgmt/kusto/src/schema_2019_01_21/models.rs index 0a15362e81..4f76a3d6b5 100644 --- a/services/mgmt/kusto/src/schema_2019_01_21/models.rs +++ b/services/mgmt/kusto/src/schema_2019_01_21/models.rs @@ -596,6 +596,12 @@ pub mod data_connection { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectionUnion { + EventGrid(EventGridDataConnection), + EventHub(EventHubDataConnection), +} #[doc = "The result returned from a data connections check name availability request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataConnectionCheckNameRequest { @@ -628,7 +634,7 @@ pub struct DataConnectionListResult { 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 DataConnectionListResult { type Continuation = String; @@ -649,7 +655,7 @@ pub struct DataConnectionValidation { pub data_connection_name: Option, #[doc = "Class representing an data connection."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl DataConnectionValidation { pub fn new() -> Self { diff --git a/services/mgmt/kusto/src/schema_2019_05_15/mod.rs b/services/mgmt/kusto/src/schema_2019_05_15/mod.rs index 605d360ffe..0b073e294f 100644 --- a/services/mgmt/kusto/src/schema_2019_05_15/mod.rs +++ b/services/mgmt/kusto/src/schema_2019_05_15/mod.rs @@ -2814,7 +2814,7 @@ pub mod data_connections { cluster_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { @@ -2842,7 +2842,7 @@ pub mod data_connections { cluster_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { @@ -3214,9 +3214,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3305,8 +3305,8 @@ pub mod data_connections { } } 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`."] @@ -3326,9 +3326,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3372,7 +3372,7 @@ pub mod data_connections { pub(crate) cluster_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -3418,8 +3418,8 @@ pub mod data_connections { } } 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."] @@ -3467,9 +3467,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3513,7 +3513,7 @@ pub mod data_connections { pub(crate) cluster_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -3559,8 +3559,8 @@ pub mod data_connections { } } 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."] diff --git a/services/mgmt/kusto/src/schema_2019_05_15/models.rs b/services/mgmt/kusto/src/schema_2019_05_15/models.rs index 2c4f01c6a8..abc30b9b52 100644 --- a/services/mgmt/kusto/src/schema_2019_05_15/models.rs +++ b/services/mgmt/kusto/src/schema_2019_05_15/models.rs @@ -616,6 +616,13 @@ pub mod data_connection { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectionUnion { + EventGrid(EventGridDataConnection), + EventHub(EventHubDataConnection), + IotHub(IotHubDataConnection), +} #[doc = "The result returned from a data connections check name availability request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataConnectionCheckNameRequest { @@ -648,7 +655,7 @@ pub struct DataConnectionListResult { 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 DataConnectionListResult { type Continuation = String; @@ -669,7 +676,7 @@ pub struct DataConnectionValidation { pub data_connection_name: Option, #[doc = "Class representing an data connection."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl DataConnectionValidation { pub fn new() -> Self { diff --git a/services/mgmt/kusto/src/schema_2019_09_07/mod.rs b/services/mgmt/kusto/src/schema_2019_09_07/mod.rs index 015f9d7794..0969cb9ea6 100644 --- a/services/mgmt/kusto/src/schema_2019_09_07/mod.rs +++ b/services/mgmt/kusto/src/schema_2019_09_07/mod.rs @@ -1783,7 +1783,7 @@ pub mod databases { resource_group_name: impl Into, cluster_name: impl Into, database_name: impl Into, - parameters: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { @@ -1808,7 +1808,7 @@ pub mod databases { resource_group_name: impl Into, cluster_name: impl Into, database_name: impl Into, - parameters: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { @@ -2132,9 +2132,9 @@ pub mod databases { #[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::Database = serde_json::from_slice(&bytes)?; + let body: models::DatabaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2221,8 +2221,8 @@ pub mod databases { } } 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`."] @@ -2242,9 +2242,9 @@ pub mod databases { #[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::Database = serde_json::from_slice(&bytes)?; + let body: models::DatabaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2287,7 +2287,7 @@ pub mod databases { pub(crate) resource_group_name: String, pub(crate) cluster_name: String, pub(crate) database_name: String, - pub(crate) parameters: models::Database, + pub(crate) parameters: models::DatabaseUnion, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -2332,8 +2332,8 @@ pub mod databases { } } 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."] @@ -2381,9 +2381,9 @@ pub mod databases { #[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::Database = serde_json::from_slice(&bytes)?; + let body: models::DatabaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2426,7 +2426,7 @@ pub mod databases { pub(crate) resource_group_name: String, pub(crate) cluster_name: String, pub(crate) database_name: String, - pub(crate) parameters: models::Database, + pub(crate) parameters: models::DatabaseUnion, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -2471,8 +2471,8 @@ pub mod databases { } } 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."] @@ -3586,7 +3586,7 @@ pub mod data_connections { cluster_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { @@ -3614,7 +3614,7 @@ pub mod data_connections { cluster_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { @@ -3986,9 +3986,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4077,8 +4077,8 @@ pub mod data_connections { } } 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`."] @@ -4098,9 +4098,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4144,7 +4144,7 @@ pub mod data_connections { pub(crate) cluster_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -4190,8 +4190,8 @@ pub mod data_connections { } } 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."] @@ -4239,9 +4239,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4285,7 +4285,7 @@ pub mod data_connections { pub(crate) cluster_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -4331,8 +4331,8 @@ pub mod data_connections { } } 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."] diff --git a/services/mgmt/kusto/src/schema_2019_09_07/models.rs b/services/mgmt/kusto/src/schema_2019_09_07/models.rs index 37d287707f..8539bae195 100644 --- a/services/mgmt/kusto/src/schema_2019_09_07/models.rs +++ b/services/mgmt/kusto/src/schema_2019_09_07/models.rs @@ -816,6 +816,13 @@ pub mod data_connection { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectionUnion { + EventGrid(EventGridDataConnection), + EventHub(EventHubDataConnection), + IotHub(IotHubDataConnection), +} #[doc = "The result returned from a data connections check name availability request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataConnectionCheckNameRequest { @@ -848,7 +855,7 @@ pub struct DataConnectionListResult { 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 DataConnectionListResult { type Continuation = String; @@ -869,7 +876,7 @@ pub struct DataConnectionValidation { pub data_connection_name: Option, #[doc = "Class representing an data connection."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl DataConnectionValidation { pub fn new() -> Self { @@ -1030,6 +1037,12 @@ pub mod database { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DatabaseUnion { + ReadOnlyFollowing(ReadOnlyFollowingDatabase), + ReadWrite(ReadWriteDatabase), +} #[doc = "The list Kusto databases operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DatabaseListResult { @@ -1039,7 +1052,7 @@ pub struct DatabaseListResult { 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 DatabaseListResult { type Continuation = String; diff --git a/services/mgmt/machinelearning/src/package_webservices_2016_05_preview/models.rs b/services/mgmt/machinelearning/src/package_webservices_2016_05_preview/models.rs index 7697529799..5e803e3087 100644 --- a/services/mgmt/machinelearning/src/package_webservices_2016_05_preview/models.rs +++ b/services/mgmt/machinelearning/src/package_webservices_2016_05_preview/models.rs @@ -791,10 +791,10 @@ pub struct WebService { #[serde(flatten)] pub resource: Resource, #[doc = "The set of properties specific to the Azure ML web service resource."] - pub properties: WebServiceProperties, + pub properties: WebServicePropertiesUnion, } impl WebService { - pub fn new(resource: Resource, properties: WebServiceProperties) -> Self { + pub fn new(resource: Resource, properties: WebServicePropertiesUnion) -> Self { Self { resource, properties } } } @@ -952,6 +952,11 @@ pub mod web_service_properties { Graph, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "packageType")] +pub enum WebServicePropertiesUnion { + Graph(WebServicePropertiesForGraph), +} #[doc = "Properties specific to a Graph based web service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WebServicePropertiesForGraph { diff --git a/services/mgmt/machinelearning/src/package_webservices_2017_01/models.rs b/services/mgmt/machinelearning/src/package_webservices_2017_01/models.rs index f329b61f51..79846dcadb 100644 --- a/services/mgmt/machinelearning/src/package_webservices_2017_01/models.rs +++ b/services/mgmt/machinelearning/src/package_webservices_2017_01/models.rs @@ -863,7 +863,7 @@ pub struct PatchedWebService { pub patched_resource: PatchedResource, #[doc = "The set of properties specific to the Azure ML web service resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl PatchedWebService { pub fn new() -> Self { @@ -987,10 +987,10 @@ pub struct WebService { #[serde(flatten)] pub resource: Resource, #[doc = "The set of properties specific to the Azure ML web service resource."] - pub properties: WebServiceProperties, + pub properties: WebServicePropertiesUnion, } impl WebService { - pub fn new(resource: Resource, properties: WebServiceProperties) -> Self { + pub fn new(resource: Resource, properties: WebServicePropertiesUnion) -> Self { Self { resource, properties } } } @@ -1171,6 +1171,11 @@ pub mod web_service_properties { Graph, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "packageType")] +pub enum WebServicePropertiesUnion { + Graph(WebServicePropertiesForGraph), +} #[doc = "Properties specific to a Graph based web service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WebServicePropertiesForGraph { 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_2022_05_01/mod.rs b/services/mgmt/machinelearningservices/src/package_2022_05_01/mod.rs new file mode 100644 index 0000000000..316936cf97 --- /dev/null +++ b/services/mgmt/machinelearningservices/src/package_2022_05_01/mod.rs @@ -0,0 +1,16812 @@ +#![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 jobs_client(&self) -> jobs::Client { + jobs::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 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 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, "2022-05-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, "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::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, "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 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, "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 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `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, "2022-05-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, "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); + } + 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, "2022-05-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, "2022-05-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, "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 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, "2022-05-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, "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); + } + 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, "2022-05-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, "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 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, "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::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, "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 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, "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 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, "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 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, "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()), + ); + 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, "2022-05-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, "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 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, "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 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, "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()), + ); + 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, "2022-05-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, "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); + } + 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, "2022-05-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, "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::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, "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 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, "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()) + } + } + impl From for azure_core::Response { + 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, "2022-05-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, "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::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, "2022-05-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, "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 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, "2022-05-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, "2022-05-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, "2022-05-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, "2022-05-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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-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, "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 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, "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 { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-01"); + } + 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, "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(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, "2022-05-01"); + } + 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-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/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-05-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::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-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::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-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 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-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()) + } + } + impl From for azure_core::Response { + 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-05-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/{}/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-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_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-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); + } + 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-05-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::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-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 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-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 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-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()) + } + } + impl From for azure_core::Response { + 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-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 = "* `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-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); + } + 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-05-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::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-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::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-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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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-05-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(), + } + } + } + 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-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); + } + 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-05-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::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-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::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-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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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-05-01"); + } + 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, "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(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, "2022-05-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::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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-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."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_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, "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/{}/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-05-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::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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-01"); + } + 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, "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(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, "2022-05-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::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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-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, + } + } + #[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, "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(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, "2022-05-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::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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-01"); + } + 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, "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(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, "2022-05-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::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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "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 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, "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(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, "2022-05-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::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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-01"); + } + 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, "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/{}/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-05-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::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", 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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-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, + 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, + } + } + #[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, + } + 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 + } + 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-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(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); + } + 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, "2022-05-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::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, "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::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, "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 + } + 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, "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/{}/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(), + } + } + #[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, "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/{}/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, "2022-05-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::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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-01"); + } + 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(), + } + } + } + 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, "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(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, "2022-05-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::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, "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::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, "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 `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + 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, "2022-05-01"); + } + Ok(url) + } + } + } +} +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 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, "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", + 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-05-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::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, "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::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 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::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, "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 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, "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()) + } + } + impl From for azure_core::Response { + 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-05-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-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 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, "2022-05-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, "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 { + 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, "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); + } + 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, "2022-05-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, "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 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, "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 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, "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()) + } + } + impl From for azure_core::Response { + 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, "2022-05-01"); + } + 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, "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 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, "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/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-05-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, "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()), + ); + 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, "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 bc829936b4..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 { @@ -883,6 +781,13 @@ impl AssetReferenceBase { 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 { @@ -898,88 +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: AutoMlVertical, -} -impl AutoMlJob { - pub fn new(job_base: JobBase, task_details: AutoMlVertical) -> 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, - } - } -} -#[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 { @@ -993,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 { @@ -1045,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."] @@ -1115,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, @@ -1128,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")] @@ -1141,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, @@ -1151,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."] @@ -1172,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, @@ -1182,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."] @@ -1222,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, @@ -1232,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 { @@ -1287,71 +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, - } - } -} -#[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 { @@ -1360,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, @@ -1377,7 +989,7 @@ pub struct BatchDeployment { pub mini_batch_size: Option, #[doc = "Base definition for asset references."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub model: Option, + 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, @@ -1388,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, @@ -1398,57 +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, - } - } -} -#[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)] @@ -1662,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 { @@ -1717,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 { @@ -1863,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 { @@ -2106,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 { @@ -2149,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 { @@ -2207,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 { @@ -2257,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, @@ -2291,7 +1486,7 @@ pub struct CommandJob { pub command: String, #[doc = "Base definition for job distribution configuration."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, + pub distribution: Option, #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] #[serde(rename = "environmentId")] pub environment_id: String, @@ -2310,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, @@ -2329,7 +1521,6 @@ impl CommandJob { limits: None, outputs: None, parameters: None, - queue_settings: None, resources: None, } } @@ -2350,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 { @@ -2408,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 { @@ -2563,6 +1748,22 @@ pub mod compute { } } } +#[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 { @@ -2594,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 { @@ -3241,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, @@ -3296,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, @@ -3573,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 { @@ -3639,23 +2771,13 @@ impl ComputeResource { pub struct ComputeResourceSchema { #[doc = "Machine Learning compute object."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + 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 { @@ -3685,27 +2807,26 @@ impl ComputeSecrets { 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."] + #[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, } @@ -3822,8 +2943,6 @@ pub enum ConnectionAuthType { None, #[serde(rename = "SAS")] Sas, - ServicePrincipal, - AccessKey, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3854,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()), } } @@ -3867,15 +2984,6 @@ pub enum ConnectionCategory { PythonFeed, ContainerRegistry, Git, - FeatureStore, - S3, - Snowflake, - AzureSqlDb, - AzureSynapseAnalytics, - AzureMySqlDb, - AzurePostgresDb, - AzureDataLakeGen2, - Redis, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3904,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()), } } @@ -3947,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), } @@ -3981,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()), } } @@ -4006,8 +3102,6 @@ pub enum CredentialsType { None, Sas, ServicePrincipal, - KerberosKeytab, - KerberosPassword, #[serde(skip_deserializing)] UnknownValue(String), } @@ -4038,86 +3132,22 @@ 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, - } - } -} -#[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, + asset_job_input, + job_input, } } } @@ -4136,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 { @@ -4404,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, } @@ -4417,16 +3359,26 @@ impl DataVersionBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dataType")] +pub enum DataVersionBaseUnion { + #[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: DataVersionBase, + pub properties: DataVersionBaseUnion, } impl DataVersionBaseResource { - pub fn new(properties: DataVersionBase) -> Self { + pub fn new(properties: DataVersionBaseUnion) -> Self { Self { resource: Resource::default(), properties, @@ -4528,29 +3480,13 @@ 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 { #[serde(flatten)] pub resource_base: ResourceBase, #[doc = "Base definition for datastore credentials."] - pub credentials: DatastoreCredentials, + pub credentials: DatastoreCredentialsUnion, #[doc = "Enum to determine the datastore contents type."] #[serde(rename = "datastoreType")] pub datastore_type: DatastoreType, @@ -4559,7 +3495,7 @@ pub struct Datastore { pub is_default: Option, } impl Datastore { - pub fn new(credentials: DatastoreCredentials, datastore_type: DatastoreType) -> Self { + pub fn new(credentials: DatastoreCredentialsUnion, datastore_type: DatastoreType) -> Self { Self { resource_base: ResourceBase::default(), credentials, @@ -4568,6 +3504,14 @@ impl Datastore { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "datastoreType")] +pub enum DatastoreUnion { + AzureBlob(AzureBlobDatastore), + AzureDataLakeGen1(AzureDataLakeGen1Datastore), + AzureDataLakeGen2(AzureDataLakeGen2Datastore), + AzureFile(AzureFileDatastore), +} #[doc = "Base definition for datastore credentials."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatastoreCredentials { @@ -4580,16 +3524,25 @@ impl DatastoreCredentials { Self { credentials_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "credentialsType")] +pub enum DatastoreCredentialsUnion { + AccountKey(AccountKeyDatastoreCredentials), + Certificate(CertificateDatastoreCredentials), + 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: Datastore, + pub properties: DatastoreUnion, } impl DatastoreResource { - pub fn new(properties: Datastore) -> Self { + pub fn new(properties: DatastoreUnion) -> Self { Self { resource: Resource::default(), properties, @@ -4633,6 +3586,14 @@ impl DatastoreSecrets { Self { secrets_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "secretsType")] +pub enum DatastoreSecretsUnion { + AccountKey(AccountKeyDatastoreSecrets), + Certificate(CertificateDatastoreSecrets), + Sas(SasDatastoreSecrets), + ServicePrincipal(ServicePrincipalDatastoreSecrets), +} #[doc = "Enum to determine the datastore contents type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DatastoreType")] @@ -4641,7 +3602,6 @@ pub enum DatastoreType { AzureDataLakeGen1, AzureDataLakeGen2, AzureFile, - Hdfs, #[serde(skip_deserializing)] UnknownValue(String), } @@ -4671,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()), } } @@ -4699,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."] @@ -4759,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")] @@ -4970,6 +3918,13 @@ impl DistributionConfiguration { Self { distribution_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "distributionType")] +pub enum DistributionConfigurationUnion { + Mpi(Mpi), + PyTorch(PyTorch), + TensorFlow(TensorFlow), +} #[doc = "Enum to determine the job distribution type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DistributionType")] @@ -5009,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 { @@ -5041,6 +3985,13 @@ impl EarlyTerminationPolicy { } } } +#[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 { @@ -5079,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."] @@ -5177,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, @@ -5246,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 { @@ -5455,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."] @@ -5549,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 { @@ -5657,94 +4419,30 @@ impl Serialize for EnvironmentType { } } } +#[doc = "Environment version details."] #[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"] +pub struct EnvironmentVersion { + #[serde(flatten)] + pub asset_base: AssetBase, + #[doc = "Configuration settings for Docker build context"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, + 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 = "The type of operating system."] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: 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 = "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 { +impl EnvironmentVersion { pub fn new() -> Self { Self::default() } @@ -6056,74 +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(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalFqdnResponse { #[serde( @@ -6191,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>, @@ -6266,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>, @@ -6309,416 +4989,351 @@ 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, - } - } -} -#[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 FromStr for InputDeliveryMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) } } -impl FeaturesetContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() +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) } } -#[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() +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 = "A paginated list of FeaturesetJob entities."] +#[doc = "Resource requests/limits for this instance type"] #[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 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 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 services: Option, + #[doc = "The status of a job."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, + pub status: Option, } -impl FeaturesetVersionBackfillRequest { - pub fn new() -> Self { - Self::default() +impl JobBase { + pub fn new(job_type: JobType) -> Self { + Self { + 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 = "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() - } +#[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 FeaturesetVersionResource { +pub struct JobBaseResource { #[serde(flatten)] pub resource: Resource, - #[doc = "Dto object representing feature set version"] - pub properties: FeaturesetVersion, + #[doc = "Base definition for a job."] + pub properties: JobBaseUnion, } -impl FeaturesetVersionResource { - pub fn new(properties: FeaturesetVersion) -> Self { +impl JobBaseResource { + pub fn new(properties: JobBaseUnion) -> Self { Self { resource: Resource::default(), properties, } } } -#[doc = "A paginated list of FeaturesetVersion entities."] +#[doc = "A paginated list of JobBase 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."] +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 FeaturesetVersion."] + #[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 FeaturesetVersionResourceArmPaginatedResult { +impl azure_core::Continuable for JobBaseResourceArmPaginatedResult { 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 { +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 FeaturestoreEntityContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature entity"] - pub properties: FeaturestoreEntityContainer, +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 FeaturestoreEntityContainerResource { - pub fn new(properties: FeaturestoreEntityContainer) -> 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 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, +#[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), } -impl azure_core::Continuable for FeaturestoreEntityContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) +#[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 FeaturestoreEntityContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() +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) } } -#[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 { - pub fn new() -> Self { - Self::default() +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()), + } } } -#[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, +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 FeaturestoreEntityVersionResource { - pub fn new(properties: FeaturestoreEntityVersion) -> Self { +impl JobLimits { + pub fn new(job_limits_type: JobLimitsType) -> Self { Self { - resource: Resource::default(), - properties, + job_limits_type, + timeout: None, } } } -#[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 = "jobLimitsType")] +pub enum JobLimitsUnion { + Command(CommandJobLimits), + Sweep(SweepJobLimits), } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeaturestoreJobType")] -pub enum FeaturestoreJobType { - RecurrentMaterialization, - BackfillMaterialization, +#[serde(remote = "JobLimitsType")] +pub enum JobLimitsType { + Command, + Sweep, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for FeaturestoreJobType { +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 FeaturestoreJobType { +impl<'de> Deserialize<'de> for JobLimitsType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6728,35 +5343,78 @@ impl<'de> Deserialize<'de> for FeaturestoreJobType { Ok(deserialized) } } -impl Serialize for FeaturestoreJobType { +impl Serialize for JobLimitsType { 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::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 mode - determines data featurization mode."] +#[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 = "FeaturizationMode")] -pub enum FeaturizationMode { - Auto, - Custom, - Off, +#[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 FeaturizationMode { +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 FeaturizationMode { +impl<'de> Deserialize<'de> for JobOutputType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6766,69 +5424,77 @@ impl<'de> Deserialize<'de> for FeaturizationMode { Ok(deserialized) } } -impl Serialize for FeaturizationMode { +impl Serialize for JobOutputType { 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::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 = "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() - } -} +#[doc = "Job endpoint definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FlavorData { - #[doc = "Model flavor-specific data."] +pub struct JobService { + #[doc = "Url for endpoint."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option, + 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 FlavorData { +impl JobService { 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 } - } -} -#[doc = "Enum to determine forecast horizon selection mode."] +#[doc = "The status of a job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastHorizonMode")] -pub enum ForecastHorizonMode { - Auto, - Custom, +#[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 ForecastHorizonMode { +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 ForecastHorizonMode { +impl<'de> Deserialize<'de> for JobStatus { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6838,84 +5504,47 @@ impl<'de> Deserialize<'de> for ForecastHorizonMode { Ok(deserialized) } } -impl Serialize for ForecastHorizonMode { +impl Serialize for JobStatus { 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::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 = "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."] +#[doc = "Enum to determine the type of 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 = "JobType")] +pub enum JobType { + Command, + Sweep, + Pipeline, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for ForecastingModels { +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 ForecastingModels { +impl<'de> Deserialize<'de> for JobType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6925,53 +5554,34 @@ impl<'de> Deserialize<'de> for ForecastingModels { Ok(deserialized) } } -impl Serialize for ForecastingModels { +impl Serialize for JobType { 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::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 = "Primary metrics for Forecasting task."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastingPrimaryMetrics")] -pub enum ForecastingPrimaryMetrics { - SpearmanCorrelation, - NormalizedRootMeanSquaredError, - R2Score, - NormalizedMeanAbsoluteError, +#[serde(remote = "KeyType")] +pub enum KeyType { + Primary, + Secondary, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for ForecastingPrimaryMetrics { +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 ForecastingPrimaryMetrics { +impl<'de> Deserialize<'de> for KeyType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6981,280 +5591,184 @@ impl<'de> Deserialize<'de> for ForecastingPrimaryMetrics { Ok(deserialized) } } -impl Serialize for ForecastingPrimaryMetrics { +impl Serialize for KeyType { 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::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 = "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, +#[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 ForecastingSettings { - pub fn new() -> Self { - Self::default() +impl Kubernetes { + pub fn new(compute: Compute) -> Self { + Self { + compute, + kubernetes_schema: KubernetesSchema::default(), + } } } -#[doc = "Forecasting Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ForecastingTrainingSettings { +#[doc = "Properties specific to a KubernetesOnlineDeployment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct KubernetesOnlineDeployment { #[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, + 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 ForecastingTrainingSettings { - pub fn new() -> Self { - Self::default() +impl KubernetesOnlineDeployment { + pub fn new(online_deployment: OnlineDeployment) -> Self { + Self { + online_deployment, + container_resource_requirements: None, + } } } -#[doc = "Request payload to retrieve feature information from a given feature set version"] +#[doc = "Kubernetes properties"] #[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, +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 GetFeatureRequest { +impl KubernetesProperties { 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(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) - } +#[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 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()), - } +impl KubernetesSchema { + pub fn new() -> Self { + Self::default() } } -#[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, +#[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 GridSamplingAlgorithm { - pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { - Self { sampling_algorithm } +impl azure_core::Continuable for ListAmlUserFeatureResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) } } -#[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(), - } +impl ListAmlUserFeatureResult { + pub fn new() -> Self { + Self::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, +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 HdInsightProperties { +impl ListNotebookKeysResult { 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, +pub struct ListStorageAccountKeysResult { + #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] + pub user_storage_key: Option, } -impl HdInsightSchema { +impl ListStorageAccountKeysResult { 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, +#[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 IdAssetReference { - pub fn new(asset_reference_base: AssetReferenceBase, asset_id: String) -> Self { - Self { - asset_reference_base, - asset_id, - } +impl azure_core::Continuable for ListUsagesResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) } } -#[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 } +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>, @@ -7264,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 azure_core::Continuable for ListWorkspaceQuotas { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } } -impl IdleShutdownSetting { +impl ListWorkspaceQuotas { 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."] +#[doc = "Literal input type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ImageAnnotationType")] -pub enum ImageAnnotationType { - Classification, - BoundingBox, - InstanceSegmentation, - #[serde(skip_deserializing)] - UnknownValue(String), +pub struct LiteralJobInput { + #[serde(flatten)] + pub job_input: JobInput, + #[doc = "[Required] Literal value for the input."] + pub value: String, } -impl FromStr for ImageAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) +impl LiteralJobInput { + pub fn new(job_input: JobInput, value: String) -> Self { + Self { job_input, value } } } -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) - } +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +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>, @@ -7977,3633 +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::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 } - } -} -#[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::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 = "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."] +#[doc = "Defines an early termination policy based on running averages of the primary metric of all runs"] #[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) - } +pub struct MedianStoppingPolicy { + #[serde(flatten)] + pub early_termination_policy: EarlyTerminationPolicy, } -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()), - } +impl MedianStoppingPolicy { + pub fn new(early_termination_policy: EarlyTerminationPolicy) -> Self { + Self { early_termination_policy } } } -#[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, +pub struct ModelContainer { + #[serde(flatten)] + pub asset_container: AssetContainer, } -impl InstanceTypeSchema { +impl ModelContainer { 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, - } - } -} #[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: JobBase, + pub properties: ModelContainer, } -impl JobBaseResource { - pub fn new(properties: JobBase) -> 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 { - 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, - } - } -} -#[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(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, - } - } -} -#[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: JobBase, -} -impl JobScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBase) -> 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 } - } -} -#[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 } - } -} -#[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: PackageInputPathBase, -} -impl ModelPackageInput { - pub fn new(input_type: PackageInputType, path: PackageInputPathBase) -> 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 } - } -} -#[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 } - } -} -#[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(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: OnlineDeployment, - #[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: OnlineDeployment) -> 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 } - } -} -#[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 } - } -} -#[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: InferencingServer, - #[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: InferencingServer, 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, - } + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ModelContainerResourceArmPaginatedResult { + pub fn new() -> Self { + Self::default() } } -#[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>, @@ -11613,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>, @@ -11655,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 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 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 timeout: Option, + 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 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 { - pub fn new() -> Self { - Self::default() +impl azure_core::Continuable for PrivateEndpointConnectionListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None } } -#[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, - } +impl PrivateEndpointConnectionListResult { + pub fn new() -> Self { + Self::default() } } -#[doc = "The specific type of random algorithm"] +#[doc = "Properties of the PrivateEndpointConnectProperties."] #[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) - } +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 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()), +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 = "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>, @@ -12039,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>, @@ -12134,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>, @@ -12354,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>, @@ -12401,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() } @@ -12492,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, @@ -12637,6 +7557,13 @@ impl SamplingAlgorithm { 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 { @@ -12778,89 +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: ScheduleActionBase, - #[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: TriggerBase, -} -impl Schedule { - pub fn new(action: ScheduleActionBase, trigger: TriggerBase) -> 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(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, } @@ -12870,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, @@ -12947,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, @@ -13099,57 +7824,9 @@ pub struct ScriptsToExecute { #[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 } - } -} -#[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()), - } +impl ScriptsToExecute { + pub fn new() -> Self { + Self::default() } } #[doc = "Enum to determine the datastore secrets type."] @@ -13160,8 +7837,6 @@ pub enum SecretsType { Certificate, Sas, ServicePrincipal, - KerberosPassword, - KerberosKeytab, #[serde(skip_deserializing)] UnknownValue(String), } @@ -13191,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()), } } @@ -13249,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 { @@ -13365,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 { @@ -13560,174 +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: SparkJobEntry, - #[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: SparkJobEntry) -> 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(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 { @@ -13790,194 +8239,11 @@ pub mod ssl_configuration { { 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() + 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 = "Sweep job definition."] @@ -13987,7 +8253,7 @@ pub struct SweepJob { 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, + 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, @@ -13999,11 +8265,9 @@ 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: 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, @@ -14014,7 +8278,7 @@ impl SweepJob { pub fn new( job_base: JobBase, objective: Objective, - sampling_algorithm: SamplingAlgorithm, + sampling_algorithm: SamplingAlgorithmUnion, search_space: serde_json::Value, trial: TrialComponent, ) -> Self { @@ -14025,7 +8289,6 @@ impl SweepJob { limits: None, objective, outputs: None, - queue_settings: None, sampling_algorithm, search_space, trial, @@ -14111,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 { @@ -14160,420 +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 } - } -} -#[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 } - } -} -#[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)] @@ -14602,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 { @@ -14668,123 +8432,15 @@ pub struct TensorFlow { #[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 { +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 { @@ -14805,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 { @@ -14887,7 +8471,7 @@ pub struct TrialComponent { pub command: String, #[doc = "Base definition for job distribution configuration."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, + pub distribution: Option, #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] #[serde(rename = "environmentId")] pub environment_id: String, @@ -14895,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 { @@ -14910,83 +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(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, @@ -15333,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 { @@ -15417,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 { @@ -15465,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 { @@ -15683,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 { @@ -15843,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 { @@ -15852,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, @@ -15952,14 +9203,25 @@ pub mod workspace_connection_properties_v2 { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum WorkspaceConnectionPropertiesV2Union { + ManagedIdentity(ManagedIdentityAuthTypeWorkspaceConnectionProperties), + None(NoneAuthTypeWorkspaceConnectionProperties), + #[serde(rename = "PAT")] + Pat(PatAuthTypeWorkspaceConnectionProperties), + #[serde(rename = "SAS")] + Sas(SasAuthTypeWorkspaceConnectionProperties), + UsernamePassword(UsernamePasswordAuthTypeWorkspaceConnectionProperties), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkspaceConnectionPropertiesV2BasicResource { #[serde(flatten)] pub resource: Resource, - pub properties: WorkspaceConnectionPropertiesV2, + pub properties: WorkspaceConnectionPropertiesV2Union, } impl WorkspaceConnectionPropertiesV2BasicResource { - pub fn new(properties: WorkspaceConnectionPropertiesV2) -> Self { + pub fn new(properties: WorkspaceConnectionPropertiesV2Union) -> Self { Self { resource: Resource::default(), properties, @@ -15989,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, @@ -16134,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 { @@ -16167,7 +9401,6 @@ pub mod workspace_properties { Succeeded, Failed, Canceled, - SoftDeleted, #[serde(skip_deserializing)] UnknownValue(String), } @@ -16200,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()), } } @@ -16269,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 ca083046ae..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) } @@ -3938,9 +3770,9 @@ pub mod compute { #[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::ComputeSecrets = serde_json::from_slice(&bytes)?; + let body: models::ComputeSecretsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4022,14 +3854,14 @@ 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) } } 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`."] @@ -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>; + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and 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::DatastoreSecrets = 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,35 +11142,26 @@ 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 { 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")) + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + 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::ExportSummary = 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::ExportSummary, + 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 ba89ec7f7b..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 { @@ -883,6 +781,13 @@ impl AssetReferenceBase { 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 { @@ -927,10 +832,10 @@ pub struct AutoMlJob { pub resources: Option, #[doc = "AutoML vertical class.\r\nBase class for AutoML verticals - TableVertical/ImageVertical/NLPVertical"] #[serde(rename = "taskDetails")] - pub task_details: AutoMlVertical, + pub task_details: AutoMlVerticalUnion, } impl AutoMlJob { - pub fn new(job_base: JobBase, task_details: AutoMlVertical) -> Self { + pub fn new(job_base: JobBase, task_details: AutoMlVerticalUnion) -> Self { Self { job_base, environment_id: None, @@ -966,6 +871,21 @@ impl AutoMlVertical { } } } +#[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 { @@ -1075,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."] @@ -1112,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, @@ -1125,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")] @@ -1138,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, @@ -1148,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."] @@ -1169,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, @@ -1179,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."] @@ -1219,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, @@ -1272,7 +1153,7 @@ pub struct BatchDeployment { pub mini_batch_size: Option, #[doc = "Base definition for asset references."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub model: Option, + 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, @@ -1532,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")] @@ -1921,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 { @@ -1964,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 { @@ -2022,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 { @@ -2096,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, @@ -2106,7 +1941,7 @@ pub struct CommandJob { pub command: String, #[doc = "Base definition for job distribution configuration."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, + pub distribution: Option, #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] #[serde(rename = "environmentId")] pub environment_id: String, @@ -2132,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, @@ -2162,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 { @@ -2220,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 { @@ -2375,6 +2203,22 @@ pub mod compute { } } } +#[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 { @@ -2406,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 { @@ -3053,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, @@ -3108,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, @@ -3385,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 { @@ -3451,23 +3226,13 @@ impl ComputeResource { pub struct ComputeResourceSchema { #[doc = "Machine Learning compute object."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + 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 { @@ -3497,6 +3262,14 @@ impl ComputeSecrets { 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 { @@ -3509,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, } @@ -3634,8 +3409,6 @@ pub enum ConnectionAuthType { None, #[serde(rename = "SAS")] Sas, - ServicePrincipal, - AccessKey, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3666,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()), } } @@ -3679,15 +3450,6 @@ pub enum ConnectionCategory { PythonFeed, ContainerRegistry, Git, - FeatureStore, - S3, - Snowflake, - AzureSqlDb, - AzureSynapseAnalytics, - AzureMySqlDb, - AzurePostgresDb, - AzureDataLakeGen2, - Redis, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3716,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()), } } @@ -3759,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), } @@ -3793,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()), } } @@ -3818,8 +3568,6 @@ pub enum CredentialsType { None, Sas, ServicePrincipal, - KerberosKeytab, - KerberosPassword, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3850,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)] @@ -3868,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 { @@ -3959,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)] @@ -4199,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, } @@ -4212,16 +3923,26 @@ impl DataVersionBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dataType")] +pub enum DataVersionBaseUnion { + #[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: DataVersionBase, + pub properties: DataVersionBaseUnion, } impl DataVersionBaseResource { - pub fn new(properties: DataVersionBase) -> Self { + pub fn new(properties: DataVersionBaseUnion) -> Self { Self { resource: Resource::default(), properties, @@ -4323,29 +4044,13 @@ 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 { #[serde(flatten)] pub resource_base: ResourceBase, #[doc = "Base definition for datastore credentials."] - pub credentials: DatastoreCredentials, + pub credentials: DatastoreCredentialsUnion, #[doc = "Enum to determine the datastore contents type."] #[serde(rename = "datastoreType")] pub datastore_type: DatastoreType, @@ -4354,7 +4059,7 @@ pub struct Datastore { pub is_default: Option, } impl Datastore { - pub fn new(credentials: DatastoreCredentials, datastore_type: DatastoreType) -> Self { + pub fn new(credentials: DatastoreCredentialsUnion, datastore_type: DatastoreType) -> Self { Self { resource_base: ResourceBase::default(), credentials, @@ -4363,6 +4068,14 @@ impl Datastore { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "datastoreType")] +pub enum DatastoreUnion { + AzureBlob(AzureBlobDatastore), + AzureDataLakeGen1(AzureDataLakeGen1Datastore), + AzureDataLakeGen2(AzureDataLakeGen2Datastore), + AzureFile(AzureFileDatastore), +} #[doc = "Base definition for datastore credentials."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatastoreCredentials { @@ -4375,16 +4088,25 @@ impl DatastoreCredentials { Self { credentials_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "credentialsType")] +pub enum DatastoreCredentialsUnion { + AccountKey(AccountKeyDatastoreCredentials), + Certificate(CertificateDatastoreCredentials), + 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: Datastore, + pub properties: DatastoreUnion, } impl DatastoreResource { - pub fn new(properties: Datastore) -> Self { + pub fn new(properties: DatastoreUnion) -> Self { Self { resource: Resource::default(), properties, @@ -4428,6 +4150,14 @@ impl DatastoreSecrets { Self { secrets_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "secretsType")] +pub enum DatastoreSecretsUnion { + AccountKey(AccountKeyDatastoreSecrets), + Certificate(CertificateDatastoreSecrets), + Sas(SasDatastoreSecrets), + ServicePrincipal(ServicePrincipalDatastoreSecrets), +} #[doc = "Enum to determine the datastore contents type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DatastoreType")] @@ -4436,7 +4166,6 @@ pub enum DatastoreType { AzureDataLakeGen1, AzureDataLakeGen2, AzureFile, - Hdfs, #[serde(skip_deserializing)] UnknownValue(String), } @@ -4466,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()), } } @@ -4494,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."] @@ -4765,6 +4492,13 @@ impl DistributionConfiguration { Self { distribution_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "distributionType")] +pub enum DistributionConfigurationUnion { + Mpi(Mpi), + PyTorch(PyTorch), + TensorFlow(TensorFlow), +} #[doc = "Enum to determine the job distribution type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DistributionType")] @@ -4804,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 { @@ -4836,6 +4559,13 @@ impl EarlyTerminationPolicy { } } } +#[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 { @@ -4933,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, @@ -5002,100 +4721,17 @@ 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 { - 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 { +impl EndpointAuthKeys { pub fn new() -> Self { Self::default() } @@ -5211,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."] @@ -5326,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 { @@ -5413,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 { @@ -5496,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 { @@ -5812,74 +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(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalFqdnResponse { #[serde( @@ -5984,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")] @@ -6077,6 +5561,12 @@ impl ForecastHorizon { 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")] @@ -6277,13 +5767,13 @@ pub struct ForecastingSettings { 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, + 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, + 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, @@ -6292,10 +5782,10 @@ pub struct ForecastingSettings { 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, + 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, + 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, @@ -6436,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 { @@ -6489,6 +5955,14 @@ impl IdentityConfiguration { 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")] @@ -6541,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 { @@ -6756,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 { @@ -7167,7 +6511,7 @@ impl ImageObjectDetectionBase { 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, + pub early_termination: Option, #[serde(rename = "samplingAlgorithm")] pub sampling_algorithm: SamplingAlgorithmType, } @@ -7204,43 +6548,6 @@ 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")] @@ -7397,7 +6704,7 @@ pub struct JobBase { pub experiment_name: Option, #[doc = "Base definition for identity configuration."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, + pub identity: Option, #[doc = "Is the asset archived?"] #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] pub is_archived: Option, @@ -7427,16 +6734,25 @@ impl JobBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobType")] +pub enum JobBaseUnion { + #[serde(rename = "AutoML")] + AutoMl(AutoMlJob), + Command(CommandJob), + Pipeline(PipelineJob), + 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: JobBase, + pub properties: JobBaseUnion, } impl JobBaseResource { - pub fn new(properties: JobBase) -> Self { + pub fn new(properties: JobBaseUnion) -> Self { Self { resource: Resource::default(), properties, @@ -7486,7 +6802,25 @@ impl JobInput { } } } -#[doc = "Enum to determine the 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 { @@ -7556,6 +6890,12 @@ impl JobLimits { } } } +#[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 { @@ -7610,6 +6950,22 @@ impl JobOutput { } } } +#[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")] @@ -7661,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)] @@ -7724,10 +7039,10 @@ pub struct JobScheduleAction { pub schedule_action_base: ScheduleActionBase, #[doc = "Base definition for a job."] #[serde(rename = "jobDefinition")] - pub job_definition: JobBase, + pub job_definition: JobBaseUnion, } impl JobScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBase) -> Self { + pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBaseUnion) -> Self { Self { schedule_action_base, job_definition, @@ -7746,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."] @@ -7782,7 +7094,6 @@ pub enum JobStatus { NotResponding, Paused, Unknown, - Scheduled, #[serde(skip_deserializing)] UnknownValue(String), } @@ -7822,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()), } } @@ -7834,10 +7144,8 @@ pub enum JobType { #[serde(rename = "AutoML")] AutoMl, Command, - Labeling, Sweep, Pipeline, - Spark, #[serde(skip_deserializing)] UnknownValue(String), } @@ -7865,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, @@ -8082,211 +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 } - } -} -#[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")] @@ -8537,126 +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 } - } -} -#[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)] @@ -8860,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 { @@ -8912,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 { @@ -9021,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 { @@ -9088,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 { @@ -9136,6 +7942,12 @@ impl NCrossValidations { 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")] @@ -9173,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, } @@ -9355,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 { @@ -9390,63 +8046,14 @@ pub struct NodeStateCounts { 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 } - } -} -#[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()), - } + 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)] @@ -9608,7 +8215,7 @@ pub struct OnlineDeployment { pub request_settings: Option, #[doc = "Online deployment scaling configuration."] #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] - pub scale_settings: Option, + pub scale_settings: Option, } impl OnlineDeployment { pub fn new(endpoint_compute_type: EndpointComputeType) -> Self { @@ -9628,6 +8235,12 @@ impl OnlineDeployment { } } } +#[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)] @@ -9638,13 +8251,13 @@ pub struct OnlineDeploymentTrackedResource { #[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: OnlineDeployment, + 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: OnlineDeployment) -> Self { + pub fn new(tracked_resource: TrackedResource, properties: OnlineDeploymentUnion) -> Self { Self { tracked_resource, identity: None, @@ -9687,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, @@ -9705,7 +8315,6 @@ impl OnlineEndpoint { Self { endpoint_properties_base, compute: None, - mirror_traffic: None, provisioning_state: None, public_network_access: None, traffic: None, @@ -9793,6 +8402,12 @@ impl OnlineScaleSettings { 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")] @@ -9876,7 +8491,6 @@ impl Serialize for OrderString { pub enum OutputDeliveryMode { ReadWriteMount, Upload, - Direct, #[serde(skip_deserializing)] UnknownValue(String), } @@ -9904,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()), } } @@ -10052,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 { @@ -10453,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")] @@ -10611,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, @@ -10625,7 +9182,6 @@ impl RandomSamplingAlgorithm { pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { Self { sampling_algorithm, - logbase: None, rule: None, seed: None, } @@ -10668,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")] @@ -10817,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")] @@ -10867,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 { @@ -11284,6 +9751,13 @@ impl SamplingAlgorithm { 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 { @@ -11430,7 +9904,7 @@ impl Serialize for ScaleType { pub struct Schedule { #[serde(flatten)] pub resource_base: ResourceBase, - pub action: ScheduleActionBase, + pub action: ScheduleActionBaseUnion, #[doc = "Display name of schedule."] #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] pub display_name: Option, @@ -11439,10 +9913,10 @@ pub struct Schedule { pub is_enabled: Option, #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, - pub trigger: TriggerBase, + pub trigger: TriggerBaseUnion, } impl Schedule { - pub fn new(action: ScheduleActionBase, trigger: TriggerBase) -> Self { + pub fn new(action: ScheduleActionBaseUnion, trigger: TriggerBaseUnion) -> Self { Self { resource_base: ResourceBase::default(), action, @@ -11463,6 +9937,12 @@ impl ScheduleActionBase { 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 { @@ -11718,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."] @@ -11762,6 +10242,12 @@ impl Seasonality { 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")] @@ -11807,8 +10293,6 @@ pub enum SecretsType { Certificate, Sas, ServicePrincipal, - KerberosPassword, - KerberosKeytab, #[serde(skip_deserializing)] UnknownValue(String), } @@ -11838,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()), } } @@ -11896,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 { @@ -12194,184 +10661,19 @@ pub struct SkuSetting { #[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: SparkJobEntry, - #[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: SparkJobEntry) -> 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(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() +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 { @@ -12512,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")] @@ -12611,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 { @@ -12631,7 +10862,7 @@ pub struct SweepJob { 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, + 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, @@ -12645,7 +10876,7 @@ pub struct SweepJob { pub outputs: Option, #[doc = "The Sampling Algorithm used to generate hyperparameter values, along with properties to\r\nconfigure the algorithm"] #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: 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, @@ -12656,7 +10887,7 @@ impl SweepJob { pub fn new( job_base: JobBase, objective: Objective, - sampling_algorithm: SamplingAlgorithm, + sampling_algorithm: SamplingAlgorithmUnion, search_space: serde_json::Value, trial: TrialComponent, ) -> Self { @@ -12752,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 { @@ -12801,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 { @@ -12968,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, + pub n_cross_validations: 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."] @@ -13052,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, @@ -13130,6 +11155,12 @@ impl TargetLags { 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")] @@ -13178,6 +11209,12 @@ impl TargetRollingWindowSize { 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")] @@ -13318,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 { @@ -13415,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 { @@ -13446,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 { @@ -13509,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 { @@ -13528,7 +11475,7 @@ pub struct TrialComponent { pub command: String, #[doc = "Base definition for job distribution configuration."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, + pub distribution: Option, #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] #[serde(rename = "environmentId")] pub environment_id: String, @@ -13574,6 +11521,12 @@ impl TriggerBase { } } } +#[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 { @@ -14041,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 { @@ -14307,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")] @@ -14467,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 { @@ -14476,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, @@ -14576,14 +12400,25 @@ pub mod workspace_connection_properties_v2 { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum WorkspaceConnectionPropertiesV2Union { + ManagedIdentity(ManagedIdentityAuthTypeWorkspaceConnectionProperties), + None(NoneAuthTypeWorkspaceConnectionProperties), + #[serde(rename = "PAT")] + Pat(PatAuthTypeWorkspaceConnectionProperties), + #[serde(rename = "SAS")] + Sas(SasAuthTypeWorkspaceConnectionProperties), + UsernamePassword(UsernamePasswordAuthTypeWorkspaceConnectionProperties), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkspaceConnectionPropertiesV2BasicResource { #[serde(flatten)] pub resource: Resource, - pub properties: WorkspaceConnectionPropertiesV2, + pub properties: WorkspaceConnectionPropertiesV2Union, } impl WorkspaceConnectionPropertiesV2BasicResource { - pub fn new(properties: WorkspaceConnectionPropertiesV2) -> Self { + pub fn new(properties: WorkspaceConnectionPropertiesV2Union) -> Self { Self { resource: Resource::default(), properties, @@ -14613,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, @@ -14758,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 { @@ -14788,7 +12598,6 @@ pub mod workspace_properties { Succeeded, Failed, Canceled, - SoftDeleted, #[serde(skip_deserializing)] UnknownValue(String), } @@ -14821,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()), } } @@ -14890,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 0674ff200b..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) } @@ -3938,9 +3803,9 @@ pub mod compute { #[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::ComputeSecrets = serde_json::from_slice(&bytes)?; + let body: models::ComputeSecretsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4022,14 +3887,14 @@ 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) } } 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`."] @@ -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::DatastoreSecrets = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn 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 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 AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - 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."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { 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 +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::ExportSummary = serde_json::from_slice(&bytes)?; - 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::ExportSummary, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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,51 +18634,111 @@ 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 = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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 = "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/{}/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)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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 resume { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -19229,15 +18747,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 +18769,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) 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."] @@ -19295,7 +18806,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::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -19303,125 +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/{}/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) } } - } -} -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(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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; @@ -19430,162 +18851,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)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - 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, "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(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, "2022-12-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)?; + let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19630,6 +18898,8 @@ pub mod model_containers { 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."] @@ -19641,39 +18911,33 @@ pub mod model_containers { 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/{}/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-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`."] @@ -19684,7 +18948,7 @@ pub mod model_containers { } } } - pub mod create_or_update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -19693,11 +18957,6 @@ pub mod model_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::ModelContainerResource = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -19740,7 +18999,7 @@ 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, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19752,260 +19011,151 @@ pub mod model_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::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/{}/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-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 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() +} +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, } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - 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, "2022-12-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 = "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`: Model name. This is case-sensitive."] - pub fn list( + #[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, - ) -> list::RequestBuilder { - list::RequestBuilder { + 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(), - skip: None, - order_by: None, - top: None, - version: None, - description: None, - offset: None, - tags: None, - properties: None, - feed: None, - list_view_type: None, + id: id.into(), } } - #[doc = "Get 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."] - pub fn get( + #[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, - ) -> get::RequestBuilder { - get::RequestBuilder { + 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 = "Create or update 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 = "* `body`: Version entity to create or update."] - pub fn create_or_update( + #[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, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { + 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(), - body: body.into(), + id: id.into(), } } - #[doc = "Delete version."] + #[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 = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( + #[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, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::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(), - name: name.into(), - version: version.into(), + id: id.into(), } } } @@ -20018,9 +19168,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 { @@ -20064,16 +19214,9 @@ 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) job_type: Option, + pub(crate) tag: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { @@ -20082,44 +19225,14 @@ 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()); + #[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 +19240,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 +19261,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 +19278,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 +19306,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-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -20236,9 +19330,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 +19376,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 +19403,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-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 +19440,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 +19486,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 +19515,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-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`."] @@ -20468,6 +19558,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 +19572,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 +19638,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, "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, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-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 +19770,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 +19787,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 +19871,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 +19917,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 +19958,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,26 +19972,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 +20000,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 +20009,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-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -20947,9 +20024,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 +20070,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 +20097,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-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 +20134,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 +20145,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 +20156,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 +20209,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-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 +20246,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 +20263,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""] - #[doc = r" In order to execute the request without 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" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { 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 +20299,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 +20314,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-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 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 +20459,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 +20481,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({ - 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 = "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-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(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-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } - pub mod list_keys { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21481,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::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 +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."] @@ -21539,7 +20736,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 +20744,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-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`."] @@ -21576,7 +20780,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 +20789,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 +20811,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""] #[doc = r" To 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 +20849,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 +20864,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-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 delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21686,11 +20903,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 +20944,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 +20957,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 +20965,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-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 online_deployments { +pub mod online_endpoints { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21790,46 +20998,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 +21044,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 +21068,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 +21085,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 +21093,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 +21116,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 = "Retrieve online deployment logs."] + #[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 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`: 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 +21197,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 +21243,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 +21272,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 +21310,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-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); @@ -22090,15 +21324,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 +21363,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-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -22136,9 +21388,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 +21435,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 +21460,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-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`."] @@ -22240,9 +21498,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 { @@ -22284,13 +21542,16 @@ 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" 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"] @@ -22302,8 +21563,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,53 +21590,34 @@ 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-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 }) } } } @@ -22389,9 +21630,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 +21695,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 +21722,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-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 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 +21779,1750 @@ 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, "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 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"); + } + Ok(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"); + } + 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"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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"); + } + 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"); + } + 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"); + } + 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"); + } + Ok(url) + } + } + } + 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 469fe93334..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", @@ -877,6 +862,13 @@ impl AssetReferenceBase { 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 { @@ -921,10 +913,10 @@ pub struct AutoMlJob { pub resources: Option, #[doc = "AutoML vertical class.\r\nBase class for AutoML verticals - TableVertical/ImageVertical/NLPVertical"] #[serde(rename = "taskDetails")] - pub task_details: AutoMlVertical, + pub task_details: AutoMlVerticalUnion, } impl AutoMlJob { - pub fn new(job_base: JobBase, task_details: AutoMlVertical) -> Self { + pub fn new(job_base: JobBase, task_details: AutoMlVerticalUnion) -> Self { Self { job_base, environment_id: None, @@ -960,6 +952,21 @@ impl AutoMlVertical { } } } +#[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 { @@ -984,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 { @@ -1032,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."] @@ -1069,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, @@ -1082,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")] @@ -1095,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, @@ -1105,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."] @@ -1126,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, @@ -1136,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."] @@ -1176,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, @@ -1229,7 +1234,7 @@ pub struct BatchDeployment { pub mini_batch_size: Option, #[doc = "Base definition for asset references."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub model: Option, + 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, @@ -1489,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"] @@ -1506,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")] @@ -1878,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 { @@ -2053,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, @@ -2063,7 +2062,7 @@ pub struct CommandJob { pub command: String, #[doc = "Base definition for job distribution configuration."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, + pub distribution: Option, #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] #[serde(rename = "environmentId")] pub environment_id: String, @@ -2089,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, @@ -2332,6 +2330,22 @@ pub mod compute { } } } +#[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 { @@ -2363,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 { @@ -3010,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, @@ -3065,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, @@ -3342,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 { @@ -3408,7 +3364,7 @@ impl ComputeResource { pub struct ComputeResourceSchema { #[doc = "Machine Learning compute object."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ComputeResourceSchema { pub fn new() -> Self { @@ -3444,6 +3400,14 @@ impl ComputeSecrets { 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 { @@ -3456,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")] @@ -3583,8 +3547,6 @@ pub enum ConnectionAuthType { None, #[serde(rename = "SAS")] Sas, - ServicePrincipal, - AccessKey, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3615,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 { @@ -3708,8 +3706,6 @@ pub enum CredentialsType { None, Sas, ServicePrincipal, - KerberosKeytab, - KerberosPassword, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3740,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()), } } @@ -3776,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 { @@ -3873,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"] @@ -4107,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, } @@ -4120,16 +4096,26 @@ impl DataVersionBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dataType")] +pub enum DataVersionBaseUnion { + #[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: DataVersionBase, + pub properties: DataVersionBaseUnion, } impl DataVersionBaseResource { - pub fn new(properties: DataVersionBase) -> Self { + pub fn new(properties: DataVersionBaseUnion) -> Self { Self { resource: Resource::default(), properties, @@ -4231,29 +4217,13 @@ 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 { #[serde(flatten)] pub resource_base: ResourceBase, #[doc = "Base definition for datastore credentials."] - pub credentials: DatastoreCredentials, + pub credentials: DatastoreCredentialsUnion, #[doc = "Enum to determine the datastore contents type."] #[serde(rename = "datastoreType")] pub datastore_type: DatastoreType, @@ -4262,7 +4232,7 @@ pub struct Datastore { pub is_default: Option, } impl Datastore { - pub fn new(credentials: DatastoreCredentials, datastore_type: DatastoreType) -> Self { + pub fn new(credentials: DatastoreCredentialsUnion, datastore_type: DatastoreType) -> Self { Self { resource_base: ResourceBase::default(), credentials, @@ -4271,6 +4241,14 @@ impl Datastore { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "datastoreType")] +pub enum DatastoreUnion { + AzureBlob(AzureBlobDatastore), + AzureDataLakeGen1(AzureDataLakeGen1Datastore), + AzureDataLakeGen2(AzureDataLakeGen2Datastore), + AzureFile(AzureFileDatastore), +} #[doc = "Base definition for datastore credentials."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatastoreCredentials { @@ -4283,16 +4261,25 @@ impl DatastoreCredentials { Self { credentials_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "credentialsType")] +pub enum DatastoreCredentialsUnion { + AccountKey(AccountKeyDatastoreCredentials), + Certificate(CertificateDatastoreCredentials), + 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: Datastore, + pub properties: DatastoreUnion, } impl DatastoreResource { - pub fn new(properties: Datastore) -> Self { + pub fn new(properties: DatastoreUnion) -> Self { Self { resource: Resource::default(), properties, @@ -4336,6 +4323,14 @@ impl DatastoreSecrets { Self { secrets_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "secretsType")] +pub enum DatastoreSecretsUnion { + AccountKey(AccountKeyDatastoreSecrets), + Certificate(CertificateDatastoreSecrets), + Sas(SasDatastoreSecrets), + ServicePrincipal(ServicePrincipalDatastoreSecrets), +} #[doc = "Enum to determine the datastore contents type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DatastoreType")] @@ -4344,7 +4339,6 @@ pub enum DatastoreType { AzureDataLakeGen1, AzureDataLakeGen2, AzureFile, - Hdfs, #[serde(skip_deserializing)] UnknownValue(String), } @@ -4374,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()), } } @@ -4672,6 +4665,13 @@ impl DistributionConfiguration { Self { distribution_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "distributionType")] +pub enum DistributionConfigurationUnion { + Mpi(Mpi), + PyTorch(PyTorch), + TensorFlow(TensorFlow), +} #[doc = "Enum to determine the job distribution type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DistributionType")] @@ -4711,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."] @@ -4743,6 +4744,13 @@ impl EarlyTerminationPolicy { } } } +#[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 { @@ -4840,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, @@ -4909,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"] @@ -5118,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."] @@ -5228,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 { @@ -5320,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"] @@ -5383,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, @@ -5403,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 { @@ -5716,74 +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(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalFqdnResponse { #[serde( @@ -5961,6 +5929,12 @@ impl ForecastHorizon { 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")] @@ -6161,13 +6135,13 @@ pub struct ForecastingSettings { 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, + 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, + 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, @@ -6176,10 +6150,10 @@ pub struct ForecastingSettings { 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, + 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, + 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, @@ -6320,33 +6294,9 @@ impl HdInsightSchema { Self::default() } } +#[doc = "Reference to an asset via its ARM resource ID."] #[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 { +pub struct IdAssetReference { #[serde(flatten)] pub asset_reference_base: AssetReferenceBase, #[doc = "[Required] ARM resource ID of the asset."] @@ -6373,6 +6323,14 @@ impl IdentityConfiguration { 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")] @@ -6437,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, } @@ -6498,45 +6457,6 @@ 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'."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageClassification { @@ -6658,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'."] @@ -6751,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)] @@ -6774,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)] @@ -7051,7 +6971,7 @@ impl ImageObjectDetectionBase { 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, + pub early_termination: Option, #[serde(rename = "samplingAlgorithm")] pub sampling_algorithm: SamplingAlgorithmType, } @@ -7244,7 +7164,7 @@ pub struct JobBase { pub experiment_name: Option, #[doc = "Base definition for identity configuration."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, + pub identity: Option, #[doc = "Is the asset archived?"] #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] pub is_archived: Option, @@ -7274,16 +7194,25 @@ impl JobBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobType")] +pub enum JobBaseUnion { + #[serde(rename = "AutoML")] + AutoMl(AutoMlJob), + Command(CommandJob), + Pipeline(PipelineJob), + 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: JobBase, + pub properties: JobBaseUnion, } impl JobBaseResource { - pub fn new(properties: JobBase) -> Self { + pub fn new(properties: JobBaseUnion) -> Self { Self { resource: Resource::default(), properties, @@ -7333,6 +7262,24 @@ impl JobInput { } } } +#[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")] @@ -7403,6 +7350,12 @@ impl JobLimits { } } } +#[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 { @@ -7457,6 +7410,22 @@ impl JobOutput { } } } +#[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")] @@ -7508,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)] @@ -7571,10 +7499,10 @@ pub struct JobScheduleAction { pub schedule_action_base: ScheduleActionBase, #[doc = "Base definition for a job."] #[serde(rename = "jobDefinition")] - pub job_definition: JobBase, + pub job_definition: JobBaseUnion, } impl JobScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBase) -> Self { + pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBaseUnion) -> Self { Self { schedule_action_base, job_definition, @@ -7595,8 +7523,8 @@ pub struct JobService { 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."] + pub nodes: Option, + #[doc = "Port for endpoint."] #[serde(default, skip_serializing_if = "Option::is_none")] pub port: Option, #[doc = "Additional properties to set on the endpoint."] @@ -7629,7 +7557,6 @@ pub enum JobStatus { NotResponding, Paused, Unknown, - Scheduled, #[serde(skip_deserializing)] UnknownValue(String), } @@ -7669,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()), } } @@ -7681,10 +7607,8 @@ pub enum JobType { #[serde(rename = "AutoML")] AutoMl, Command, - Labeling, Sweep, Pipeline, - Spark, #[serde(skip_deserializing)] UnknownValue(String), } @@ -7712,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, @@ -7929,211 +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 } - } -} -#[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")] @@ -8384,126 +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 } - } -} -#[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)] @@ -8707,43 +8209,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 { @@ -8871,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 { @@ -8946,6 +8414,12 @@ impl NCrossValidations { 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")] @@ -8983,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, } @@ -9165,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 { @@ -9222,12 +8540,16 @@ impl Nodes { 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), } @@ -9254,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()), } } @@ -9418,7 +8739,7 @@ pub struct OnlineDeployment { pub request_settings: Option, #[doc = "Online deployment scaling configuration."] #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] - pub scale_settings: Option, + pub scale_settings: Option, } impl OnlineDeployment { pub fn new(endpoint_compute_type: EndpointComputeType) -> Self { @@ -9438,6 +8759,12 @@ impl OnlineDeployment { } } } +#[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)] @@ -9448,13 +8775,13 @@ pub struct OnlineDeploymentTrackedResource { #[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: OnlineDeployment, + 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: OnlineDeployment) -> Self { + pub fn new(tracked_resource: TrackedResource, properties: OnlineDeploymentUnion) -> Self { Self { tracked_resource, identity: None, @@ -9603,6 +8930,12 @@ impl OnlineScaleSettings { 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")] @@ -9686,7 +9019,6 @@ impl Serialize for OrderString { pub enum OutputDeliveryMode { ReadWriteMount, Upload, - Direct, #[serde(skip_deserializing)] UnknownValue(String), } @@ -9714,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()), } } @@ -9875,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, @@ -9937,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 { @@ -9988,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 { @@ -10108,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")] @@ -10263,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")] @@ -10649,21 +10084,29 @@ 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", @@ -10671,27 +10114,100 @@ pub struct Registry { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub region_details: Vec, + 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 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() } @@ -11102,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 { @@ -11113,6 +10645,13 @@ impl SamplingAlgorithm { 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 { @@ -11259,7 +10798,7 @@ impl Serialize for ScaleType { pub struct Schedule { #[serde(flatten)] pub resource_base: ResourceBase, - pub action: ScheduleActionBase, + pub action: ScheduleActionBaseUnion, #[doc = "Display name of schedule."] #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] pub display_name: Option, @@ -11268,10 +10807,10 @@ pub struct Schedule { pub is_enabled: Option, #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, - pub trigger: TriggerBase, + pub trigger: TriggerBaseUnion, } impl Schedule { - pub fn new(action: ScheduleActionBase, trigger: TriggerBase) -> Self { + pub fn new(action: ScheduleActionBaseUnion, trigger: TriggerBaseUnion) -> Self { Self { resource_base: ResourceBase::default(), action, @@ -11292,6 +10831,12 @@ impl ScheduleActionBase { 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 { @@ -11591,6 +11136,12 @@ impl Seasonality { 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")] @@ -11636,8 +11187,6 @@ pub enum SecretsType { Certificate, Sas, ServicePrincipal, - KerberosPassword, - KerberosKeytab, #[serde(skip_deserializing)] UnknownValue(String), } @@ -11667,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()), } } @@ -11725,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 { @@ -12036,171 +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: SparkJobEntry, - #[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: SparkJobEntry) -> 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(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 { @@ -12341,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")] @@ -12460,7 +11769,7 @@ pub struct SweepJob { 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, + 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, @@ -12474,7 +11783,7 @@ pub struct SweepJob { pub outputs: Option, #[doc = "The Sampling Algorithm used to generate hyperparameter values, along with properties to\r\nconfigure the algorithm"] #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: 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, @@ -12485,7 +11794,7 @@ impl SweepJob { pub fn new( job_base: JobBase, objective: Objective, - sampling_algorithm: SamplingAlgorithm, + sampling_algorithm: SamplingAlgorithmUnion, search_space: serde_json::Value, trial: TrialComponent, ) -> Self { @@ -12583,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"] @@ -12596,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, @@ -12628,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 { @@ -12795,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, + pub n_cross_validations: 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."] @@ -12882,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, @@ -12954,6 +12102,12 @@ impl TargetLags { 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")] @@ -13002,6 +12156,12 @@ impl TargetRollingWindowSize { 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")] @@ -13142,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 { @@ -13239,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"] @@ -13310,7 +12434,7 @@ pub struct TrialComponent { pub command: String, #[doc = "Base definition for job distribution configuration."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, + pub distribution: Option, #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] #[serde(rename = "environmentId")] pub environment_id: String, @@ -13356,6 +12480,12 @@ impl TriggerBase { } } } +#[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 { @@ -14089,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"] @@ -14106,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, } @@ -14171,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"] @@ -14256,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, @@ -14356,14 +13479,25 @@ pub mod workspace_connection_properties_v2 { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum WorkspaceConnectionPropertiesV2Union { + ManagedIdentity(ManagedIdentityAuthTypeWorkspaceConnectionProperties), + None(NoneAuthTypeWorkspaceConnectionProperties), + #[serde(rename = "PAT")] + Pat(PatAuthTypeWorkspaceConnectionProperties), + #[serde(rename = "SAS")] + Sas(SasAuthTypeWorkspaceConnectionProperties), + UsernamePassword(UsernamePasswordAuthTypeWorkspaceConnectionProperties), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkspaceConnectionPropertiesV2BasicResource { #[serde(flatten)] pub resource: Resource, - pub properties: WorkspaceConnectionPropertiesV2, + pub properties: WorkspaceConnectionPropertiesV2Union, } impl WorkspaceConnectionPropertiesV2BasicResource { - pub fn new(properties: WorkspaceConnectionPropertiesV2) -> Self { + pub fn new(properties: WorkspaceConnectionPropertiesV2Union) -> Self { Self { resource: Resource::default(), properties, @@ -14393,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, @@ -14538,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 { @@ -14563,7 +13677,6 @@ pub mod workspace_properties { Succeeded, Failed, Canceled, - SoftDeleted, #[serde(skip_deserializing)] UnknownValue(String), } @@ -14596,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()), } } @@ -14665,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_02/mod.rs b/services/mgmt/machinelearningservices/src/package_preview_2023_02/mod.rs deleted file mode 100644 index ce45002739..0000000000 --- a/services/mgmt/machinelearningservices/src/package_preview_2023_02/mod.rs +++ /dev/null @@ -1,29087 +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 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()) - } - 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-02-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-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::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-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 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-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 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `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-02-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-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(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-02-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-02-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-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 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-02-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-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(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-02-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-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 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-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 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-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_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-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_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-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 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-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()), - ); - 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-02-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-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 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-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 { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_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-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()), - ); - 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-02-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-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/{}/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-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::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-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::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-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 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-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 = "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-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"); - } - 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-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()), - ); - 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-02-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::ComputeSecrets = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - 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-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 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-02-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-02-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-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"); - } - 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-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::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-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::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-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) 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-02-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-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 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-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 { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_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-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) 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-02-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-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(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-02-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."] - 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 = "* `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 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 = "* `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 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 = "* `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-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/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-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) 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-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 - } - 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-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, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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-02-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."] - #[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 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`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-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/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-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) 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-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 - } - 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 { - 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, "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/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-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) 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-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 - } - 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-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) 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-02-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, "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/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-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) 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-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 - } - 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-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) 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-02-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 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 = "* `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."] - #[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."] - #[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-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/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-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) 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-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 - } - 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-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) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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-02-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."] - #[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."] - #[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."] - #[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."] - #[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(), - } - } - } - 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-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/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-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) 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-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 - } - 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-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) 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-02-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, "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/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-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) 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-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 - } - 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-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) 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-02-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, "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/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-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) 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-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 - } - 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-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) 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-02-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, "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/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-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) 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-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 - } - 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-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) 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-02-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, "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(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-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) 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-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 - } - 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-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) 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-02-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, "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 - } - }; - 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-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::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-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::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-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::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-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, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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-02-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-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 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-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/{}/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"); - } - 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-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::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::DatastoreSecrets = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - 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::ExportSummary = serde_json::from_slice(&bytes)?; - 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::ExportSummary, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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 { - 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 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-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(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-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::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-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::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-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::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-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, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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-02-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-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 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-02-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-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 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-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/{}/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"); - } - 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-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::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-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::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-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/{}/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"); - } - 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-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_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-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 - } - }; - 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-02-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-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/{}/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-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::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-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::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-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/{}/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-02-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(), - 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 { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_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, "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/{}/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-02-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, - 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/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-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::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-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::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-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::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 - } - 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) 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-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 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-02-01-preview"); - } - 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, "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()), - ); - 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-02-01-preview"); - } - Ok(url) - } - } - } -} 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 829409e6be..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::ComputeSecrets = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - 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::DatastoreSecrets = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - 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::ExportSummary = serde_json::from_slice(&bytes)?; - 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::ExportSummary, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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 ee3b18f3c2..0000000000 --- a/services/mgmt/machinelearningservices/src/package_preview_2023_04/models.rs +++ /dev/null @@ -1,19177 +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 } - } -} -#[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: AutoMlVertical, -} -impl AutoMlJob { - pub fn new(job_base: JobBase, task_details: AutoMlVertical) -> 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, - } - } -} -#[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, - } - } -} -#[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, - } - } -} -#[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()), - } - } - } -} -#[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 } - } -} -#[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(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, - } - } -} -#[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(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, - } - } -} -#[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: DataVersionBase, -} -impl DataVersionBaseResource { - pub fn new(properties: DataVersionBase) -> 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: DatastoreCredentials, - #[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: DatastoreCredentials, datastore_type: DatastoreType) -> Self { - Self { - resource_base: ResourceBase::default(), - credentials, - datastore_type, - intellectual_property: None, - is_default: None, - } - } -} -#[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 } - } -} -#[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: Datastore, -} -impl DatastoreResource { - pub fn new(properties: Datastore) -> 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 } - } -} -#[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 } - } -} -#[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(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(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 } - } -} -#[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 } - } -} -#[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 } - } -} -#[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, - } - } -} -#[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: JobBase, -} -impl JobBaseResource { - pub fn new(properties: JobBase) -> 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, - } - } -} -#[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(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, - } - } -} -#[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: JobBase, -} -impl JobScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBase) -> 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 } - } -} -#[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 } - } -} -#[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: PackageInputPathBase, -} -impl ModelPackageInput { - pub fn new(input_type: PackageInputType, path: PackageInputPathBase) -> 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(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: ModelPerformanceMetricThresholdBase, - #[serde(rename = "targetData")] - pub target_data: MonitoringInputData, -} -impl ModelPerformanceSignalBase { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - baseline_data: MonitoringInputData, - metric_threshold: ModelPerformanceMetricThresholdBase, - 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(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(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(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 } - } -} -#[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 } - } -} -#[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, - } - } -} -#[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: OneLakeArtifact, - #[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: OneLakeArtifact, 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(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: OnlineDeployment, - #[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: OnlineDeployment) -> 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 } - } -} -#[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, - } - } -} -#[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: OutboundRule, -} -impl OutboundRuleBasicResource { - pub fn new(properties: OutboundRule) -> 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 } - } -} -#[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: InferencingServer, - #[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: InferencingServer, 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 } - } -} -#[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(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(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: ScheduleActionBase, - #[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: TriggerBase, -} -impl Schedule { - pub fn new(action: ScheduleActionBase, trigger: TriggerBase) -> 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(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 } - } -} -#[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: SparkJobEntry, - #[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: SparkJobEntry) -> 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(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: SamplingAlgorithm, - #[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: SamplingAlgorithm, - 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 } - } -} -#[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 } - } -} -#[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(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, - } - } -} -#[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(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WorkspaceConnectionPropertiesV2BasicResource { - #[serde(flatten)] - pub resource: Resource, - pub properties: WorkspaceConnectionPropertiesV2, -} -impl WorkspaceConnectionPropertiesV2BasicResource { - pub fn new(properties: WorkspaceConnectionPropertiesV2) -> 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 0760e3141e..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::ComputeSecrets = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - 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::DatastoreSecrets = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - 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::ExportSummary = serde_json::from_slice(&bytes)?; - 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::ExportSummary, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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 db6825087b..0000000000 --- a/services/mgmt/machinelearningservices/src/package_preview_2023_06/models.rs +++ /dev/null @@ -1,19758 +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 } - } -} -#[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: AutoMlVertical, -} -impl AutoMlJob { - pub fn new(job_base: JobBase, task_details: AutoMlVertical) -> 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, - } - } -} -#[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, - } - } -} -#[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, - } - } -} -#[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()), - } - } - } -} -#[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 } - } -} -#[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(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: MonitoringInputDataBase, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "referenceData")] - pub reference_data: MonitoringInputDataBase, -} -impl DataDriftMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_thresholds: Vec, - production_data: MonitoringInputDataBase, - reference_data: MonitoringInputDataBase, - ) -> 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, - } - } -} -#[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(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: MonitoringInputDataBase, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "referenceData")] - pub reference_data: MonitoringInputDataBase, -} -impl DataQualityMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_thresholds: Vec, - production_data: MonitoringInputDataBase, - reference_data: MonitoringInputDataBase, - ) -> 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, - } - } -} -#[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: DataVersionBase, -} -impl DataVersionBaseResource { - pub fn new(properties: DataVersionBase) -> 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: DatastoreCredentials, - #[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: DatastoreCredentials, datastore_type: DatastoreType) -> Self { - Self { - resource_base: ResourceBase::default(), - credentials, - datastore_type, - intellectual_property: None, - is_default: None, - } - } -} -#[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 } - } -} -#[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: Datastore, -} -impl DatastoreResource { - pub fn new(properties: Datastore) -> 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 } - } -} -#[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 } - } -} -#[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(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(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: MonitoringInputDataBase, -} -impl FeatureAttributionDriftMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_threshold: FeatureAttributionMetricThreshold, - production_data: Vec, - reference_data: MonitoringInputDataBase, - ) -> 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 } - } -} -#[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 } - } -} -#[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 } - } -} -#[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, - } - } -} -#[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: JobBase, -} -impl JobBaseResource { - pub fn new(properties: JobBase) -> 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, - } - } -} -#[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(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, - } - } -} -#[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: JobBase, -} -impl JobScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBase) -> 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 } - } -} -#[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 } - } -} -#[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: PackageInputPathBase, -} -impl ModelPackageInput { - pub fn new(input_type: PackageInputType, path: PackageInputPathBase) -> 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, - } - } -} -#[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: ModelPerformanceMetricThresholdBase, - #[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: MonitoringInputDataBase, -} -impl ModelPerformanceSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_threshold: ModelPerformanceMetricThresholdBase, - production_data: Vec, - reference_data: MonitoringInputDataBase, - ) -> 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 } - } -} -#[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 } - } -} -#[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: MonitorComputeConfigurationBase, - #[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: MonitorComputeConfigurationBase, 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: MonitorComputeIdentityBase, - #[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: MonitorComputeIdentityBase, - 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(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(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, - } - } -} -#[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(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 } - } -} -#[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 } - } -} -#[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, - } - } -} -#[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: OneLakeArtifact, - #[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: OneLakeArtifact, 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(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: OnlineDeployment, - #[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: OnlineDeployment) -> 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 } - } -} -#[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_, - } - } -} -#[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: OutboundRule, -} -impl OutboundRuleBasicResource { - pub fn new(properties: OutboundRule) -> 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 } - } -} -#[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: InferencingServer, - #[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: InferencingServer, 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 } - } -} -#[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(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: MonitoringInputDataBase, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "referenceData")] - pub reference_data: MonitoringInputDataBase, -} -impl PredictionDriftMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_thresholds: Vec, - model_type: MonitoringModelType, - production_data: MonitoringInputDataBase, - reference_data: MonitoringInputDataBase, - ) -> 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(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: ScheduleActionBase, - #[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: TriggerBase, -} -impl Schedule { - pub fn new(action: ScheduleActionBase, trigger: TriggerBase) -> 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(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 } - } -} -#[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: SparkJobEntry, - #[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: SparkJobEntry) -> 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(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: SamplingAlgorithm, - #[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: SamplingAlgorithm, - 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 } - } -} -#[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 } - } -} -#[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(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, - } - } -} -#[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(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WorkspaceConnectionPropertiesV2BasicResource { - #[serde(flatten)] - pub resource: Resource, - pub properties: WorkspaceConnectionPropertiesV2, -} -impl WorkspaceConnectionPropertiesV2BasicResource { - pub fn new(properties: WorkspaceConnectionPropertiesV2) -> 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()), - } - } - } -} diff --git a/services/mgmt/mariadb/src/package_2018_06_01/models.rs b/services/mgmt/mariadb/src/package_2018_06_01/models.rs index fe28cd2d02..bfdbc05a4e 100644 --- a/services/mgmt/mariadb/src/package_2018_06_01/models.rs +++ b/services/mgmt/mariadb/src/package_2018_06_01/models.rs @@ -1213,7 +1213,7 @@ pub struct ServerForCreate { #[serde(default, skip_serializing_if = "Option::is_none")] pub sku: Option, #[doc = "The properties used to create a new server."] - pub properties: ServerPropertiesForCreate, + pub properties: ServerPropertiesForCreateUnion, #[doc = "The location the resource resides in."] pub location: String, #[doc = "Application-specific metadata in the form of key-value pairs."] @@ -1221,7 +1221,7 @@ pub struct ServerForCreate { pub tags: Option, } impl ServerForCreate { - pub fn new(properties: ServerPropertiesForCreate, location: String) -> Self { + pub fn new(properties: ServerPropertiesForCreateUnion, location: String) -> Self { Self { sku: None, properties, @@ -1600,6 +1600,14 @@ pub mod server_properties_for_create { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "createMode")] +pub enum ServerPropertiesForCreateUnion { + Default(ServerPropertiesForDefaultCreate), + GeoRestore(ServerPropertiesForGeoRestore), + Replica(ServerPropertiesForReplica), + PointInTimeRestore(ServerPropertiesForRestore), +} #[doc = "The properties used to create a new server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServerPropertiesForDefaultCreate { diff --git a/services/mgmt/mariadb/src/package_2018_06_01_preview/models.rs b/services/mgmt/mariadb/src/package_2018_06_01_preview/models.rs index d234c2d09e..13bd4effca 100644 --- a/services/mgmt/mariadb/src/package_2018_06_01_preview/models.rs +++ b/services/mgmt/mariadb/src/package_2018_06_01_preview/models.rs @@ -765,7 +765,7 @@ pub struct ServerForCreate { #[serde(default, skip_serializing_if = "Option::is_none")] pub sku: Option, #[doc = "The properties used to create a new server."] - pub properties: ServerPropertiesForCreate, + pub properties: ServerPropertiesForCreateUnion, #[doc = "The location the resource resides in."] pub location: String, #[doc = "Application-specific metadata in the form of key-value pairs."] @@ -773,7 +773,7 @@ pub struct ServerForCreate { pub tags: Option, } impl ServerForCreate { - pub fn new(properties: ServerPropertiesForCreate, location: String) -> Self { + pub fn new(properties: ServerPropertiesForCreateUnion, location: String) -> Self { Self { sku: None, properties, @@ -962,6 +962,14 @@ pub mod server_properties_for_create { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "createMode")] +pub enum ServerPropertiesForCreateUnion { + Default(ServerPropertiesForDefaultCreate), + GeoRestore(ServerPropertiesForGeoRestore), + Replica(ServerPropertiesForReplica), + PointInTimeRestore(ServerPropertiesForRestore), +} #[doc = "The properties used to create a new server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServerPropertiesForDefaultCreate { diff --git a/services/mgmt/mariadb/src/package_2018_06_01_privatepreview/models.rs b/services/mgmt/mariadb/src/package_2018_06_01_privatepreview/models.rs index f445219a8f..0711dbd7d3 100644 --- a/services/mgmt/mariadb/src/package_2018_06_01_privatepreview/models.rs +++ b/services/mgmt/mariadb/src/package_2018_06_01_privatepreview/models.rs @@ -1099,7 +1099,7 @@ pub struct ServerForCreate { #[serde(default, skip_serializing_if = "Option::is_none")] pub sku: Option, #[doc = "The properties used to create a new server."] - pub properties: ServerPropertiesForCreate, + pub properties: ServerPropertiesForCreateUnion, #[doc = "The location the resource resides in."] pub location: String, #[doc = "Application-specific metadata in the form of key-value pairs."] @@ -1107,7 +1107,7 @@ pub struct ServerForCreate { pub tags: Option, } impl ServerForCreate { - pub fn new(properties: ServerPropertiesForCreate, location: String) -> Self { + pub fn new(properties: ServerPropertiesForCreateUnion, location: String) -> Self { Self { sku: None, properties, @@ -1296,6 +1296,14 @@ pub mod server_properties_for_create { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "createMode")] +pub enum ServerPropertiesForCreateUnion { + Default(ServerPropertiesForDefaultCreate), + GeoRestore(ServerPropertiesForGeoRestore), + Replica(ServerPropertiesForReplica), + PointInTimeRestore(ServerPropertiesForRestore), +} #[doc = "The properties used to create a new server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServerPropertiesForDefaultCreate { diff --git a/services/mgmt/mariadb/src/package_2020_01_01/models.rs b/services/mgmt/mariadb/src/package_2020_01_01/models.rs index fe28cd2d02..bfdbc05a4e 100644 --- a/services/mgmt/mariadb/src/package_2020_01_01/models.rs +++ b/services/mgmt/mariadb/src/package_2020_01_01/models.rs @@ -1213,7 +1213,7 @@ pub struct ServerForCreate { #[serde(default, skip_serializing_if = "Option::is_none")] pub sku: Option, #[doc = "The properties used to create a new server."] - pub properties: ServerPropertiesForCreate, + pub properties: ServerPropertiesForCreateUnion, #[doc = "The location the resource resides in."] pub location: String, #[doc = "Application-specific metadata in the form of key-value pairs."] @@ -1221,7 +1221,7 @@ pub struct ServerForCreate { pub tags: Option, } impl ServerForCreate { - pub fn new(properties: ServerPropertiesForCreate, location: String) -> Self { + pub fn new(properties: ServerPropertiesForCreateUnion, location: String) -> Self { Self { sku: None, properties, @@ -1600,6 +1600,14 @@ pub mod server_properties_for_create { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "createMode")] +pub enum ServerPropertiesForCreateUnion { + Default(ServerPropertiesForDefaultCreate), + GeoRestore(ServerPropertiesForGeoRestore), + Replica(ServerPropertiesForReplica), + PointInTimeRestore(ServerPropertiesForRestore), +} #[doc = "The properties used to create a new server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServerPropertiesForDefaultCreate { diff --git a/services/mgmt/mediaservices/src/package_encoding_2022_05_preview/models.rs b/services/mgmt/mediaservices/src/package_encoding_2022_05_preview/models.rs index 37a31b5a03..839641c91c 100644 --- a/services/mgmt/mediaservices/src/package_encoding_2022_05_preview/models.rs +++ b/services/mgmt/mediaservices/src/package_encoding_2022_05_preview/models.rs @@ -638,7 +638,7 @@ impl AssetTrackOperationStatus { pub struct AssetTrackProperties { #[doc = "Base type for concrete track types. A derived type must be used to represent the Track."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub track: Option, + pub track: Option, #[doc = "Provisioning state of the asset track."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -1130,6 +1130,14 @@ impl ClipTime { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ClipTimeUnion { + #[serde(rename = "#Microsoft.Media.AbsoluteClipTime")] + MicrosoftMediaAbsoluteClipTime(AbsoluteClipTime), + #[serde(rename = "#Microsoft.Media.UtcClipTime")] + MicrosoftMediaUtcClipTime(UtcClipTime), +} #[doc = "A CMAF based output format."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CmafFormat { @@ -1202,6 +1210,18 @@ impl Codec { Self { odata_type, label: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum CodecUnion { + #[serde(rename = "#Microsoft.Media.Audio")] + MicrosoftMediaAudio(Audio), + #[serde(rename = "#Microsoft.Media.CopyAudio")] + MicrosoftMediaCopyAudio(CopyAudio), + #[serde(rename = "#Microsoft.Media.CopyVideo")] + MicrosoftMediaCopyVideo(CopyVideo), + #[serde(rename = "#Microsoft.Media.Video")] + MicrosoftMediaVideo(Video), +} #[doc = "Class for CommonEncryptionCbcs encryption scheme"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommonEncryptionCbcs { @@ -1327,6 +1347,20 @@ impl ContentKeyPolicyConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyConfigurationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration")] + MicrosoftMediaContentKeyPolicyClearKeyConfiguration(ContentKeyPolicyClearKeyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration")] + MicrosoftMediaContentKeyPolicyFairPlayConfiguration(ContentKeyPolicyFairPlayConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration")] + MicrosoftMediaContentKeyPolicyPlayReadyConfiguration(ContentKeyPolicyPlayReadyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration")] + MicrosoftMediaContentKeyPolicyUnknownConfiguration(ContentKeyPolicyUnknownConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration")] + MicrosoftMediaContentKeyPolicyWidevineConfiguration(ContentKeyPolicyWidevineConfiguration), +} #[doc = "Specifies a configuration for FairPlay licenses."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyFairPlayConfiguration { @@ -1455,12 +1489,12 @@ pub struct ContentKeyPolicyOption { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Base class for Content Key Policy configuration. A derived class must be used to create a configuration."] - pub configuration: ContentKeyPolicyConfiguration, + pub configuration: ContentKeyPolicyConfigurationUnion, #[doc = "Base class for Content Key Policy restrictions. A derived class must be used to create a restriction."] - pub restriction: ContentKeyPolicyRestriction, + pub restriction: ContentKeyPolicyRestrictionUnion, } impl ContentKeyPolicyOption { - pub fn new(configuration: ContentKeyPolicyConfiguration, restriction: ContentKeyPolicyRestriction) -> Self { + pub fn new(configuration: ContentKeyPolicyConfigurationUnion, restriction: ContentKeyPolicyRestrictionUnion) -> Self { Self { policy_option_id: None, name: None, @@ -1531,6 +1565,16 @@ impl ContentKeyPolicyPlayReadyContentKeyLocation { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyPlayReadyContentKeyLocationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader(ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier( + ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, + ), +} #[doc = "Configures the Explicit Analog Television Output Restriction control bits. For further details see the PlayReady Compliance Rules."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { @@ -1581,7 +1625,7 @@ pub struct ContentKeyPolicyPlayReadyLicense { pub license_type: content_key_policy_play_ready_license::LicenseType, #[doc = "Base class for content key ID location. A derived class must be used to represent the location."] #[serde(rename = "contentKeyLocation")] - pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, #[doc = "The PlayReady content type."] #[serde(rename = "contentType")] pub content_type: content_key_policy_play_ready_license::ContentType, @@ -1590,7 +1634,7 @@ impl ContentKeyPolicyPlayReadyLicense { pub fn new( allow_test_devices: bool, license_type: content_key_policy_play_ready_license::LicenseType, - content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, content_type: content_key_policy_play_ready_license::ContentType, ) -> Self { Self { @@ -1893,6 +1937,16 @@ impl ContentKeyPolicyRestriction { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyOpenRestriction")] + MicrosoftMediaContentKeyPolicyOpenRestriction(ContentKeyPolicyOpenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyTokenRestriction")] + MicrosoftMediaContentKeyPolicyTokenRestriction(ContentKeyPolicyTokenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction")] + MicrosoftMediaContentKeyPolicyUnknownRestriction(ContentKeyPolicyUnknownRestriction), +} #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRestrictionTokenKey { @@ -1905,6 +1959,16 @@ impl ContentKeyPolicyRestrictionTokenKey { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionTokenKeyUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey")] + MicrosoftMediaContentKeyPolicyRsaTokenKey(ContentKeyPolicyRsaTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey")] + MicrosoftMediaContentKeyPolicySymmetricTokenKey(ContentKeyPolicySymmetricTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey")] + MicrosoftMediaContentKeyPolicyX509CertificateTokenKey(ContentKeyPolicyX509CertificateTokenKey), +} #[doc = "Specifies a RSA key for token validation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRsaTokenKey { @@ -1967,7 +2031,7 @@ pub struct ContentKeyPolicyTokenRestriction { pub audience: String, #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[serde(rename = "primaryVerificationKey")] - pub primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + pub primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, #[doc = "A list of alternative verification keys."] #[serde( rename = "alternateVerificationKeys", @@ -1975,7 +2039,7 @@ pub struct ContentKeyPolicyTokenRestriction { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub alternate_verification_keys: Vec, + pub alternate_verification_keys: Vec, #[doc = "A list of required token claims."] #[serde( rename = "requiredClaims", @@ -1996,7 +2060,7 @@ impl ContentKeyPolicyTokenRestriction { content_key_policy_restriction: ContentKeyPolicyRestriction, issuer: String, audience: String, - primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, restriction_token_type: content_key_policy_token_restriction::RestrictionTokenType, ) -> Self { Self { @@ -2755,7 +2819,7 @@ pub struct Filters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub overlays: Vec, + pub overlays: Vec, } impl Filters { pub fn new() -> Self { @@ -2839,6 +2903,14 @@ impl Format { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum FormatUnion { + #[serde(rename = "#Microsoft.Media.ImageFormat")] + MicrosoftMediaImageFormat(ImageFormat), + #[serde(rename = "#Microsoft.Media.MultiBitrateFormat")] + MicrosoftMediaMultiBitrateFormat(MultiBitrateFormat), +} #[doc = "An InputDefinition that looks across all of the files provided to select tracks specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute to allow selection of a single track across a set of input files."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FromAllInputFile { @@ -3394,7 +3466,7 @@ pub struct InputDefinition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub included_tracks: Vec, + pub included_tracks: Vec, } impl InputDefinition { pub fn new(odata_type: String) -> Self { @@ -3404,6 +3476,16 @@ impl InputDefinition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum InputDefinitionUnion { + #[serde(rename = "#Microsoft.Media.FromAllInputFile")] + MicrosoftMediaFromAllInputFile(FromAllInputFile), + #[serde(rename = "#Microsoft.Media.FromEachInputFile")] + MicrosoftMediaFromEachInputFile(FromEachInputFile), + #[serde(rename = "#Microsoft.Media.InputFile")] + MicrosoftMediaInputFile(InputFile), +} #[doc = "An InputDefinition for a single file. TrackSelections are scoped to the file specified."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InputFile { @@ -3656,6 +3738,16 @@ impl JobInput { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobInputUnion { + #[serde(rename = "#Microsoft.Media.JobInputClip")] + MicrosoftMediaJobInputClip(JobInputClip), + #[serde(rename = "#Microsoft.Media.JobInputSequence")] + MicrosoftMediaJobInputSequence(JobInputSequence), + #[serde(rename = "#Microsoft.Media.JobInputs")] + MicrosoftMediaJobInputs(JobInputs), +} #[doc = "Represents an Asset for input into a Job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobInputAsset { @@ -3687,10 +3779,10 @@ pub struct JobInputClip { pub files: Vec, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub start: Option, + pub start: Option, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option, + pub end: Option, #[doc = "A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'."] #[serde(default, skip_serializing_if = "Option::is_none")] pub label: Option, @@ -3701,7 +3793,7 @@ pub struct JobInputClip { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub input_definitions: Vec, + pub input_definitions: Vec, } impl JobInputClip { pub fn new(job_input: JobInput) -> Self { @@ -3764,7 +3856,7 @@ pub struct JobInputs { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inputs: Vec, + pub inputs: Vec, } impl JobInputs { pub fn new(job_input: JobInput) -> Self { @@ -3785,7 +3877,7 @@ pub struct JobOutput { pub error: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] #[serde(rename = "presetOverride", default, skip_serializing_if = "Option::is_none")] - pub preset_override: Option, + pub preset_override: Option, #[doc = "Describes the state of the JobOutput."] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, @@ -3866,6 +3958,12 @@ pub mod job_output { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobOutputUnion { + #[serde(rename = "#Microsoft.Media.JobOutputAsset")] + MicrosoftMediaJobOutputAsset(JobOutputAsset), +} #[doc = "Represents an Asset used as a JobOutput."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobOutputAsset { @@ -3893,12 +3991,12 @@ pub struct JobProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Base class for inputs to a Job."] - pub input: JobInput, + pub input: JobInputUnion, #[doc = "The UTC date and time when the customer has last updated the Job, in 'YYYY-MM-DDThh:mm:ssZ' format."] #[serde(rename = "lastModified", default, with = "azure_core::date::rfc3339::option")] pub last_modified: Option, #[doc = "The outputs for the Job."] - pub outputs: Vec, + pub outputs: Vec, #[doc = "Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal."] #[serde(default, skip_serializing_if = "Option::is_none")] pub priority: Option, @@ -3913,7 +4011,7 @@ pub struct JobProperties { pub end_time: Option, } impl JobProperties { - pub fn new(input: JobInput, outputs: Vec) -> Self { + pub fn new(input: JobInputUnion, outputs: Vec) -> Self { Self { created: None, state: None, @@ -5577,6 +5675,14 @@ impl Overlay { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum OverlayUnion { + #[serde(rename = "#Microsoft.Media.AudioOverlay")] + MicrosoftMediaAudioOverlay(AudioOverlay), + #[serde(rename = "#Microsoft.Media.VideoOverlay")] + MicrosoftMediaVideoOverlay(VideoOverlay), +} #[doc = "Describes the settings for producing PNG thumbnails."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PngFormat { @@ -5656,6 +5762,18 @@ impl Preset { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum PresetUnion { + #[serde(rename = "#Microsoft.Media.AudioAnalyzerPreset")] + MicrosoftMediaAudioAnalyzerPreset(AudioAnalyzerPreset), + #[serde(rename = "#Microsoft.Media.BuiltInStandardEncoderPreset")] + MicrosoftMediaBuiltInStandardEncoderPreset(BuiltInStandardEncoderPreset), + #[serde(rename = "#Microsoft.Media.FaceDetectorPreset")] + MicrosoftMediaFaceDetectorPreset(FaceDetectorPreset), + #[serde(rename = "#Microsoft.Media.StandardEncoderPreset")] + MicrosoftMediaStandardEncoderPreset(StandardEncoderPreset), +} #[doc = "An object of optional configuration settings for encoder."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PresetConfigurations { @@ -5685,7 +5803,7 @@ pub struct PresetConfigurations { pub min_height: Option, #[doc = "Base class for output."] #[serde(rename = "outputFormat", default, skip_serializing_if = "Option::is_none")] - pub output_format: Option, + pub output_format: Option, } impl PresetConfigurations { pub fn new() -> Self { @@ -6354,12 +6472,12 @@ pub struct StandardEncoderPreset { #[serde(default, skip_serializing_if = "Option::is_none")] pub filters: Option, #[doc = "The list of codecs to be used when encoding the input video."] - pub codecs: Vec, + pub codecs: Vec, #[doc = "The list of outputs to be produced by the encoder."] - pub formats: Vec, + pub formats: Vec, } impl StandardEncoderPreset { - pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { + pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { Self { preset, filters: None, @@ -7219,6 +7337,16 @@ impl TrackBase { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackBaseUnion { + #[serde(rename = "#Microsoft.Media.AudioTrack")] + MicrosoftMediaAudioTrack(AudioTrack), + #[serde(rename = "#Microsoft.Media.TextTrack")] + MicrosoftMediaTextTrack(TextTrack), + #[serde(rename = "#Microsoft.Media.VideoTrack")] + MicrosoftMediaVideoTrack(VideoTrack), +} #[doc = "Base type for all TrackDescriptor types, which define the metadata and selection for tracks that should be processed by a Job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackDescriptor { @@ -7231,6 +7359,14 @@ impl TrackDescriptor { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackDescriptorUnion { + #[serde(rename = "#Microsoft.Media.AudioTrackDescriptor")] + MicrosoftMediaAudioTrackDescriptor(AudioTrackDescriptor), + #[serde(rename = "#Microsoft.Media.VideoTrackDescriptor")] + MicrosoftMediaVideoTrackDescriptor(VideoTrackDescriptor), +} #[doc = "Class to specify one track property condition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackPropertyCondition { @@ -7418,10 +7554,10 @@ pub struct TransformOutput { #[serde(rename = "relativePriority", default, skip_serializing_if = "Option::is_none")] pub relative_priority: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] - pub preset: Preset, + pub preset: PresetUnion, } impl TransformOutput { - pub fn new(preset: Preset) -> Self { + pub fn new(preset: PresetUnion) -> Self { Self { on_error: None, relative_priority: None, diff --git a/services/mgmt/mediaservices/src/package_encoding_2022_07/models.rs b/services/mgmt/mediaservices/src/package_encoding_2022_07/models.rs index 929dc5f40a..0707780478 100644 --- a/services/mgmt/mediaservices/src/package_encoding_2022_07/models.rs +++ b/services/mgmt/mediaservices/src/package_encoding_2022_07/models.rs @@ -638,7 +638,7 @@ impl AssetTrackOperationStatus { pub struct AssetTrackProperties { #[doc = "Base type for concrete track types. A derived type must be used to represent the Track."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub track: Option, + pub track: Option, #[doc = "Provisioning state of the asset track."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -1130,6 +1130,14 @@ impl ClipTime { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ClipTimeUnion { + #[serde(rename = "#Microsoft.Media.AbsoluteClipTime")] + MicrosoftMediaAbsoluteClipTime(AbsoluteClipTime), + #[serde(rename = "#Microsoft.Media.UtcClipTime")] + MicrosoftMediaUtcClipTime(UtcClipTime), +} #[doc = "Describes the basic properties of all codecs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Codec { @@ -1145,6 +1153,18 @@ impl Codec { Self { odata_type, label: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum CodecUnion { + #[serde(rename = "#Microsoft.Media.Audio")] + MicrosoftMediaAudio(Audio), + #[serde(rename = "#Microsoft.Media.CopyAudio")] + MicrosoftMediaCopyAudio(CopyAudio), + #[serde(rename = "#Microsoft.Media.CopyVideo")] + MicrosoftMediaCopyVideo(CopyVideo), + #[serde(rename = "#Microsoft.Media.Video")] + MicrosoftMediaVideo(Video), +} #[doc = "Class for CommonEncryptionCbcs encryption scheme"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommonEncryptionCbcs { @@ -1270,6 +1290,20 @@ impl ContentKeyPolicyConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyConfigurationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration")] + MicrosoftMediaContentKeyPolicyClearKeyConfiguration(ContentKeyPolicyClearKeyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration")] + MicrosoftMediaContentKeyPolicyFairPlayConfiguration(ContentKeyPolicyFairPlayConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration")] + MicrosoftMediaContentKeyPolicyPlayReadyConfiguration(ContentKeyPolicyPlayReadyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration")] + MicrosoftMediaContentKeyPolicyUnknownConfiguration(ContentKeyPolicyUnknownConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration")] + MicrosoftMediaContentKeyPolicyWidevineConfiguration(ContentKeyPolicyWidevineConfiguration), +} #[doc = "Specifies a configuration for FairPlay licenses."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyFairPlayConfiguration { @@ -1398,12 +1432,12 @@ pub struct ContentKeyPolicyOption { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Base class for Content Key Policy configuration. A derived class must be used to create a configuration."] - pub configuration: ContentKeyPolicyConfiguration, + pub configuration: ContentKeyPolicyConfigurationUnion, #[doc = "Base class for Content Key Policy restrictions. A derived class must be used to create a restriction."] - pub restriction: ContentKeyPolicyRestriction, + pub restriction: ContentKeyPolicyRestrictionUnion, } impl ContentKeyPolicyOption { - pub fn new(configuration: ContentKeyPolicyConfiguration, restriction: ContentKeyPolicyRestriction) -> Self { + pub fn new(configuration: ContentKeyPolicyConfigurationUnion, restriction: ContentKeyPolicyRestrictionUnion) -> Self { Self { policy_option_id: None, name: None, @@ -1474,6 +1508,16 @@ impl ContentKeyPolicyPlayReadyContentKeyLocation { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyPlayReadyContentKeyLocationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader(ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier( + ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, + ), +} #[doc = "Configures the Explicit Analog Television Output Restriction control bits. For further details see the PlayReady Compliance Rules."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { @@ -1524,7 +1568,7 @@ pub struct ContentKeyPolicyPlayReadyLicense { pub license_type: content_key_policy_play_ready_license::LicenseType, #[doc = "Base class for content key ID location. A derived class must be used to represent the location."] #[serde(rename = "contentKeyLocation")] - pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, #[doc = "The PlayReady content type."] #[serde(rename = "contentType")] pub content_type: content_key_policy_play_ready_license::ContentType, @@ -1533,7 +1577,7 @@ impl ContentKeyPolicyPlayReadyLicense { pub fn new( allow_test_devices: bool, license_type: content_key_policy_play_ready_license::LicenseType, - content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, content_type: content_key_policy_play_ready_license::ContentType, ) -> Self { Self { @@ -1836,6 +1880,16 @@ impl ContentKeyPolicyRestriction { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyOpenRestriction")] + MicrosoftMediaContentKeyPolicyOpenRestriction(ContentKeyPolicyOpenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyTokenRestriction")] + MicrosoftMediaContentKeyPolicyTokenRestriction(ContentKeyPolicyTokenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction")] + MicrosoftMediaContentKeyPolicyUnknownRestriction(ContentKeyPolicyUnknownRestriction), +} #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRestrictionTokenKey { @@ -1848,6 +1902,16 @@ impl ContentKeyPolicyRestrictionTokenKey { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionTokenKeyUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey")] + MicrosoftMediaContentKeyPolicyRsaTokenKey(ContentKeyPolicyRsaTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey")] + MicrosoftMediaContentKeyPolicySymmetricTokenKey(ContentKeyPolicySymmetricTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey")] + MicrosoftMediaContentKeyPolicyX509CertificateTokenKey(ContentKeyPolicyX509CertificateTokenKey), +} #[doc = "Specifies a RSA key for token validation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRsaTokenKey { @@ -1910,7 +1974,7 @@ pub struct ContentKeyPolicyTokenRestriction { pub audience: String, #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[serde(rename = "primaryVerificationKey")] - pub primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + pub primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, #[doc = "A list of alternative verification keys."] #[serde( rename = "alternateVerificationKeys", @@ -1918,7 +1982,7 @@ pub struct ContentKeyPolicyTokenRestriction { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub alternate_verification_keys: Vec, + pub alternate_verification_keys: Vec, #[doc = "A list of required token claims."] #[serde( rename = "requiredClaims", @@ -1939,7 +2003,7 @@ impl ContentKeyPolicyTokenRestriction { content_key_policy_restriction: ContentKeyPolicyRestriction, issuer: String, audience: String, - primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, restriction_token_type: content_key_policy_token_restriction::RestrictionTokenType, ) -> Self { Self { @@ -2725,7 +2789,7 @@ pub struct Filters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub overlays: Vec, + pub overlays: Vec, } impl Filters { pub fn new() -> Self { @@ -2809,6 +2873,14 @@ impl Format { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum FormatUnion { + #[serde(rename = "#Microsoft.Media.ImageFormat")] + MicrosoftMediaImageFormat(ImageFormat), + #[serde(rename = "#Microsoft.Media.MultiBitrateFormat")] + MicrosoftMediaMultiBitrateFormat(MultiBitrateFormat), +} #[doc = "An InputDefinition that looks across all of the files provided to select tracks specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute to allow selection of a single track across a set of input files."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FromAllInputFile { @@ -3364,7 +3436,7 @@ pub struct InputDefinition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub included_tracks: Vec, + pub included_tracks: Vec, } impl InputDefinition { pub fn new(odata_type: String) -> Self { @@ -3374,6 +3446,16 @@ impl InputDefinition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum InputDefinitionUnion { + #[serde(rename = "#Microsoft.Media.FromAllInputFile")] + MicrosoftMediaFromAllInputFile(FromAllInputFile), + #[serde(rename = "#Microsoft.Media.FromEachInputFile")] + MicrosoftMediaFromEachInputFile(FromEachInputFile), + #[serde(rename = "#Microsoft.Media.InputFile")] + MicrosoftMediaInputFile(InputFile), +} #[doc = "An InputDefinition for a single file. TrackSelections are scoped to the file specified."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InputFile { @@ -3626,6 +3708,16 @@ impl JobInput { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobInputUnion { + #[serde(rename = "#Microsoft.Media.JobInputClip")] + MicrosoftMediaJobInputClip(JobInputClip), + #[serde(rename = "#Microsoft.Media.JobInputSequence")] + MicrosoftMediaJobInputSequence(JobInputSequence), + #[serde(rename = "#Microsoft.Media.JobInputs")] + MicrosoftMediaJobInputs(JobInputs), +} #[doc = "Represents an Asset for input into a Job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobInputAsset { @@ -3657,10 +3749,10 @@ pub struct JobInputClip { pub files: Vec, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub start: Option, + pub start: Option, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option, + pub end: Option, #[doc = "A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'."] #[serde(default, skip_serializing_if = "Option::is_none")] pub label: Option, @@ -3671,7 +3763,7 @@ pub struct JobInputClip { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub input_definitions: Vec, + pub input_definitions: Vec, } impl JobInputClip { pub fn new(job_input: JobInput) -> Self { @@ -3734,7 +3826,7 @@ pub struct JobInputs { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inputs: Vec, + pub inputs: Vec, } impl JobInputs { pub fn new(job_input: JobInput) -> Self { @@ -3755,7 +3847,7 @@ pub struct JobOutput { pub error: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] #[serde(rename = "presetOverride", default, skip_serializing_if = "Option::is_none")] - pub preset_override: Option, + pub preset_override: Option, #[doc = "Describes the state of the JobOutput."] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, @@ -3836,6 +3928,12 @@ pub mod job_output { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobOutputUnion { + #[serde(rename = "#Microsoft.Media.JobOutputAsset")] + MicrosoftMediaJobOutputAsset(JobOutputAsset), +} #[doc = "Represents an Asset used as a JobOutput."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobOutputAsset { @@ -3863,12 +3961,12 @@ pub struct JobProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Base class for inputs to a Job."] - pub input: JobInput, + pub input: JobInputUnion, #[doc = "The UTC date and time when the customer has last updated the Job, in 'YYYY-MM-DDThh:mm:ssZ' format."] #[serde(rename = "lastModified", default, with = "azure_core::date::rfc3339::option")] pub last_modified: Option, #[doc = "The outputs for the Job."] - pub outputs: Vec, + pub outputs: Vec, #[doc = "Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal."] #[serde(default, skip_serializing_if = "Option::is_none")] pub priority: Option, @@ -3883,7 +3981,7 @@ pub struct JobProperties { pub end_time: Option, } impl JobProperties { - pub fn new(input: JobInput, outputs: Vec) -> Self { + pub fn new(input: JobInputUnion, outputs: Vec) -> Self { Self { created: None, state: None, @@ -5547,6 +5645,14 @@ impl Overlay { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum OverlayUnion { + #[serde(rename = "#Microsoft.Media.AudioOverlay")] + MicrosoftMediaAudioOverlay(AudioOverlay), + #[serde(rename = "#Microsoft.Media.VideoOverlay")] + MicrosoftMediaVideoOverlay(VideoOverlay), +} #[doc = "Describes the settings for producing PNG thumbnails."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PngFormat { @@ -5626,6 +5732,18 @@ impl Preset { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum PresetUnion { + #[serde(rename = "#Microsoft.Media.AudioAnalyzerPreset")] + MicrosoftMediaAudioAnalyzerPreset(AudioAnalyzerPreset), + #[serde(rename = "#Microsoft.Media.BuiltInStandardEncoderPreset")] + MicrosoftMediaBuiltInStandardEncoderPreset(BuiltInStandardEncoderPreset), + #[serde(rename = "#Microsoft.Media.FaceDetectorPreset")] + MicrosoftMediaFaceDetectorPreset(FaceDetectorPreset), + #[serde(rename = "#Microsoft.Media.StandardEncoderPreset")] + MicrosoftMediaStandardEncoderPreset(StandardEncoderPreset), +} #[doc = "An object of optional configuration settings for encoder."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PresetConfigurations { @@ -6324,12 +6442,12 @@ pub struct StandardEncoderPreset { #[serde(default, skip_serializing_if = "Option::is_none")] pub filters: Option, #[doc = "The list of codecs to be used when encoding the input video."] - pub codecs: Vec, + pub codecs: Vec, #[doc = "The list of outputs to be produced by the encoder."] - pub formats: Vec, + pub formats: Vec, } impl StandardEncoderPreset { - pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { + pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { Self { preset, experimental_options: None, @@ -7190,6 +7308,16 @@ impl TrackBase { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackBaseUnion { + #[serde(rename = "#Microsoft.Media.AudioTrack")] + MicrosoftMediaAudioTrack(AudioTrack), + #[serde(rename = "#Microsoft.Media.TextTrack")] + MicrosoftMediaTextTrack(TextTrack), + #[serde(rename = "#Microsoft.Media.VideoTrack")] + MicrosoftMediaVideoTrack(VideoTrack), +} #[doc = "Base type for all TrackDescriptor types, which define the metadata and selection for tracks that should be processed by a Job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackDescriptor { @@ -7202,6 +7330,14 @@ impl TrackDescriptor { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackDescriptorUnion { + #[serde(rename = "#Microsoft.Media.AudioTrackDescriptor")] + MicrosoftMediaAudioTrackDescriptor(AudioTrackDescriptor), + #[serde(rename = "#Microsoft.Media.VideoTrackDescriptor")] + MicrosoftMediaVideoTrackDescriptor(VideoTrackDescriptor), +} #[doc = "Class to specify one track property condition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackPropertyCondition { @@ -7389,10 +7525,10 @@ pub struct TransformOutput { #[serde(rename = "relativePriority", default, skip_serializing_if = "Option::is_none")] pub relative_priority: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] - pub preset: Preset, + pub preset: PresetUnion, } impl TransformOutput { - pub fn new(preset: Preset) -> Self { + pub fn new(preset: PresetUnion) -> Self { Self { on_error: None, relative_priority: None, diff --git a/services/mgmt/mediaservices/src/package_metadata_2022_08/models.rs b/services/mgmt/mediaservices/src/package_metadata_2022_08/models.rs index d0362409ae..26a4161b2b 100644 --- a/services/mgmt/mediaservices/src/package_metadata_2022_08/models.rs +++ b/services/mgmt/mediaservices/src/package_metadata_2022_08/models.rs @@ -638,7 +638,7 @@ impl AssetTrackOperationStatus { pub struct AssetTrackProperties { #[doc = "Base type for concrete track types. A derived type must be used to represent the Track."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub track: Option, + pub track: Option, #[doc = "Provisioning state of the asset track."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -1127,6 +1127,14 @@ impl ClipTime { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ClipTimeUnion { + #[serde(rename = "#Microsoft.Media.AbsoluteClipTime")] + MicrosoftMediaAbsoluteClipTime(AbsoluteClipTime), + #[serde(rename = "#Microsoft.Media.UtcClipTime")] + MicrosoftMediaUtcClipTime(UtcClipTime), +} #[doc = "Describes the basic properties of all codecs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Codec { @@ -1142,6 +1150,18 @@ impl Codec { Self { odata_type, label: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum CodecUnion { + #[serde(rename = "#Microsoft.Media.Audio")] + MicrosoftMediaAudio(Audio), + #[serde(rename = "#Microsoft.Media.CopyAudio")] + MicrosoftMediaCopyAudio(CopyAudio), + #[serde(rename = "#Microsoft.Media.CopyVideo")] + MicrosoftMediaCopyVideo(CopyVideo), + #[serde(rename = "#Microsoft.Media.Video")] + MicrosoftMediaVideo(Video), +} #[doc = "Class for CommonEncryptionCbcs encryption scheme"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommonEncryptionCbcs { @@ -1267,6 +1287,20 @@ impl ContentKeyPolicyConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyConfigurationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration")] + MicrosoftMediaContentKeyPolicyClearKeyConfiguration(ContentKeyPolicyClearKeyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration")] + MicrosoftMediaContentKeyPolicyFairPlayConfiguration(ContentKeyPolicyFairPlayConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration")] + MicrosoftMediaContentKeyPolicyPlayReadyConfiguration(ContentKeyPolicyPlayReadyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration")] + MicrosoftMediaContentKeyPolicyUnknownConfiguration(ContentKeyPolicyUnknownConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration")] + MicrosoftMediaContentKeyPolicyWidevineConfiguration(ContentKeyPolicyWidevineConfiguration), +} #[doc = "Specifies a configuration for FairPlay licenses."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyFairPlayConfiguration { @@ -1395,12 +1429,12 @@ pub struct ContentKeyPolicyOption { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Base class for Content Key Policy configuration. A derived class must be used to create a configuration."] - pub configuration: ContentKeyPolicyConfiguration, + pub configuration: ContentKeyPolicyConfigurationUnion, #[doc = "Base class for Content Key Policy restrictions. A derived class must be used to create a restriction."] - pub restriction: ContentKeyPolicyRestriction, + pub restriction: ContentKeyPolicyRestrictionUnion, } impl ContentKeyPolicyOption { - pub fn new(configuration: ContentKeyPolicyConfiguration, restriction: ContentKeyPolicyRestriction) -> Self { + pub fn new(configuration: ContentKeyPolicyConfigurationUnion, restriction: ContentKeyPolicyRestrictionUnion) -> Self { Self { policy_option_id: None, name: None, @@ -1471,6 +1505,16 @@ impl ContentKeyPolicyPlayReadyContentKeyLocation { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyPlayReadyContentKeyLocationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader(ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier( + ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, + ), +} #[doc = "Configures the Explicit Analog Television Output Restriction control bits. For further details see the PlayReady Compliance Rules."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { @@ -1521,7 +1565,7 @@ pub struct ContentKeyPolicyPlayReadyLicense { pub license_type: content_key_policy_play_ready_license::LicenseType, #[doc = "Base class for content key ID location. A derived class must be used to represent the location."] #[serde(rename = "contentKeyLocation")] - pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, #[doc = "The PlayReady content type."] #[serde(rename = "contentType")] pub content_type: content_key_policy_play_ready_license::ContentType, @@ -1530,7 +1574,7 @@ impl ContentKeyPolicyPlayReadyLicense { pub fn new( allow_test_devices: bool, license_type: content_key_policy_play_ready_license::LicenseType, - content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, content_type: content_key_policy_play_ready_license::ContentType, ) -> Self { Self { @@ -1833,6 +1877,16 @@ impl ContentKeyPolicyRestriction { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyOpenRestriction")] + MicrosoftMediaContentKeyPolicyOpenRestriction(ContentKeyPolicyOpenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyTokenRestriction")] + MicrosoftMediaContentKeyPolicyTokenRestriction(ContentKeyPolicyTokenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction")] + MicrosoftMediaContentKeyPolicyUnknownRestriction(ContentKeyPolicyUnknownRestriction), +} #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRestrictionTokenKey { @@ -1845,6 +1899,16 @@ impl ContentKeyPolicyRestrictionTokenKey { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionTokenKeyUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey")] + MicrosoftMediaContentKeyPolicyRsaTokenKey(ContentKeyPolicyRsaTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey")] + MicrosoftMediaContentKeyPolicySymmetricTokenKey(ContentKeyPolicySymmetricTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey")] + MicrosoftMediaContentKeyPolicyX509CertificateTokenKey(ContentKeyPolicyX509CertificateTokenKey), +} #[doc = "Specifies a RSA key for token validation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRsaTokenKey { @@ -1907,7 +1971,7 @@ pub struct ContentKeyPolicyTokenRestriction { pub audience: String, #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[serde(rename = "primaryVerificationKey")] - pub primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + pub primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, #[doc = "A list of alternative verification keys."] #[serde( rename = "alternateVerificationKeys", @@ -1915,7 +1979,7 @@ pub struct ContentKeyPolicyTokenRestriction { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub alternate_verification_keys: Vec, + pub alternate_verification_keys: Vec, #[doc = "A list of required token claims."] #[serde( rename = "requiredClaims", @@ -1936,7 +2000,7 @@ impl ContentKeyPolicyTokenRestriction { content_key_policy_restriction: ContentKeyPolicyRestriction, issuer: String, audience: String, - primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, restriction_token_type: content_key_policy_token_restriction::RestrictionTokenType, ) -> Self { Self { @@ -2684,7 +2748,7 @@ pub struct Filters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub overlays: Vec, + pub overlays: Vec, } impl Filters { pub fn new() -> Self { @@ -2768,6 +2832,14 @@ impl Format { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum FormatUnion { + #[serde(rename = "#Microsoft.Media.ImageFormat")] + MicrosoftMediaImageFormat(ImageFormat), + #[serde(rename = "#Microsoft.Media.MultiBitrateFormat")] + MicrosoftMediaMultiBitrateFormat(MultiBitrateFormat), +} #[doc = "An InputDefinition that looks across all of the files provided to select tracks specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute to allow selection of a single track across a set of input files."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FromAllInputFile { @@ -3323,7 +3395,7 @@ pub struct InputDefinition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub included_tracks: Vec, + pub included_tracks: Vec, } impl InputDefinition { pub fn new(odata_type: String) -> Self { @@ -3333,6 +3405,16 @@ impl InputDefinition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum InputDefinitionUnion { + #[serde(rename = "#Microsoft.Media.FromAllInputFile")] + MicrosoftMediaFromAllInputFile(FromAllInputFile), + #[serde(rename = "#Microsoft.Media.FromEachInputFile")] + MicrosoftMediaFromEachInputFile(FromEachInputFile), + #[serde(rename = "#Microsoft.Media.InputFile")] + MicrosoftMediaInputFile(InputFile), +} #[doc = "An InputDefinition for a single file. TrackSelections are scoped to the file specified."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InputFile { @@ -3581,6 +3663,16 @@ impl JobInput { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobInputUnion { + #[serde(rename = "#Microsoft.Media.JobInputClip")] + MicrosoftMediaJobInputClip(JobInputClip), + #[serde(rename = "#Microsoft.Media.JobInputSequence")] + MicrosoftMediaJobInputSequence(JobInputSequence), + #[serde(rename = "#Microsoft.Media.JobInputs")] + MicrosoftMediaJobInputs(JobInputs), +} #[doc = "Represents an Asset for input into a Job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobInputAsset { @@ -3612,10 +3704,10 @@ pub struct JobInputClip { pub files: Vec, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub start: Option, + pub start: Option, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option, + pub end: Option, #[doc = "A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'."] #[serde(default, skip_serializing_if = "Option::is_none")] pub label: Option, @@ -3626,7 +3718,7 @@ pub struct JobInputClip { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub input_definitions: Vec, + pub input_definitions: Vec, } impl JobInputClip { pub fn new(job_input: JobInput) -> Self { @@ -3689,7 +3781,7 @@ pub struct JobInputs { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inputs: Vec, + pub inputs: Vec, } impl JobInputs { pub fn new(job_input: JobInput) -> Self { @@ -3710,7 +3802,7 @@ pub struct JobOutput { pub error: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] #[serde(rename = "presetOverride", default, skip_serializing_if = "Option::is_none")] - pub preset_override: Option, + pub preset_override: Option, #[doc = "Describes the state of the JobOutput."] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, @@ -3791,6 +3883,12 @@ pub mod job_output { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobOutputUnion { + #[serde(rename = "#Microsoft.Media.JobOutputAsset")] + MicrosoftMediaJobOutputAsset(JobOutputAsset), +} #[doc = "Represents an Asset used as a JobOutput."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobOutputAsset { @@ -3818,12 +3916,12 @@ pub struct JobProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Base class for inputs to a Job."] - pub input: JobInput, + pub input: JobInputUnion, #[doc = "The UTC date and time when the customer has last updated the Job, in 'YYYY-MM-DDThh:mm:ssZ' format."] #[serde(rename = "lastModified", default, with = "azure_core::date::rfc3339::option")] pub last_modified: Option, #[doc = "The outputs for the Job."] - pub outputs: Vec, + pub outputs: Vec, #[doc = "Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal."] #[serde(default, skip_serializing_if = "Option::is_none")] pub priority: Option, @@ -3838,7 +3936,7 @@ pub struct JobProperties { pub end_time: Option, } impl JobProperties { - pub fn new(input: JobInput, outputs: Vec) -> Self { + pub fn new(input: JobInputUnion, outputs: Vec) -> Self { Self { created: None, state: None, @@ -5502,6 +5600,14 @@ impl Overlay { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum OverlayUnion { + #[serde(rename = "#Microsoft.Media.AudioOverlay")] + MicrosoftMediaAudioOverlay(AudioOverlay), + #[serde(rename = "#Microsoft.Media.VideoOverlay")] + MicrosoftMediaVideoOverlay(VideoOverlay), +} #[doc = "Describes the settings for producing PNG thumbnails."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PngFormat { @@ -5581,6 +5687,18 @@ impl Preset { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum PresetUnion { + #[serde(rename = "#Microsoft.Media.AudioAnalyzerPreset")] + MicrosoftMediaAudioAnalyzerPreset(AudioAnalyzerPreset), + #[serde(rename = "#Microsoft.Media.BuiltInStandardEncoderPreset")] + MicrosoftMediaBuiltInStandardEncoderPreset(BuiltInStandardEncoderPreset), + #[serde(rename = "#Microsoft.Media.FaceDetectorPreset")] + MicrosoftMediaFaceDetectorPreset(FaceDetectorPreset), + #[serde(rename = "#Microsoft.Media.StandardEncoderPreset")] + MicrosoftMediaStandardEncoderPreset(StandardEncoderPreset), +} #[doc = "An object of optional configuration settings for encoder."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PresetConfigurations { @@ -6276,12 +6394,12 @@ pub struct StandardEncoderPreset { #[serde(default, skip_serializing_if = "Option::is_none")] pub filters: Option, #[doc = "The list of codecs to be used when encoding the input video."] - pub codecs: Vec, + pub codecs: Vec, #[doc = "The list of outputs to be produced by the encoder."] - pub formats: Vec, + pub formats: Vec, } impl StandardEncoderPreset { - pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { + pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { Self { preset, filters: None, @@ -7141,6 +7259,16 @@ impl TrackBase { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackBaseUnion { + #[serde(rename = "#Microsoft.Media.AudioTrack")] + MicrosoftMediaAudioTrack(AudioTrack), + #[serde(rename = "#Microsoft.Media.TextTrack")] + MicrosoftMediaTextTrack(TextTrack), + #[serde(rename = "#Microsoft.Media.VideoTrack")] + MicrosoftMediaVideoTrack(VideoTrack), +} #[doc = "Base type for all TrackDescriptor types, which define the metadata and selection for tracks that should be processed by a Job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackDescriptor { @@ -7153,6 +7281,14 @@ impl TrackDescriptor { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackDescriptorUnion { + #[serde(rename = "#Microsoft.Media.AudioTrackDescriptor")] + MicrosoftMediaAudioTrackDescriptor(AudioTrackDescriptor), + #[serde(rename = "#Microsoft.Media.VideoTrackDescriptor")] + MicrosoftMediaVideoTrackDescriptor(VideoTrackDescriptor), +} #[doc = "Class to specify one track property condition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackPropertyCondition { @@ -7340,10 +7476,10 @@ pub struct TransformOutput { #[serde(rename = "relativePriority", default, skip_serializing_if = "Option::is_none")] pub relative_priority: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] - pub preset: Preset, + pub preset: PresetUnion, } impl TransformOutput { - pub fn new(preset: Preset) -> Self { + pub fn new(preset: PresetUnion) -> Self { Self { on_error: None, relative_priority: None, diff --git a/services/mgmt/mediaservices/src/package_metadata_2023_01/models.rs b/services/mgmt/mediaservices/src/package_metadata_2023_01/models.rs index 38e913a386..c782746d1f 100644 --- a/services/mgmt/mediaservices/src/package_metadata_2023_01/models.rs +++ b/services/mgmt/mediaservices/src/package_metadata_2023_01/models.rs @@ -641,7 +641,7 @@ impl AssetTrackOperationStatus { pub struct AssetTrackProperties { #[doc = "Base type for concrete track types. A derived type must be used to represent the Track."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub track: Option, + pub track: Option, #[doc = "Provisioning state of the asset track."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -1133,6 +1133,14 @@ impl ClipTime { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ClipTimeUnion { + #[serde(rename = "#Microsoft.Media.AbsoluteClipTime")] + MicrosoftMediaAbsoluteClipTime(AbsoluteClipTime), + #[serde(rename = "#Microsoft.Media.UtcClipTime")] + MicrosoftMediaUtcClipTime(UtcClipTime), +} #[doc = "Describes the basic properties of all codecs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Codec { @@ -1148,6 +1156,18 @@ impl Codec { Self { odata_type, label: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum CodecUnion { + #[serde(rename = "#Microsoft.Media.Audio")] + MicrosoftMediaAudio(Audio), + #[serde(rename = "#Microsoft.Media.CopyAudio")] + MicrosoftMediaCopyAudio(CopyAudio), + #[serde(rename = "#Microsoft.Media.CopyVideo")] + MicrosoftMediaCopyVideo(CopyVideo), + #[serde(rename = "#Microsoft.Media.Video")] + MicrosoftMediaVideo(Video), +} #[doc = "Class for CommonEncryptionCbcs encryption scheme"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommonEncryptionCbcs { @@ -1273,6 +1293,20 @@ impl ContentKeyPolicyConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyConfigurationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration")] + MicrosoftMediaContentKeyPolicyClearKeyConfiguration(ContentKeyPolicyClearKeyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration")] + MicrosoftMediaContentKeyPolicyFairPlayConfiguration(ContentKeyPolicyFairPlayConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration")] + MicrosoftMediaContentKeyPolicyPlayReadyConfiguration(ContentKeyPolicyPlayReadyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration")] + MicrosoftMediaContentKeyPolicyUnknownConfiguration(ContentKeyPolicyUnknownConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration")] + MicrosoftMediaContentKeyPolicyWidevineConfiguration(ContentKeyPolicyWidevineConfiguration), +} #[doc = "Specifies a configuration for FairPlay licenses."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyFairPlayConfiguration { @@ -1401,12 +1435,12 @@ pub struct ContentKeyPolicyOption { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Base class for Content Key Policy configuration. A derived class must be used to create a configuration."] - pub configuration: ContentKeyPolicyConfiguration, + pub configuration: ContentKeyPolicyConfigurationUnion, #[doc = "Base class for Content Key Policy restrictions. A derived class must be used to create a restriction."] - pub restriction: ContentKeyPolicyRestriction, + pub restriction: ContentKeyPolicyRestrictionUnion, } impl ContentKeyPolicyOption { - pub fn new(configuration: ContentKeyPolicyConfiguration, restriction: ContentKeyPolicyRestriction) -> Self { + pub fn new(configuration: ContentKeyPolicyConfigurationUnion, restriction: ContentKeyPolicyRestrictionUnion) -> Self { Self { policy_option_id: None, name: None, @@ -1477,6 +1511,16 @@ impl ContentKeyPolicyPlayReadyContentKeyLocation { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyPlayReadyContentKeyLocationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader(ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier( + ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, + ), +} #[doc = "Configures the Explicit Analog Television Output Restriction control bits. For further details see the PlayReady Compliance Rules."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { @@ -1527,7 +1571,7 @@ pub struct ContentKeyPolicyPlayReadyLicense { pub license_type: content_key_policy_play_ready_license::LicenseType, #[doc = "Base class for content key ID location. A derived class must be used to represent the location."] #[serde(rename = "contentKeyLocation")] - pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, #[doc = "The PlayReady content type."] #[serde(rename = "contentType")] pub content_type: content_key_policy_play_ready_license::ContentType, @@ -1536,7 +1580,7 @@ impl ContentKeyPolicyPlayReadyLicense { pub fn new( allow_test_devices: bool, license_type: content_key_policy_play_ready_license::LicenseType, - content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, content_type: content_key_policy_play_ready_license::ContentType, ) -> Self { Self { @@ -1839,6 +1883,16 @@ impl ContentKeyPolicyRestriction { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyOpenRestriction")] + MicrosoftMediaContentKeyPolicyOpenRestriction(ContentKeyPolicyOpenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyTokenRestriction")] + MicrosoftMediaContentKeyPolicyTokenRestriction(ContentKeyPolicyTokenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction")] + MicrosoftMediaContentKeyPolicyUnknownRestriction(ContentKeyPolicyUnknownRestriction), +} #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRestrictionTokenKey { @@ -1851,6 +1905,16 @@ impl ContentKeyPolicyRestrictionTokenKey { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionTokenKeyUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey")] + MicrosoftMediaContentKeyPolicyRsaTokenKey(ContentKeyPolicyRsaTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey")] + MicrosoftMediaContentKeyPolicySymmetricTokenKey(ContentKeyPolicySymmetricTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey")] + MicrosoftMediaContentKeyPolicyX509CertificateTokenKey(ContentKeyPolicyX509CertificateTokenKey), +} #[doc = "Specifies a RSA key for token validation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRsaTokenKey { @@ -1913,7 +1977,7 @@ pub struct ContentKeyPolicyTokenRestriction { pub audience: String, #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[serde(rename = "primaryVerificationKey")] - pub primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + pub primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, #[doc = "A list of alternative verification keys."] #[serde( rename = "alternateVerificationKeys", @@ -1921,7 +1985,7 @@ pub struct ContentKeyPolicyTokenRestriction { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub alternate_verification_keys: Vec, + pub alternate_verification_keys: Vec, #[doc = "A list of required token claims."] #[serde( rename = "requiredClaims", @@ -1942,7 +2006,7 @@ impl ContentKeyPolicyTokenRestriction { content_key_policy_restriction: ContentKeyPolicyRestriction, issuer: String, audience: String, - primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, restriction_token_type: content_key_policy_token_restriction::RestrictionTokenType, ) -> Self { Self { @@ -2728,7 +2792,7 @@ pub struct Filters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub overlays: Vec, + pub overlays: Vec, } impl Filters { pub fn new() -> Self { @@ -2812,6 +2876,14 @@ impl Format { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum FormatUnion { + #[serde(rename = "#Microsoft.Media.ImageFormat")] + MicrosoftMediaImageFormat(ImageFormat), + #[serde(rename = "#Microsoft.Media.MultiBitrateFormat")] + MicrosoftMediaMultiBitrateFormat(MultiBitrateFormat), +} #[doc = "An InputDefinition that looks across all of the files provided to select tracks specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute to allow selection of a single track across a set of input files."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FromAllInputFile { @@ -3367,7 +3439,7 @@ pub struct InputDefinition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub included_tracks: Vec, + pub included_tracks: Vec, } impl InputDefinition { pub fn new(odata_type: String) -> Self { @@ -3377,6 +3449,16 @@ impl InputDefinition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum InputDefinitionUnion { + #[serde(rename = "#Microsoft.Media.FromAllInputFile")] + MicrosoftMediaFromAllInputFile(FromAllInputFile), + #[serde(rename = "#Microsoft.Media.FromEachInputFile")] + MicrosoftMediaFromEachInputFile(FromEachInputFile), + #[serde(rename = "#Microsoft.Media.InputFile")] + MicrosoftMediaInputFile(InputFile), +} #[doc = "An InputDefinition for a single file. TrackSelections are scoped to the file specified."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InputFile { @@ -3629,6 +3711,16 @@ impl JobInput { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobInputUnion { + #[serde(rename = "#Microsoft.Media.JobInputClip")] + MicrosoftMediaJobInputClip(JobInputClip), + #[serde(rename = "#Microsoft.Media.JobInputSequence")] + MicrosoftMediaJobInputSequence(JobInputSequence), + #[serde(rename = "#Microsoft.Media.JobInputs")] + MicrosoftMediaJobInputs(JobInputs), +} #[doc = "Represents an Asset for input into a Job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobInputAsset { @@ -3660,10 +3752,10 @@ pub struct JobInputClip { pub files: Vec, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub start: Option, + pub start: Option, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option, + pub end: Option, #[doc = "A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'."] #[serde(default, skip_serializing_if = "Option::is_none")] pub label: Option, @@ -3674,7 +3766,7 @@ pub struct JobInputClip { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub input_definitions: Vec, + pub input_definitions: Vec, } impl JobInputClip { pub fn new(job_input: JobInput) -> Self { @@ -3737,7 +3829,7 @@ pub struct JobInputs { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inputs: Vec, + pub inputs: Vec, } impl JobInputs { pub fn new(job_input: JobInput) -> Self { @@ -3758,7 +3850,7 @@ pub struct JobOutput { pub error: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] #[serde(rename = "presetOverride", default, skip_serializing_if = "Option::is_none")] - pub preset_override: Option, + pub preset_override: Option, #[doc = "Describes the state of the JobOutput."] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, @@ -3839,6 +3931,12 @@ pub mod job_output { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobOutputUnion { + #[serde(rename = "#Microsoft.Media.JobOutputAsset")] + MicrosoftMediaJobOutputAsset(JobOutputAsset), +} #[doc = "Represents an Asset used as a JobOutput."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobOutputAsset { @@ -3866,12 +3964,12 @@ pub struct JobProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Base class for inputs to a Job."] - pub input: JobInput, + pub input: JobInputUnion, #[doc = "The UTC date and time when the customer has last updated the Job, in 'YYYY-MM-DDThh:mm:ssZ' format."] #[serde(rename = "lastModified", default, with = "azure_core::date::rfc3339::option")] pub last_modified: Option, #[doc = "The outputs for the Job."] - pub outputs: Vec, + pub outputs: Vec, #[doc = "Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal."] #[serde(default, skip_serializing_if = "Option::is_none")] pub priority: Option, @@ -3886,7 +3984,7 @@ pub struct JobProperties { pub end_time: Option, } impl JobProperties { - pub fn new(input: JobInput, outputs: Vec) -> Self { + pub fn new(input: JobInputUnion, outputs: Vec) -> Self { Self { created: None, state: None, @@ -6375,6 +6473,14 @@ impl Overlay { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum OverlayUnion { + #[serde(rename = "#Microsoft.Media.AudioOverlay")] + MicrosoftMediaAudioOverlay(AudioOverlay), + #[serde(rename = "#Microsoft.Media.VideoOverlay")] + MicrosoftMediaVideoOverlay(VideoOverlay), +} #[doc = "Describes the settings for producing PNG thumbnails."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PngFormat { @@ -6454,6 +6560,18 @@ impl Preset { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum PresetUnion { + #[serde(rename = "#Microsoft.Media.AudioAnalyzerPreset")] + MicrosoftMediaAudioAnalyzerPreset(AudioAnalyzerPreset), + #[serde(rename = "#Microsoft.Media.BuiltInStandardEncoderPreset")] + MicrosoftMediaBuiltInStandardEncoderPreset(BuiltInStandardEncoderPreset), + #[serde(rename = "#Microsoft.Media.FaceDetectorPreset")] + MicrosoftMediaFaceDetectorPreset(FaceDetectorPreset), + #[serde(rename = "#Microsoft.Media.StandardEncoderPreset")] + MicrosoftMediaStandardEncoderPreset(StandardEncoderPreset), +} #[doc = "An object of optional configuration settings for encoder."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PresetConfigurations { @@ -7152,12 +7270,12 @@ pub struct StandardEncoderPreset { #[serde(default, skip_serializing_if = "Option::is_none")] pub filters: Option, #[doc = "The list of codecs to be used when encoding the input video."] - pub codecs: Vec, + pub codecs: Vec, #[doc = "The list of outputs to be produced by the encoder."] - pub formats: Vec, + pub formats: Vec, } impl StandardEncoderPreset { - pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { + pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { Self { preset, experimental_options: None, @@ -8018,6 +8136,16 @@ impl TrackBase { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackBaseUnion { + #[serde(rename = "#Microsoft.Media.AudioTrack")] + MicrosoftMediaAudioTrack(AudioTrack), + #[serde(rename = "#Microsoft.Media.TextTrack")] + MicrosoftMediaTextTrack(TextTrack), + #[serde(rename = "#Microsoft.Media.VideoTrack")] + MicrosoftMediaVideoTrack(VideoTrack), +} #[doc = "Base type for all TrackDescriptor types, which define the metadata and selection for tracks that should be processed by a Job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackDescriptor { @@ -8030,6 +8158,14 @@ impl TrackDescriptor { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackDescriptorUnion { + #[serde(rename = "#Microsoft.Media.AudioTrackDescriptor")] + MicrosoftMediaAudioTrackDescriptor(AudioTrackDescriptor), + #[serde(rename = "#Microsoft.Media.VideoTrackDescriptor")] + MicrosoftMediaVideoTrackDescriptor(VideoTrackDescriptor), +} #[doc = "Class to specify one track property condition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackPropertyCondition { @@ -8217,10 +8353,10 @@ pub struct TransformOutput { #[serde(rename = "relativePriority", default, skip_serializing_if = "Option::is_none")] pub relative_priority: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] - pub preset: Preset, + pub preset: PresetUnion, } impl TransformOutput { - pub fn new(preset: Preset) -> Self { + pub fn new(preset: PresetUnion) -> Self { Self { on_error: None, relative_priority: None, diff --git a/services/mgmt/mediaservices/src/package_streaming_2022_11/models.rs b/services/mgmt/mediaservices/src/package_streaming_2022_11/models.rs index 36bd1aee31..68f8a05278 100644 --- a/services/mgmt/mediaservices/src/package_streaming_2022_11/models.rs +++ b/services/mgmt/mediaservices/src/package_streaming_2022_11/models.rs @@ -638,7 +638,7 @@ impl AssetTrackOperationStatus { pub struct AssetTrackProperties { #[doc = "Base type for concrete track types. A derived type must be used to represent the Track."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub track: Option, + pub track: Option, #[doc = "Provisioning state of the asset track."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -1130,6 +1130,14 @@ impl ClipTime { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ClipTimeUnion { + #[serde(rename = "#Microsoft.Media.AbsoluteClipTime")] + MicrosoftMediaAbsoluteClipTime(AbsoluteClipTime), + #[serde(rename = "#Microsoft.Media.UtcClipTime")] + MicrosoftMediaUtcClipTime(UtcClipTime), +} #[doc = "Describes the basic properties of all codecs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Codec { @@ -1145,6 +1153,18 @@ impl Codec { Self { odata_type, label: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum CodecUnion { + #[serde(rename = "#Microsoft.Media.Audio")] + MicrosoftMediaAudio(Audio), + #[serde(rename = "#Microsoft.Media.CopyAudio")] + MicrosoftMediaCopyAudio(CopyAudio), + #[serde(rename = "#Microsoft.Media.CopyVideo")] + MicrosoftMediaCopyVideo(CopyVideo), + #[serde(rename = "#Microsoft.Media.Video")] + MicrosoftMediaVideo(Video), +} #[doc = "Class for CommonEncryptionCbcs encryption scheme"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommonEncryptionCbcs { @@ -1270,6 +1290,20 @@ impl ContentKeyPolicyConfiguration { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyConfigurationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration")] + MicrosoftMediaContentKeyPolicyClearKeyConfiguration(ContentKeyPolicyClearKeyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration")] + MicrosoftMediaContentKeyPolicyFairPlayConfiguration(ContentKeyPolicyFairPlayConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration")] + MicrosoftMediaContentKeyPolicyPlayReadyConfiguration(ContentKeyPolicyPlayReadyConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration")] + MicrosoftMediaContentKeyPolicyUnknownConfiguration(ContentKeyPolicyUnknownConfiguration), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration")] + MicrosoftMediaContentKeyPolicyWidevineConfiguration(ContentKeyPolicyWidevineConfiguration), +} #[doc = "Specifies a configuration for FairPlay licenses."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyFairPlayConfiguration { @@ -1398,12 +1432,12 @@ pub struct ContentKeyPolicyOption { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Base class for Content Key Policy configuration. A derived class must be used to create a configuration."] - pub configuration: ContentKeyPolicyConfiguration, + pub configuration: ContentKeyPolicyConfigurationUnion, #[doc = "Base class for Content Key Policy restrictions. A derived class must be used to create a restriction."] - pub restriction: ContentKeyPolicyRestriction, + pub restriction: ContentKeyPolicyRestrictionUnion, } impl ContentKeyPolicyOption { - pub fn new(configuration: ContentKeyPolicyConfiguration, restriction: ContentKeyPolicyRestriction) -> Self { + pub fn new(configuration: ContentKeyPolicyConfigurationUnion, restriction: ContentKeyPolicyRestrictionUnion) -> Self { Self { policy_option_id: None, name: None, @@ -1474,6 +1508,16 @@ impl ContentKeyPolicyPlayReadyContentKeyLocation { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyPlayReadyContentKeyLocationUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader(ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier")] + MicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier( + ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, + ), +} #[doc = "Configures the Explicit Analog Television Output Restriction control bits. For further details see the PlayReady Compliance Rules."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { @@ -1524,7 +1568,7 @@ pub struct ContentKeyPolicyPlayReadyLicense { pub license_type: content_key_policy_play_ready_license::LicenseType, #[doc = "Base class for content key ID location. A derived class must be used to represent the location."] #[serde(rename = "contentKeyLocation")] - pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + pub content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, #[doc = "The PlayReady content type."] #[serde(rename = "contentType")] pub content_type: content_key_policy_play_ready_license::ContentType, @@ -1533,7 +1577,7 @@ impl ContentKeyPolicyPlayReadyLicense { pub fn new( allow_test_devices: bool, license_type: content_key_policy_play_ready_license::LicenseType, - content_key_location: ContentKeyPolicyPlayReadyContentKeyLocation, + content_key_location: ContentKeyPolicyPlayReadyContentKeyLocationUnion, content_type: content_key_policy_play_ready_license::ContentType, ) -> Self { Self { @@ -1836,6 +1880,16 @@ impl ContentKeyPolicyRestriction { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyOpenRestriction")] + MicrosoftMediaContentKeyPolicyOpenRestriction(ContentKeyPolicyOpenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyTokenRestriction")] + MicrosoftMediaContentKeyPolicyTokenRestriction(ContentKeyPolicyTokenRestriction), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction")] + MicrosoftMediaContentKeyPolicyUnknownRestriction(ContentKeyPolicyUnknownRestriction), +} #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRestrictionTokenKey { @@ -1848,6 +1902,16 @@ impl ContentKeyPolicyRestrictionTokenKey { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum ContentKeyPolicyRestrictionTokenKeyUnion { + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey")] + MicrosoftMediaContentKeyPolicyRsaTokenKey(ContentKeyPolicyRsaTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey")] + MicrosoftMediaContentKeyPolicySymmetricTokenKey(ContentKeyPolicySymmetricTokenKey), + #[serde(rename = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey")] + MicrosoftMediaContentKeyPolicyX509CertificateTokenKey(ContentKeyPolicyX509CertificateTokenKey), +} #[doc = "Specifies a RSA key for token validation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ContentKeyPolicyRsaTokenKey { @@ -1910,7 +1974,7 @@ pub struct ContentKeyPolicyTokenRestriction { pub audience: String, #[doc = "Base class for Content Key Policy key for token validation. A derived class must be used to create a token key."] #[serde(rename = "primaryVerificationKey")] - pub primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + pub primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, #[doc = "A list of alternative verification keys."] #[serde( rename = "alternateVerificationKeys", @@ -1918,7 +1982,7 @@ pub struct ContentKeyPolicyTokenRestriction { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub alternate_verification_keys: Vec, + pub alternate_verification_keys: Vec, #[doc = "A list of required token claims."] #[serde( rename = "requiredClaims", @@ -1939,7 +2003,7 @@ impl ContentKeyPolicyTokenRestriction { content_key_policy_restriction: ContentKeyPolicyRestriction, issuer: String, audience: String, - primary_verification_key: ContentKeyPolicyRestrictionTokenKey, + primary_verification_key: ContentKeyPolicyRestrictionTokenKeyUnion, restriction_token_type: content_key_policy_token_restriction::RestrictionTokenType, ) -> Self { Self { @@ -2725,7 +2789,7 @@ pub struct Filters { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub overlays: Vec, + pub overlays: Vec, } impl Filters { pub fn new() -> Self { @@ -2809,6 +2873,14 @@ impl Format { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum FormatUnion { + #[serde(rename = "#Microsoft.Media.ImageFormat")] + MicrosoftMediaImageFormat(ImageFormat), + #[serde(rename = "#Microsoft.Media.MultiBitrateFormat")] + MicrosoftMediaMultiBitrateFormat(MultiBitrateFormat), +} #[doc = "An InputDefinition that looks across all of the files provided to select tracks specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute to allow selection of a single track across a set of input files."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FromAllInputFile { @@ -3364,7 +3436,7 @@ pub struct InputDefinition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub included_tracks: Vec, + pub included_tracks: Vec, } impl InputDefinition { pub fn new(odata_type: String) -> Self { @@ -3374,6 +3446,16 @@ impl InputDefinition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum InputDefinitionUnion { + #[serde(rename = "#Microsoft.Media.FromAllInputFile")] + MicrosoftMediaFromAllInputFile(FromAllInputFile), + #[serde(rename = "#Microsoft.Media.FromEachInputFile")] + MicrosoftMediaFromEachInputFile(FromEachInputFile), + #[serde(rename = "#Microsoft.Media.InputFile")] + MicrosoftMediaInputFile(InputFile), +} #[doc = "An InputDefinition for a single file. TrackSelections are scoped to the file specified."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InputFile { @@ -3626,6 +3708,16 @@ impl JobInput { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobInputUnion { + #[serde(rename = "#Microsoft.Media.JobInputClip")] + MicrosoftMediaJobInputClip(JobInputClip), + #[serde(rename = "#Microsoft.Media.JobInputSequence")] + MicrosoftMediaJobInputSequence(JobInputSequence), + #[serde(rename = "#Microsoft.Media.JobInputs")] + MicrosoftMediaJobInputs(JobInputs), +} #[doc = "Represents an Asset for input into a Job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobInputAsset { @@ -3657,10 +3749,10 @@ pub struct JobInputClip { pub files: Vec, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub start: Option, + pub start: Option, #[doc = "Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option, + pub end: Option, #[doc = "A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'."] #[serde(default, skip_serializing_if = "Option::is_none")] pub label: Option, @@ -3671,7 +3763,7 @@ pub struct JobInputClip { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub input_definitions: Vec, + pub input_definitions: Vec, } impl JobInputClip { pub fn new(job_input: JobInput) -> Self { @@ -3734,7 +3826,7 @@ pub struct JobInputs { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inputs: Vec, + pub inputs: Vec, } impl JobInputs { pub fn new(job_input: JobInput) -> Self { @@ -3755,7 +3847,7 @@ pub struct JobOutput { pub error: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] #[serde(rename = "presetOverride", default, skip_serializing_if = "Option::is_none")] - pub preset_override: Option, + pub preset_override: Option, #[doc = "Describes the state of the JobOutput."] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, @@ -3836,6 +3928,12 @@ pub mod job_output { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum JobOutputUnion { + #[serde(rename = "#Microsoft.Media.JobOutputAsset")] + MicrosoftMediaJobOutputAsset(JobOutputAsset), +} #[doc = "Represents an Asset used as a JobOutput."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobOutputAsset { @@ -3863,12 +3961,12 @@ pub struct JobProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Base class for inputs to a Job."] - pub input: JobInput, + pub input: JobInputUnion, #[doc = "The UTC date and time when the customer has last updated the Job, in 'YYYY-MM-DDThh:mm:ssZ' format."] #[serde(rename = "lastModified", default, with = "azure_core::date::rfc3339::option")] pub last_modified: Option, #[doc = "The outputs for the Job."] - pub outputs: Vec, + pub outputs: Vec, #[doc = "Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal."] #[serde(default, skip_serializing_if = "Option::is_none")] pub priority: Option, @@ -3883,7 +3981,7 @@ pub struct JobProperties { pub end_time: Option, } impl JobProperties { - pub fn new(input: JobInput, outputs: Vec) -> Self { + pub fn new(input: JobInputUnion, outputs: Vec) -> Self { Self { created: None, state: None, @@ -6323,6 +6421,14 @@ impl Overlay { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum OverlayUnion { + #[serde(rename = "#Microsoft.Media.AudioOverlay")] + MicrosoftMediaAudioOverlay(AudioOverlay), + #[serde(rename = "#Microsoft.Media.VideoOverlay")] + MicrosoftMediaVideoOverlay(VideoOverlay), +} #[doc = "Describes the settings for producing PNG thumbnails."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PngFormat { @@ -6402,6 +6508,18 @@ impl Preset { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum PresetUnion { + #[serde(rename = "#Microsoft.Media.AudioAnalyzerPreset")] + MicrosoftMediaAudioAnalyzerPreset(AudioAnalyzerPreset), + #[serde(rename = "#Microsoft.Media.BuiltInStandardEncoderPreset")] + MicrosoftMediaBuiltInStandardEncoderPreset(BuiltInStandardEncoderPreset), + #[serde(rename = "#Microsoft.Media.FaceDetectorPreset")] + MicrosoftMediaFaceDetectorPreset(FaceDetectorPreset), + #[serde(rename = "#Microsoft.Media.StandardEncoderPreset")] + MicrosoftMediaStandardEncoderPreset(StandardEncoderPreset), +} #[doc = "An object of optional configuration settings for encoder."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PresetConfigurations { @@ -7100,12 +7218,12 @@ pub struct StandardEncoderPreset { #[serde(default, skip_serializing_if = "Option::is_none")] pub filters: Option, #[doc = "The list of codecs to be used when encoding the input video."] - pub codecs: Vec, + pub codecs: Vec, #[doc = "The list of outputs to be produced by the encoder."] - pub formats: Vec, + pub formats: Vec, } impl StandardEncoderPreset { - pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { + pub fn new(preset: Preset, codecs: Vec, formats: Vec) -> Self { Self { preset, experimental_options: None, @@ -7966,6 +8084,16 @@ impl TrackBase { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackBaseUnion { + #[serde(rename = "#Microsoft.Media.AudioTrack")] + MicrosoftMediaAudioTrack(AudioTrack), + #[serde(rename = "#Microsoft.Media.TextTrack")] + MicrosoftMediaTextTrack(TextTrack), + #[serde(rename = "#Microsoft.Media.VideoTrack")] + MicrosoftMediaVideoTrack(VideoTrack), +} #[doc = "Base type for all TrackDescriptor types, which define the metadata and selection for tracks that should be processed by a Job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackDescriptor { @@ -7978,6 +8106,14 @@ impl TrackDescriptor { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum TrackDescriptorUnion { + #[serde(rename = "#Microsoft.Media.AudioTrackDescriptor")] + MicrosoftMediaAudioTrackDescriptor(AudioTrackDescriptor), + #[serde(rename = "#Microsoft.Media.VideoTrackDescriptor")] + MicrosoftMediaVideoTrackDescriptor(VideoTrackDescriptor), +} #[doc = "Class to specify one track property condition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackPropertyCondition { @@ -8165,10 +8301,10 @@ pub struct TransformOutput { #[serde(rename = "relativePriority", default, skip_serializing_if = "Option::is_none")] pub relative_priority: Option, #[doc = "Base type for all Presets, which define the recipe or instructions on how the input media files should be processed."] - pub preset: Preset, + pub preset: PresetUnion, } impl TransformOutput { - pub fn new(preset: Preset) -> Self { + pub fn new(preset: PresetUnion) -> Self { Self { on_error: None, relative_priority: None, diff --git a/services/mgmt/migrateprojects/src/package_2018_09/models.rs b/services/mgmt/migrateprojects/src/package_2018_09/models.rs index 15237fad3c..5b70d2824c 100644 --- a/services/mgmt/migrateprojects/src/package_2018_09/models.rs +++ b/services/mgmt/migrateprojects/src/package_2018_09/models.rs @@ -1121,7 +1121,7 @@ pub struct MigrateEvent { pub type_: Option, #[doc = "Properties of the error resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl MigrateEvent { pub fn new() -> Self { @@ -1158,6 +1158,12 @@ impl MigrateEventProperties { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrateEventPropertiesUnion { + Databases(DatabaseMigrateEventProperties), + Servers(MachineMigrateEventProperties), +} #[doc = "Migrate Project REST Resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrateProject { @@ -1541,6 +1547,12 @@ pub mod project_summary { Failed, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProjectSummaryUnion { + Databases(DatabaseProjectSummary), + Servers(ServersProjectSummary), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RangeVariable { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -1841,7 +1853,7 @@ pub struct SolutionProperties { pub cleanup_state: Option, #[doc = "The solution summary class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub summary: Option, + pub summary: Option, #[doc = "Class representing the details of the solution."] #[serde(default, skip_serializing_if = "Option::is_none")] pub details: Option, @@ -1911,6 +1923,12 @@ impl SolutionSummary { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SolutionSummaryUnion { + Databases(DatabasesSolutionSummary), + Servers(ServersSolutionSummary), +} #[doc = "Collection of solutions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SolutionsCollection { diff --git a/services/mgmt/monitor/src/package_preview_2022_08/models.rs b/services/mgmt/monitor/src/package_preview_2022_08/models.rs index 7d319515ab..689805e91f 100644 --- a/services/mgmt/monitor/src/package_preview_2022_08/models.rs +++ b/services/mgmt/monitor/src/package_preview_2022_08/models.rs @@ -372,23 +372,23 @@ pub struct AlertRule { #[serde(rename = "isEnabled")] pub is_enabled: bool, #[doc = "The condition that results in the alert rule being activated."] - pub condition: RuleCondition, + pub condition: RuleConditionUnion, #[doc = "The action that is performed when the alert rule becomes active, and when an alert condition is resolved."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option, + pub action: Option, #[doc = "the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, #[doc = "Last time the rule was updated in ISO8601 format."] #[serde(rename = "lastUpdatedTime", default, with = "azure_core::date::rfc3339::option")] pub last_updated_time: Option, } impl AlertRule { - pub fn new(name: String, is_enabled: bool, condition: RuleCondition) -> Self { + pub fn new(name: String, is_enabled: bool, condition: RuleConditionUnion) -> Self { Self { name, description: None, @@ -3534,6 +3534,16 @@ pub mod metric_alert_criteria { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum MetricAlertCriteriaUnion { + #[serde(rename = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")] + MicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria(MetricAlertMultipleResourceMultipleMetricCriteria), + #[serde(rename = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria")] + MicrosoftAzureMonitorSingleResourceMultipleMetricCriteria(MetricAlertSingleResourceMultipleMetricCriteria), + #[serde(rename = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria")] + MicrosoftAzureMonitorWebtestLocationAvailabilityCriteria(WebtestLocationAvailabilityCriteria), +} #[doc = "Specifies the metric alert criteria for multiple resource that has multiple metric criteria."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MetricAlertMultipleResourceMultipleMetricCriteria { @@ -3546,7 +3556,7 @@ pub struct MetricAlertMultipleResourceMultipleMetricCriteria { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub all_of: Vec, + pub all_of: Vec, } impl MetricAlertMultipleResourceMultipleMetricCriteria { pub fn new(metric_alert_criteria: MetricAlertCriteria) -> Self { @@ -3581,7 +3591,7 @@ pub struct MetricAlertProperties { #[serde(rename = "targetResourceRegion", default, skip_serializing_if = "Option::is_none")] pub target_resource_region: Option, #[doc = "The rule criteria that defines the conditions of the alert rule."] - pub criteria: MetricAlertCriteria, + pub criteria: MetricAlertCriteriaUnion, #[doc = "the flag that indicates whether the alert should be auto resolved or not. The default is true."] #[serde(rename = "autoMitigate", default, skip_serializing_if = "Option::is_none")] pub auto_mitigate: Option, @@ -3606,7 +3616,7 @@ impl MetricAlertProperties { scopes: Vec, evaluation_frequency: String, window_size: String, - criteria: MetricAlertCriteria, + criteria: MetricAlertCriteriaUnion, ) -> Self { Self { description: None, @@ -3658,7 +3668,7 @@ pub struct MetricAlertPropertiesPatch { pub target_resource_region: Option, #[doc = "The rule criteria that defines the conditions of the alert rule."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub criteria: Option, + pub criteria: Option, #[doc = "the flag that indicates whether the alert should be auto resolved or not. The default is true."] #[serde(rename = "autoMitigate", default, skip_serializing_if = "Option::is_none")] pub auto_mitigate: Option, @@ -4498,6 +4508,12 @@ pub mod multi_metric_criteria { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "criterionType")] +pub enum MultiMetricCriteriaUnion { + DynamicThresholdCriterion(DynamicMetricCriteria), + StaticThresholdCriterion(MetricCriteria), +} #[doc = "Kind of namespace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "NamespaceClassification")] @@ -5299,6 +5315,14 @@ impl RuleAction { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum RuleActionUnion { + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleEmailAction")] + MicrosoftAzureManagementInsightsModelsRuleEmailAction(RuleEmailAction), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction")] + MicrosoftAzureManagementInsightsModelsRuleWebhookAction(RuleWebhookAction), +} #[doc = "The condition that results in the alert rule being activated."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuleCondition { @@ -5307,7 +5331,7 @@ pub struct RuleCondition { pub odata_type: String, #[doc = "The resource from which the rule collects its data."] #[serde(rename = "dataSource", default, skip_serializing_if = "Option::is_none")] - pub data_source: Option, + pub data_source: Option, } impl RuleCondition { pub fn new(odata_type: String) -> Self { @@ -5317,6 +5341,16 @@ impl RuleCondition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum RuleConditionUnion { + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition")] + MicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition(LocationThresholdRuleCondition), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition")] + MicrosoftAzureManagementInsightsModelsManagementEventRuleCondition(ManagementEventRuleCondition), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition")] + MicrosoftAzureManagementInsightsModelsThresholdRuleCondition(ThresholdRuleCondition), +} #[doc = "The resource from which the rule collects its data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuleDataSource { @@ -5347,6 +5381,14 @@ impl RuleDataSource { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum RuleDataSourceUnion { + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource")] + MicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource(RuleManagementEventDataSource), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource")] + MicrosoftAzureManagementInsightsModelsRuleMetricDataSource(RuleMetricDataSource), +} #[doc = "Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction in this case."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuleEmailAction { diff --git a/services/mgmt/monitor/src/package_preview_2023_03/models.rs b/services/mgmt/monitor/src/package_preview_2023_03/models.rs index 45e827181d..4bd0d1d44a 100644 --- a/services/mgmt/monitor/src/package_preview_2023_03/models.rs +++ b/services/mgmt/monitor/src/package_preview_2023_03/models.rs @@ -375,23 +375,23 @@ pub struct AlertRule { #[serde(rename = "isEnabled")] pub is_enabled: bool, #[doc = "The condition that results in the alert rule being activated."] - pub condition: RuleCondition, + pub condition: RuleConditionUnion, #[doc = "The action that is performed when the alert rule becomes active, and when an alert condition is resolved."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option, + pub action: Option, #[doc = "the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, #[doc = "Last time the rule was updated in ISO8601 format."] #[serde(rename = "lastUpdatedTime", default, with = "azure_core::date::rfc3339::option")] pub last_updated_time: Option, } impl AlertRule { - pub fn new(name: String, is_enabled: bool, condition: RuleCondition) -> Self { + pub fn new(name: String, is_enabled: bool, condition: RuleConditionUnion) -> Self { Self { name, description: None, @@ -3537,6 +3537,16 @@ pub mod metric_alert_criteria { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum MetricAlertCriteriaUnion { + #[serde(rename = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")] + MicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria(MetricAlertMultipleResourceMultipleMetricCriteria), + #[serde(rename = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria")] + MicrosoftAzureMonitorSingleResourceMultipleMetricCriteria(MetricAlertSingleResourceMultipleMetricCriteria), + #[serde(rename = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria")] + MicrosoftAzureMonitorWebtestLocationAvailabilityCriteria(WebtestLocationAvailabilityCriteria), +} #[doc = "Specifies the metric alert criteria for multiple resource that has multiple metric criteria."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MetricAlertMultipleResourceMultipleMetricCriteria { @@ -3549,7 +3559,7 @@ pub struct MetricAlertMultipleResourceMultipleMetricCriteria { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub all_of: Vec, + pub all_of: Vec, } impl MetricAlertMultipleResourceMultipleMetricCriteria { pub fn new(metric_alert_criteria: MetricAlertCriteria) -> Self { @@ -3584,7 +3594,7 @@ pub struct MetricAlertProperties { #[serde(rename = "targetResourceRegion", default, skip_serializing_if = "Option::is_none")] pub target_resource_region: Option, #[doc = "The rule criteria that defines the conditions of the alert rule."] - pub criteria: MetricAlertCriteria, + pub criteria: MetricAlertCriteriaUnion, #[doc = "the flag that indicates whether the alert should be auto resolved or not. The default is true."] #[serde(rename = "autoMitigate", default, skip_serializing_if = "Option::is_none")] pub auto_mitigate: Option, @@ -3609,7 +3619,7 @@ impl MetricAlertProperties { scopes: Vec, evaluation_frequency: String, window_size: String, - criteria: MetricAlertCriteria, + criteria: MetricAlertCriteriaUnion, ) -> Self { Self { description: None, @@ -3661,7 +3671,7 @@ pub struct MetricAlertPropertiesPatch { pub target_resource_region: Option, #[doc = "The rule criteria that defines the conditions of the alert rule."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub criteria: Option, + pub criteria: Option, #[doc = "the flag that indicates whether the alert should be auto resolved or not. The default is true."] #[serde(rename = "autoMitigate", default, skip_serializing_if = "Option::is_none")] pub auto_mitigate: Option, @@ -4501,6 +4511,12 @@ pub mod multi_metric_criteria { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "criterionType")] +pub enum MultiMetricCriteriaUnion { + DynamicThresholdCriterion(DynamicMetricCriteria), + StaticThresholdCriterion(MetricCriteria), +} #[doc = "Kind of namespace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "NamespaceClassification")] @@ -5302,6 +5318,14 @@ impl RuleAction { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum RuleActionUnion { + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleEmailAction")] + MicrosoftAzureManagementInsightsModelsRuleEmailAction(RuleEmailAction), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction")] + MicrosoftAzureManagementInsightsModelsRuleWebhookAction(RuleWebhookAction), +} #[doc = "The condition that results in the alert rule being activated."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuleCondition { @@ -5310,7 +5334,7 @@ pub struct RuleCondition { pub odata_type: String, #[doc = "The resource from which the rule collects its data."] #[serde(rename = "dataSource", default, skip_serializing_if = "Option::is_none")] - pub data_source: Option, + pub data_source: Option, } impl RuleCondition { pub fn new(odata_type: String) -> Self { @@ -5320,6 +5344,16 @@ impl RuleCondition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum RuleConditionUnion { + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition")] + MicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition(LocationThresholdRuleCondition), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition")] + MicrosoftAzureManagementInsightsModelsManagementEventRuleCondition(ManagementEventRuleCondition), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition")] + MicrosoftAzureManagementInsightsModelsThresholdRuleCondition(ThresholdRuleCondition), +} #[doc = "The resource from which the rule collects its data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuleDataSource { @@ -5350,6 +5384,14 @@ impl RuleDataSource { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum RuleDataSourceUnion { + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource")] + MicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource(RuleManagementEventDataSource), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource")] + MicrosoftAzureManagementInsightsModelsRuleMetricDataSource(RuleMetricDataSource), +} #[doc = "Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction in this case."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuleEmailAction { diff --git a/services/mgmt/monitor/src/package_preview_2023_04/models.rs b/services/mgmt/monitor/src/package_preview_2023_04/models.rs index 2d75998211..a1b730da5a 100644 --- a/services/mgmt/monitor/src/package_preview_2023_04/models.rs +++ b/services/mgmt/monitor/src/package_preview_2023_04/models.rs @@ -375,23 +375,23 @@ pub struct AlertRule { #[serde(rename = "isEnabled")] pub is_enabled: bool, #[doc = "The condition that results in the alert rule being activated."] - pub condition: RuleCondition, + pub condition: RuleConditionUnion, #[doc = "The action that is performed when the alert rule becomes active, and when an alert condition is resolved."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option, + pub action: Option, #[doc = "the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, #[doc = "Last time the rule was updated in ISO8601 format."] #[serde(rename = "lastUpdatedTime", default, with = "azure_core::date::rfc3339::option")] pub last_updated_time: Option, } impl AlertRule { - pub fn new(name: String, is_enabled: bool, condition: RuleCondition) -> Self { + pub fn new(name: String, is_enabled: bool, condition: RuleConditionUnion) -> Self { Self { name, description: None, @@ -3855,6 +3855,16 @@ pub mod metric_alert_criteria { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum MetricAlertCriteriaUnion { + #[serde(rename = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")] + MicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria(MetricAlertMultipleResourceMultipleMetricCriteria), + #[serde(rename = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria")] + MicrosoftAzureMonitorSingleResourceMultipleMetricCriteria(MetricAlertSingleResourceMultipleMetricCriteria), + #[serde(rename = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria")] + MicrosoftAzureMonitorWebtestLocationAvailabilityCriteria(WebtestLocationAvailabilityCriteria), +} #[doc = "Specifies the metric alert criteria for multiple resource that has multiple metric criteria."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MetricAlertMultipleResourceMultipleMetricCriteria { @@ -3867,7 +3877,7 @@ pub struct MetricAlertMultipleResourceMultipleMetricCriteria { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub all_of: Vec, + pub all_of: Vec, } impl MetricAlertMultipleResourceMultipleMetricCriteria { pub fn new(metric_alert_criteria: MetricAlertCriteria) -> Self { @@ -3902,7 +3912,7 @@ pub struct MetricAlertProperties { #[serde(rename = "targetResourceRegion", default, skip_serializing_if = "Option::is_none")] pub target_resource_region: Option, #[doc = "The rule criteria that defines the conditions of the alert rule."] - pub criteria: MetricAlertCriteria, + pub criteria: MetricAlertCriteriaUnion, #[doc = "the flag that indicates whether the alert should be auto resolved or not. The default is true."] #[serde(rename = "autoMitigate", default, skip_serializing_if = "Option::is_none")] pub auto_mitigate: Option, @@ -3927,7 +3937,7 @@ impl MetricAlertProperties { scopes: Vec, evaluation_frequency: String, window_size: String, - criteria: MetricAlertCriteria, + criteria: MetricAlertCriteriaUnion, ) -> Self { Self { description: None, @@ -3979,7 +3989,7 @@ pub struct MetricAlertPropertiesPatch { pub target_resource_region: Option, #[doc = "The rule criteria that defines the conditions of the alert rule."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub criteria: Option, + pub criteria: Option, #[doc = "the flag that indicates whether the alert should be auto resolved or not. The default is true."] #[serde(rename = "autoMitigate", default, skip_serializing_if = "Option::is_none")] pub auto_mitigate: Option, @@ -4849,6 +4859,12 @@ pub mod multi_metric_criteria { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "criterionType")] +pub enum MultiMetricCriteriaUnion { + DynamicThresholdCriterion(DynamicMetricCriteria), + StaticThresholdCriterion(MetricCriteria), +} #[doc = "Kind of namespace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "NamespaceClassification")] @@ -5705,6 +5721,14 @@ impl RuleAction { Self { odata_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum RuleActionUnion { + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleEmailAction")] + MicrosoftAzureManagementInsightsModelsRuleEmailAction(RuleEmailAction), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction")] + MicrosoftAzureManagementInsightsModelsRuleWebhookAction(RuleWebhookAction), +} #[doc = "The condition that results in the alert rule being activated."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuleCondition { @@ -5713,7 +5737,7 @@ pub struct RuleCondition { pub odata_type: String, #[doc = "The resource from which the rule collects its data."] #[serde(rename = "dataSource", default, skip_serializing_if = "Option::is_none")] - pub data_source: Option, + pub data_source: Option, } impl RuleCondition { pub fn new(odata_type: String) -> Self { @@ -5723,6 +5747,16 @@ impl RuleCondition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum RuleConditionUnion { + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition")] + MicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition(LocationThresholdRuleCondition), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition")] + MicrosoftAzureManagementInsightsModelsManagementEventRuleCondition(ManagementEventRuleCondition), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition")] + MicrosoftAzureManagementInsightsModelsThresholdRuleCondition(ThresholdRuleCondition), +} #[doc = "The resource from which the rule collects its data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuleDataSource { @@ -5753,6 +5787,14 @@ impl RuleDataSource { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "odata.type")] +pub enum RuleDataSourceUnion { + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource")] + MicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource(RuleManagementEventDataSource), + #[serde(rename = "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource")] + MicrosoftAzureManagementInsightsModelsRuleMetricDataSource(RuleMetricDataSource), +} #[doc = "Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction in this case."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuleEmailAction { diff --git a/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview/models.rs b/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview/models.rs index 190b0e1285..9f05c17566 100644 --- a/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview/models.rs +++ b/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview/models.rs @@ -132,10 +132,10 @@ pub struct BackupAndExportRequest { pub backup_request_base: BackupRequestBase, #[doc = "Details about the target where the backup content will be stored."] #[serde(rename = "targetDetails")] - pub target_details: BackupStoreDetails, + pub target_details: BackupStoreDetailsUnion, } impl BackupAndExportRequest { - pub fn new(backup_request_base: BackupRequestBase, target_details: BackupStoreDetails) -> Self { + pub fn new(backup_request_base: BackupRequestBase, target_details: BackupStoreDetailsUnion) -> Self { Self { backup_request_base, target_details, @@ -285,6 +285,9 @@ impl BackupStoreDetails { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupStoreDetailsUnion {} #[doc = "location capability"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CapabilitiesListResult { diff --git a/services/mgmt/mysql/src/package_flexibleserver_2023_06_01_preview/models.rs b/services/mgmt/mysql/src/package_flexibleserver_2023_06_01_preview/models.rs index 1c117b07c5..b8f369e166 100644 --- a/services/mgmt/mysql/src/package_flexibleserver_2023_06_01_preview/models.rs +++ b/services/mgmt/mysql/src/package_flexibleserver_2023_06_01_preview/models.rs @@ -129,10 +129,10 @@ pub struct BackupAndExportRequest { pub backup_request_base: BackupRequestBase, #[doc = "Details about the target where the backup content will be stored."] #[serde(rename = "targetDetails")] - pub target_details: BackupStoreDetails, + pub target_details: BackupStoreDetailsUnion, } impl BackupAndExportRequest { - pub fn new(backup_request_base: BackupRequestBase, target_details: BackupStoreDetails) -> Self { + pub fn new(backup_request_base: BackupRequestBase, target_details: BackupStoreDetailsUnion) -> Self { Self { backup_request_base, target_details, @@ -281,6 +281,9 @@ impl BackupStoreDetails { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupStoreDetailsUnion {} #[doc = "location capability"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CapabilitiesListResult { diff --git a/services/mgmt/network/src/package_2022_11/mod.rs b/services/mgmt/network/src/package_2022_11/mod.rs index cedf3134d1..d3ae5d42f6 100644 --- a/services/mgmt/network/src/package_2022_11/mod.rs +++ b/services/mgmt/network/src/package_2022_11/mod.rs @@ -80790,7 +80790,7 @@ pub mod admin_rules { configuration_name: impl Into, rule_collection_name: impl Into, rule_name: impl Into, - admin_rule: impl Into, + admin_rule: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -80982,9 +80982,9 @@ pub mod admin_rules { #[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::BaseAdminRule = serde_json::from_slice(&bytes)?; + let body: models::BaseAdminRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -81066,8 +81066,8 @@ pub mod admin_rules { } } 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`."] @@ -81087,9 +81087,9 @@ pub mod admin_rules { #[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::BaseAdminRule = serde_json::from_slice(&bytes)?; + let body: models::BaseAdminRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -81136,7 +81136,7 @@ pub mod admin_rules { pub(crate) configuration_name: String, pub(crate) rule_collection_name: String, pub(crate) rule_name: String, - pub(crate) admin_rule: models::BaseAdminRule, + pub(crate) admin_rule: models::BaseAdminRuleUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -81173,8 +81173,8 @@ pub mod admin_rules { } } 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`."] diff --git a/services/mgmt/network/src/package_2022_11/models.rs b/services/mgmt/network/src/package_2022_11/models.rs index b5e969790f..f8e7468226 100644 --- a/services/mgmt/network/src/package_2022_11/models.rs +++ b/services/mgmt/network/src/package_2022_11/models.rs @@ -209,6 +209,12 @@ pub mod active_base_security_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ActiveBaseSecurityAdminRuleUnion { + Default(ActiveDefaultSecurityAdminRule), + Custom(ActiveSecurityAdminRule), +} #[doc = "Effective Virtual Networks Parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActiveConfigurationParameter { @@ -307,7 +313,7 @@ pub struct ActiveSecurityAdminRulesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data."] #[serde(rename = "skipToken", default, skip_serializing_if = "Option::is_none")] pub skip_token: Option, @@ -549,7 +555,7 @@ pub struct AdminRuleListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URL to get the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -5813,6 +5819,12 @@ pub mod base_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum BaseAdminRuleUnion { + Custom(AdminRule), + Default(DefaultAdminRule), +} #[doc = "The session detail for a target."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BastionActiveSession { @@ -9805,6 +9817,12 @@ pub mod effective_base_security_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EffectiveBaseSecurityAdminRuleUnion { + Default(EffectiveDefaultSecurityAdminRule), + Custom(EffectiveSecurityAdminRule), +} #[doc = "The network manager effective connectivity configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EffectiveConnectivityConfiguration { @@ -12620,7 +12638,7 @@ pub struct FirewallPolicyFilterRuleCollection { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, } impl FirewallPolicyFilterRuleCollection { pub fn new(firewall_policy_rule_collection: FirewallPolicyRuleCollection) -> Self { @@ -12991,7 +13009,7 @@ pub struct FirewallPolicyNatRuleCollection { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, } impl FirewallPolicyNatRuleCollection { pub fn new(firewall_policy_rule_collection: FirewallPolicyRuleCollection) -> Self { @@ -13182,6 +13200,13 @@ pub mod firewall_policy_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum FirewallPolicyRuleUnion { + ApplicationRule(ApplicationRule), + NatRule(NatRule), + NetworkRule(NetworkRule), +} #[doc = "Properties of the application rule protocol."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FirewallPolicyRuleApplicationProtocol { @@ -13300,6 +13325,12 @@ pub mod firewall_policy_rule_collection { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleCollectionType")] +pub enum FirewallPolicyRuleCollectionUnion { + FirewallPolicyFilterRuleCollection(FirewallPolicyFilterRuleCollection), + FirewallPolicyNatRuleCollection(FirewallPolicyNatRuleCollection), +} #[doc = "Rule Collection Group resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FirewallPolicyRuleCollectionGroup { @@ -13361,7 +13392,7 @@ pub struct FirewallPolicyRuleCollectionGroupProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rule_collections: Vec, + pub rule_collections: Vec, #[doc = "The current provisioning state."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -18627,7 +18658,7 @@ pub struct NetworkManagerEffectiveSecurityAdminRulesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data."] #[serde(rename = "skipToken", default, skip_serializing_if = "Option::is_none")] pub skip_token: Option, diff --git a/services/mgmt/network/src/package_2023_02/mod.rs b/services/mgmt/network/src/package_2023_02/mod.rs index 0c6f90fe34..0a4a49b6bc 100644 --- a/services/mgmt/network/src/package_2023_02/mod.rs +++ b/services/mgmt/network/src/package_2023_02/mod.rs @@ -80790,7 +80790,7 @@ pub mod admin_rules { configuration_name: impl Into, rule_collection_name: impl Into, rule_name: impl Into, - admin_rule: impl Into, + admin_rule: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -80982,9 +80982,9 @@ pub mod admin_rules { #[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::BaseAdminRule = serde_json::from_slice(&bytes)?; + let body: models::BaseAdminRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -81066,8 +81066,8 @@ pub mod admin_rules { } } 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`."] @@ -81087,9 +81087,9 @@ pub mod admin_rules { #[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::BaseAdminRule = serde_json::from_slice(&bytes)?; + let body: models::BaseAdminRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -81136,7 +81136,7 @@ pub mod admin_rules { pub(crate) configuration_name: String, pub(crate) rule_collection_name: String, pub(crate) rule_name: String, - pub(crate) admin_rule: models::BaseAdminRule, + pub(crate) admin_rule: models::BaseAdminRuleUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -81173,8 +81173,8 @@ pub mod admin_rules { } } 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`."] diff --git a/services/mgmt/network/src/package_2023_02/models.rs b/services/mgmt/network/src/package_2023_02/models.rs index a2f38e453d..2e3f47a345 100644 --- a/services/mgmt/network/src/package_2023_02/models.rs +++ b/services/mgmt/network/src/package_2023_02/models.rs @@ -209,6 +209,12 @@ pub mod active_base_security_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ActiveBaseSecurityAdminRuleUnion { + Default(ActiveDefaultSecurityAdminRule), + Custom(ActiveSecurityAdminRule), +} #[doc = "Effective Virtual Networks Parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActiveConfigurationParameter { @@ -307,7 +313,7 @@ pub struct ActiveSecurityAdminRulesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data."] #[serde(rename = "skipToken", default, skip_serializing_if = "Option::is_none")] pub skip_token: Option, @@ -557,7 +563,7 @@ pub struct AdminRuleListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URL to get the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -5822,6 +5828,12 @@ pub mod base_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum BaseAdminRuleUnion { + Custom(AdminRule), + Default(DefaultAdminRule), +} #[doc = "The session detail for a target."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BastionActiveSession { @@ -9821,6 +9833,12 @@ pub mod effective_base_security_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EffectiveBaseSecurityAdminRuleUnion { + Default(EffectiveDefaultSecurityAdminRule), + Custom(EffectiveSecurityAdminRule), +} #[doc = "The network manager effective connectivity configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EffectiveConnectivityConfiguration { @@ -12636,7 +12654,7 @@ pub struct FirewallPolicyFilterRuleCollection { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, } impl FirewallPolicyFilterRuleCollection { pub fn new(firewall_policy_rule_collection: FirewallPolicyRuleCollection) -> Self { @@ -13007,7 +13025,7 @@ pub struct FirewallPolicyNatRuleCollection { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, } impl FirewallPolicyNatRuleCollection { pub fn new(firewall_policy_rule_collection: FirewallPolicyRuleCollection) -> Self { @@ -13198,6 +13216,13 @@ pub mod firewall_policy_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum FirewallPolicyRuleUnion { + ApplicationRule(ApplicationRule), + NatRule(NatRule), + NetworkRule(NetworkRule), +} #[doc = "Properties of the application rule protocol."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FirewallPolicyRuleApplicationProtocol { @@ -13316,6 +13341,12 @@ pub mod firewall_policy_rule_collection { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleCollectionType")] +pub enum FirewallPolicyRuleCollectionUnion { + FirewallPolicyFilterRuleCollection(FirewallPolicyFilterRuleCollection), + FirewallPolicyNatRuleCollection(FirewallPolicyNatRuleCollection), +} #[doc = "Rule Collection Group resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FirewallPolicyRuleCollectionGroup { @@ -13377,7 +13408,7 @@ pub struct FirewallPolicyRuleCollectionGroupProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rule_collections: Vec, + pub rule_collections: Vec, #[doc = "The current provisioning state."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -18646,7 +18677,7 @@ pub struct NetworkManagerEffectiveSecurityAdminRulesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data."] #[serde(rename = "skipToken", default, skip_serializing_if = "Option::is_none")] pub skip_token: Option, diff --git a/services/mgmt/network/src/package_2023_04/mod.rs b/services/mgmt/network/src/package_2023_04/mod.rs index aad21db03a..46a022b466 100644 --- a/services/mgmt/network/src/package_2023_04/mod.rs +++ b/services/mgmt/network/src/package_2023_04/mod.rs @@ -80929,7 +80929,7 @@ pub mod admin_rules { configuration_name: impl Into, rule_collection_name: impl Into, rule_name: impl Into, - admin_rule: impl Into, + admin_rule: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -81121,9 +81121,9 @@ pub mod admin_rules { #[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::BaseAdminRule = serde_json::from_slice(&bytes)?; + let body: models::BaseAdminRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -81205,8 +81205,8 @@ pub mod admin_rules { } } 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`."] @@ -81226,9 +81226,9 @@ pub mod admin_rules { #[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::BaseAdminRule = serde_json::from_slice(&bytes)?; + let body: models::BaseAdminRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -81275,7 +81275,7 @@ pub mod admin_rules { pub(crate) configuration_name: String, pub(crate) rule_collection_name: String, pub(crate) rule_name: String, - pub(crate) admin_rule: models::BaseAdminRule, + pub(crate) admin_rule: models::BaseAdminRuleUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -81312,8 +81312,8 @@ pub mod admin_rules { } } 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`."] diff --git a/services/mgmt/network/src/package_2023_04/models.rs b/services/mgmt/network/src/package_2023_04/models.rs index 1999af2165..bf9c2053e5 100644 --- a/services/mgmt/network/src/package_2023_04/models.rs +++ b/services/mgmt/network/src/package_2023_04/models.rs @@ -209,6 +209,12 @@ pub mod active_base_security_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ActiveBaseSecurityAdminRuleUnion { + Default(ActiveDefaultSecurityAdminRule), + Custom(ActiveSecurityAdminRule), +} #[doc = "Effective Virtual Networks Parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActiveConfigurationParameter { @@ -307,7 +313,7 @@ pub struct ActiveSecurityAdminRulesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data."] #[serde(rename = "skipToken", default, skip_serializing_if = "Option::is_none")] pub skip_token: Option, @@ -557,7 +563,7 @@ pub struct AdminRuleListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URL to get the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -5869,6 +5875,12 @@ pub mod base_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum BaseAdminRuleUnion { + Custom(AdminRule), + Default(DefaultAdminRule), +} #[doc = "The session detail for a target."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BastionActiveSession { @@ -9868,6 +9880,12 @@ pub mod effective_base_security_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EffectiveBaseSecurityAdminRuleUnion { + Default(EffectiveDefaultSecurityAdminRule), + Custom(EffectiveSecurityAdminRule), +} #[doc = "The network manager effective connectivity configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EffectiveConnectivityConfiguration { @@ -12683,7 +12701,7 @@ pub struct FirewallPolicyFilterRuleCollection { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, } impl FirewallPolicyFilterRuleCollection { pub fn new(firewall_policy_rule_collection: FirewallPolicyRuleCollection) -> Self { @@ -13054,7 +13072,7 @@ pub struct FirewallPolicyNatRuleCollection { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, } impl FirewallPolicyNatRuleCollection { pub fn new(firewall_policy_rule_collection: FirewallPolicyRuleCollection) -> Self { @@ -13245,6 +13263,13 @@ pub mod firewall_policy_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum FirewallPolicyRuleUnion { + ApplicationRule(ApplicationRule), + NatRule(NatRule), + NetworkRule(NetworkRule), +} #[doc = "Properties of the application rule protocol."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FirewallPolicyRuleApplicationProtocol { @@ -13363,6 +13388,12 @@ pub mod firewall_policy_rule_collection { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleCollectionType")] +pub enum FirewallPolicyRuleCollectionUnion { + FirewallPolicyFilterRuleCollection(FirewallPolicyFilterRuleCollection), + FirewallPolicyNatRuleCollection(FirewallPolicyNatRuleCollection), +} #[doc = "Rule Collection Group resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FirewallPolicyRuleCollectionGroup { @@ -13424,7 +13455,7 @@ pub struct FirewallPolicyRuleCollectionGroupProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rule_collections: Vec, + pub rule_collections: Vec, #[doc = "The current provisioning state."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -18726,7 +18757,7 @@ pub struct NetworkManagerEffectiveSecurityAdminRulesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data."] #[serde(rename = "skipToken", default, skip_serializing_if = "Option::is_none")] pub skip_token: Option, diff --git a/services/mgmt/network/src/package_2023_05/mod.rs b/services/mgmt/network/src/package_2023_05/mod.rs index b666910a99..37af437054 100644 --- a/services/mgmt/network/src/package_2023_05/mod.rs +++ b/services/mgmt/network/src/package_2023_05/mod.rs @@ -80929,7 +80929,7 @@ pub mod admin_rules { configuration_name: impl Into, rule_collection_name: impl Into, rule_name: impl Into, - admin_rule: impl Into, + admin_rule: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -81121,9 +81121,9 @@ pub mod admin_rules { #[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::BaseAdminRule = serde_json::from_slice(&bytes)?; + let body: models::BaseAdminRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -81205,8 +81205,8 @@ pub mod admin_rules { } } 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`."] @@ -81226,9 +81226,9 @@ pub mod admin_rules { #[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::BaseAdminRule = serde_json::from_slice(&bytes)?; + let body: models::BaseAdminRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -81275,7 +81275,7 @@ pub mod admin_rules { pub(crate) configuration_name: String, pub(crate) rule_collection_name: String, pub(crate) rule_name: String, - pub(crate) admin_rule: models::BaseAdminRule, + pub(crate) admin_rule: models::BaseAdminRuleUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -81312,8 +81312,8 @@ pub mod admin_rules { } } 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`."] diff --git a/services/mgmt/network/src/package_2023_05/models.rs b/services/mgmt/network/src/package_2023_05/models.rs index e3e8a54413..980c3a146c 100644 --- a/services/mgmt/network/src/package_2023_05/models.rs +++ b/services/mgmt/network/src/package_2023_05/models.rs @@ -209,6 +209,12 @@ pub mod active_base_security_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ActiveBaseSecurityAdminRuleUnion { + Default(ActiveDefaultSecurityAdminRule), + Custom(ActiveSecurityAdminRule), +} #[doc = "Effective Virtual Networks Parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActiveConfigurationParameter { @@ -307,7 +313,7 @@ pub struct ActiveSecurityAdminRulesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data."] #[serde(rename = "skipToken", default, skip_serializing_if = "Option::is_none")] pub skip_token: Option, @@ -557,7 +563,7 @@ pub struct AdminRuleListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URL to get the next set of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -5869,6 +5875,12 @@ pub mod base_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum BaseAdminRuleUnion { + Custom(AdminRule), + Default(DefaultAdminRule), +} #[doc = "The session detail for a target."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BastionActiveSession { @@ -9892,6 +9904,12 @@ pub mod effective_base_security_admin_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EffectiveBaseSecurityAdminRuleUnion { + Default(EffectiveDefaultSecurityAdminRule), + Custom(EffectiveSecurityAdminRule), +} #[doc = "The network manager effective connectivity configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EffectiveConnectivityConfiguration { @@ -12707,7 +12725,7 @@ pub struct FirewallPolicyFilterRuleCollection { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, } impl FirewallPolicyFilterRuleCollection { pub fn new(firewall_policy_rule_collection: FirewallPolicyRuleCollection) -> Self { @@ -13078,7 +13096,7 @@ pub struct FirewallPolicyNatRuleCollection { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rules: Vec, + pub rules: Vec, } impl FirewallPolicyNatRuleCollection { pub fn new(firewall_policy_rule_collection: FirewallPolicyRuleCollection) -> Self { @@ -13272,6 +13290,13 @@ pub mod firewall_policy_rule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum FirewallPolicyRuleUnion { + ApplicationRule(ApplicationRule), + NatRule(NatRule), + NetworkRule(NetworkRule), +} #[doc = "Properties of the application rule protocol."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FirewallPolicyRuleApplicationProtocol { @@ -13390,6 +13415,12 @@ pub mod firewall_policy_rule_collection { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleCollectionType")] +pub enum FirewallPolicyRuleCollectionUnion { + FirewallPolicyFilterRuleCollection(FirewallPolicyFilterRuleCollection), + FirewallPolicyNatRuleCollection(FirewallPolicyNatRuleCollection), +} #[doc = "Rule Collection Group resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FirewallPolicyRuleCollectionGroup { @@ -13454,7 +13485,7 @@ pub struct FirewallPolicyRuleCollectionGroupProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub rule_collections: Vec, + pub rule_collections: Vec, #[doc = "The current provisioning state."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -18767,7 +18798,7 @@ pub struct NetworkManagerEffectiveSecurityAdminRulesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data."] #[serde(rename = "skipToken", default, skip_serializing_if = "Option::is_none")] pub skip_token: Option, diff --git a/services/mgmt/portal/src/package_2020_09_01_preview/models.rs b/services/mgmt/portal/src/package_2020_09_01_preview/models.rs index 14c99fa0ca..e91ebf220d 100644 --- a/services/mgmt/portal/src/package_2020_09_01_preview/models.rs +++ b/services/mgmt/portal/src/package_2020_09_01_preview/models.rs @@ -144,6 +144,12 @@ impl DashboardPartMetadata { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DashboardPartMetadataUnion { + #[serde(rename = "Extension/HubsExtension/PartType/MarkdownPart")] + ExtensionHubsExtensionPartTypeMarkdownPart(MarkdownPartMetadata), +} #[doc = "A dashboard part."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DashboardParts { @@ -151,7 +157,7 @@ pub struct DashboardParts { pub position: dashboard_parts::Position, #[doc = "A dashboard part metadata."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub metadata: Option, + pub metadata: Option, } impl DashboardParts { pub fn new(position: dashboard_parts::Position) -> Self { diff --git a/services/mgmt/quota/src/package_2021_03_15_preview/models.rs b/services/mgmt/quota/src/package_2021_03_15_preview/models.rs index 605c830729..49eeb5a37f 100644 --- a/services/mgmt/quota/src/package_2021_03_15_preview/models.rs +++ b/services/mgmt/quota/src/package_2021_03_15_preview/models.rs @@ -109,6 +109,11 @@ impl LimitJsonObject { Self { limit_object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "limitObjectType")] +pub enum LimitJsonObjectUnion { + LimitValue(LimitObject), +} #[doc = "The resource quota limit value."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitObject { @@ -307,7 +312,7 @@ impl QuotaLimitsResponse { pub struct QuotaProperties { #[doc = "LimitJson abstract class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, + pub limit: Option, #[doc = " The quota units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET response in the request body of your PUT operation."] #[serde(default, skip_serializing_if = "Option::is_none")] pub unit: Option, @@ -621,7 +626,7 @@ pub struct SubRequest { pub sub_request_id: Option, #[doc = "LimitJson abstract class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, + pub limit: Option, } impl SubRequest { pub fn new() -> Self { diff --git a/services/mgmt/quota/src/package_2023_02_01/models.rs b/services/mgmt/quota/src/package_2023_02_01/models.rs index 66c4599a62..34eef46c7f 100644 --- a/services/mgmt/quota/src/package_2023_02_01/models.rs +++ b/services/mgmt/quota/src/package_2023_02_01/models.rs @@ -109,6 +109,11 @@ impl LimitJsonObject { Self { limit_object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "limitObjectType")] +pub enum LimitJsonObjectUnion { + LimitValue(LimitObject), +} #[doc = "The resource quota limit value."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitObject { @@ -307,7 +312,7 @@ impl QuotaLimitsResponse { pub struct QuotaProperties { #[doc = "LimitJson abstract class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, + pub limit: Option, #[doc = " The quota units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET response in the request body of your PUT operation."] #[serde(default, skip_serializing_if = "Option::is_none")] pub unit: Option, @@ -621,7 +626,7 @@ pub struct SubRequest { pub sub_request_id: Option, #[doc = "LimitJson abstract class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, + pub limit: Option, } impl SubRequest { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservices/src/package_2023_04/models.rs b/services/mgmt/recoveryservices/src/package_2023_04/models.rs index 1488ab966d..6fce04c6fd 100644 --- a/services/mgmt/recoveryservices/src/package_2023_04/models.rs +++ b/services/mgmt/recoveryservices/src/package_2023_04/models.rs @@ -1358,6 +1358,12 @@ impl ResourceCertificateDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum ResourceCertificateDetailsUnion { + AzureActiveDirectory(ResourceCertificateAndAadDetails), + AccessControlService(ResourceCertificateAndAcsDetails), +} #[doc = "Restore Settings of the vault"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestoreSettings { @@ -1711,7 +1717,7 @@ pub struct VaultCertificateResponse { pub id: Option, #[doc = "Certificate details representing the Vault credentials."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl VaultCertificateResponse { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservices/src/package_2023_06/models.rs b/services/mgmt/recoveryservices/src/package_2023_06/models.rs index 1488ab966d..6fce04c6fd 100644 --- a/services/mgmt/recoveryservices/src/package_2023_06/models.rs +++ b/services/mgmt/recoveryservices/src/package_2023_06/models.rs @@ -1358,6 +1358,12 @@ impl ResourceCertificateDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum ResourceCertificateDetailsUnion { + AzureActiveDirectory(ResourceCertificateAndAadDetails), + AccessControlService(ResourceCertificateAndAcsDetails), +} #[doc = "Restore Settings of the vault"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestoreSettings { @@ -1711,7 +1717,7 @@ pub struct VaultCertificateResponse { pub id: Option, #[doc = "Certificate details representing the Vault credentials."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl VaultCertificateResponse { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservices/src/package_preview_2021_11/models.rs b/services/mgmt/recoveryservices/src/package_preview_2021_11/models.rs index 6c0f7a781e..5e93ea0a6e 100644 --- a/services/mgmt/recoveryservices/src/package_preview_2021_11/models.rs +++ b/services/mgmt/recoveryservices/src/package_preview_2021_11/models.rs @@ -934,6 +934,12 @@ impl ResourceCertificateDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum ResourceCertificateDetailsUnion { + AzureActiveDirectory(ResourceCertificateAndAadDetails), + AccessControlService(ResourceCertificateAndAcsDetails), +} #[doc = "Identifies the unique system identifier for each Azure resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Sku { @@ -1199,7 +1205,7 @@ pub struct VaultCertificateResponse { pub id: Option, #[doc = "Certificate details representing the Vault credentials."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl VaultCertificateResponse { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservices/src/package_preview_2022_01/models.rs b/services/mgmt/recoveryservices/src/package_preview_2022_01/models.rs index a62be11bf8..fbf9351612 100644 --- a/services/mgmt/recoveryservices/src/package_preview_2022_01/models.rs +++ b/services/mgmt/recoveryservices/src/package_preview_2022_01/models.rs @@ -1083,6 +1083,12 @@ impl ResourceCertificateDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum ResourceCertificateDetailsUnion { + AzureActiveDirectory(ResourceCertificateAndAadDetails), + AccessControlService(ResourceCertificateAndAcsDetails), +} #[doc = "Identifies the unique system identifier for each Azure resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Sku { @@ -1348,7 +1354,7 @@ pub struct VaultCertificateResponse { pub id: Option, #[doc = "Certificate details representing the Vault credentials."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl VaultCertificateResponse { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservices/src/package_preview_2022_09/models.rs b/services/mgmt/recoveryservices/src/package_preview_2022_09/models.rs index c542554ec2..c73930a5df 100644 --- a/services/mgmt/recoveryservices/src/package_preview_2022_09/models.rs +++ b/services/mgmt/recoveryservices/src/package_preview_2022_09/models.rs @@ -1265,6 +1265,12 @@ impl ResourceCertificateDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum ResourceCertificateDetailsUnion { + AzureActiveDirectory(ResourceCertificateAndAadDetails), + AccessControlService(ResourceCertificateAndAcsDetails), +} #[doc = "Security Settings of the vault"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecuritySettings { @@ -1542,7 +1548,7 @@ pub struct VaultCertificateResponse { pub id: Option, #[doc = "Certificate details representing the Vault credentials."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl VaultCertificateResponse { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservicesbackup/src/package_2023_01/mod.rs b/services/mgmt/recoveryservicesbackup/src/package_2023_01/mod.rs index 3d4d775fdb..58d16f0e45 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_2023_01/mod.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_2023_01/mod.rs @@ -1284,7 +1284,7 @@ pub mod feature_support { &self, azure_region: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> validate::RequestBuilder { validate::RequestBuilder { client: self.0.clone(), @@ -1348,7 +1348,7 @@ pub mod feature_support { pub(crate) client: super::super::Client, pub(crate) azure_region: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::FeatureSupportRequest, + pub(crate) parameters: models::FeatureSupportRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3560,9 +3560,9 @@ pub mod bms_prepare_data_move_operation_result { #[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::VaultStorageConfigOperationResultResponse = serde_json::from_slice(&bytes)?; + let body: models::VaultStorageConfigOperationResultResponseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3642,8 +3642,8 @@ pub mod bms_prepare_data_move_operation_result { } } 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`."] @@ -6381,7 +6381,7 @@ pub mod operation { vault_name: impl Into, resource_group_name: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> validate::RequestBuilder { validate::RequestBuilder { client: self.0.clone(), @@ -6447,7 +6447,7 @@ pub mod operation { pub(crate) vault_name: String, pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::ValidateOperationRequest, + pub(crate) parameters: models::ValidateOperationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6523,7 +6523,7 @@ pub mod validate_operation { vault_name: impl Into, resource_group_name: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> trigger::RequestBuilder { trigger::RequestBuilder { client: self.0.clone(), @@ -6583,7 +6583,7 @@ pub mod validate_operation { pub(crate) vault_name: String, pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::ValidateOperationRequest, + pub(crate) parameters: models::ValidateOperationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/recoveryservicesbackup/src/package_2023_01/models.rs b/services/mgmt/recoveryservicesbackup/src/package_2023_01/models.rs index f64a2a92ab..c3f1048f2d 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_2023_01/models.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_2023_01/models.rs @@ -131,10 +131,10 @@ pub struct AzureFileShareProtectionPolicy { pub work_load_type: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "TimeZone optional input as string. For example: TimeZone = \"Pacific Standard Time\"."] #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] pub time_zone: Option, @@ -1028,10 +1028,10 @@ pub struct AzureIaaSvmProtectionPolicy { pub instant_rp_details: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "Tiering policy to automatically move RPs to another tier\r\nKey is Target Tier, defined in RecoveryPointTierType enum.\r\nTiering policy specifies the criteria to move RP to the target tier."] #[serde(rename = "tieringPolicy", default, skip_serializing_if = "Option::is_none")] pub tiering_policy: Option, @@ -1250,7 +1250,7 @@ pub struct AzureSqlProtectionPolicy { pub protection_policy: ProtectionPolicy, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl AzureSqlProtectionPolicy { pub fn new(protection_policy: ProtectionPolicy) -> Self { @@ -4320,6 +4320,12 @@ pub mod backup_engine_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "backupEngineType")] +pub enum BackupEngineBaseUnion { + AzureBackupServerEngine(AzureBackupServerEngine), + DpmBackupEngine(DpmBackupEngine), +} #[doc = "The base backup engine class. All workload specific backup engines derive from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupEngineBaseResource { @@ -4327,7 +4333,7 @@ pub struct BackupEngineBaseResource { pub resource: Resource, #[doc = "The base backup engine class. All workload specific backup engines derive from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BackupEngineBaseResource { pub fn new() -> Self { @@ -4500,6 +4506,14 @@ impl BackupRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupRequestUnion { + AzureFileShareBackupRequest(AzureFileShareBackupRequest), + AzureWorkloadBackupRequest(AzureWorkloadBackupRequest), + #[serde(rename = "IaasVMBackupRequest")] + IaasVmBackupRequest(IaasVmBackupRequest), +} #[doc = "Base class for backup request. Workload-specific backup requests are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupRequestResource { @@ -4507,7 +4521,7 @@ pub struct BackupRequestResource { pub resource: Resource, #[doc = "Base class for backup request. Workload-specific backup requests are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BackupRequestResource { pub fn new() -> Self { @@ -6190,6 +6204,13 @@ impl FeatureSupportRequest { Self { feature_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "featureType")] +pub enum FeatureSupportRequestUnion { + AzureBackupGoals(AzureBackupGoalFeatureSupportRequest), + #[serde(rename = "AzureVMResourceBackup")] + AzureVmResourceBackup(AzureVmResourceFeatureSupportRequest), +} #[doc = "Base class for generic container of backup items"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GenericContainer { @@ -6421,6 +6442,14 @@ impl IlrRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum IlrRequestUnion { + #[serde(rename = "AzureFileShareProvisionILRRequest")] + AzureFileShareProvisionIlrRequest(AzureFileShareProvisionIlrRequest), + #[serde(rename = "IaasVMILRRegistrationRequest")] + IaasVmilrRegistrationRequest(IaasVmilrRegistrationRequest), +} #[doc = "Parameters to Provision ILR API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IlrRequestResource { @@ -6428,7 +6457,7 @@ pub struct IlrRequestResource { pub resource: Resource, #[doc = "Parameters to Provision ILR API."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl IlrRequestResource { pub fn new() -> Self { @@ -6981,6 +7010,19 @@ pub mod job { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobType")] +pub enum JobUnion { + #[serde(rename = "AzureIaaSVMJob")] + AzureIaaSvmJob(AzureIaaSvmJob), + #[serde(rename = "AzureIaaSVMJobV2")] + AzureIaaSvmJobV2(AzureIaaSvmJobV2), + AzureStorageJob(AzureStorageJob), + AzureWorkloadJob(AzureWorkloadJob), + DpmJob(DpmJob), + MabJob(MabJob), + VaultJob(VaultJob), +} #[doc = "Filters to list the jobs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobQueryObject { @@ -7174,7 +7216,7 @@ pub struct JobResource { pub resource: Resource, #[doc = "Defines workload agnostic properties for a job."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl JobResource { pub fn new() -> Self { @@ -7888,10 +7930,10 @@ pub struct MabProtectionPolicy { pub protection_policy: ProtectionPolicy, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl MabProtectionPolicy { pub fn new(protection_policy: ProtectionPolicy) -> Self { @@ -8112,6 +8154,12 @@ impl OperationResultInfoBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationResultInfoBaseUnion { + ExportJobsOperationResultInfo(ExportJobsOperationResultInfo), + OperationResultInfo(OperationResultInfo), +} #[doc = "Base class for operation result info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationResultInfoBaseResource { @@ -8119,7 +8167,7 @@ pub struct OperationResultInfoBaseResource { pub operation_worker_response: OperationWorkerResponse, #[doc = "Base class for operation result info."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option, + pub operation: Option, } impl OperationResultInfoBaseResource { pub fn new() -> Self { @@ -8149,7 +8197,7 @@ pub struct OperationStatus { pub error: Option, #[doc = "Base class for additional information of operation status."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl OperationStatus { pub fn new() -> Self { @@ -8229,6 +8277,15 @@ impl OperationStatusExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationStatusExtendedInfoUnion { + OperationStatusJobExtendedInfo(OperationStatusJobExtendedInfo), + OperationStatusJobsExtendedInfo(OperationStatusJobsExtendedInfo), + #[serde(rename = "OperationStatusProvisionILRExtendedInfo")] + OperationStatusProvisionIlrExtendedInfo(OperationStatusProvisionIlrExtendedInfo), + OperationStatusValidateOperationExtendedInfo(OperationStatusValidateOperationExtendedInfo), +} #[doc = "Operation status job extended info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationStatusJobExtendedInfo { @@ -8989,6 +9046,13 @@ pub mod protectable_container { AzureWorkloadContainer, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectableContainerType")] +pub enum ProtectableContainerUnion { + StorageContainer(AzureStorageProtectableContainer), + #[serde(rename = "VMAppContainer")] + VmAppContainer(AzureVmAppContainerProtectableContainer), +} #[doc = "Protectable Container Class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectableContainerResource { @@ -8996,7 +9060,7 @@ pub struct ProtectableContainerResource { pub resource: Resource, #[doc = "Protectable Container Class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectableContainerResource { pub fn new() -> Self { @@ -9282,6 +9346,20 @@ pub mod protected_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectedItemType")] +pub enum ProtectedItemUnion { + AzureFileShareProtectedItem(AzureFileshareProtectedItem), + #[serde(rename = "AzureIaaSVMProtectedItem")] + AzureIaaSvmProtectedItem(AzureIaaSvmProtectedItem), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(AzureSqlProtectedItem), + AzureVmWorkloadProtectedItem(AzureVmWorkloadProtectedItem), + #[serde(rename = "DPMProtectedItem")] + DpmProtectedItem(DpmProtectedItem), + GenericProtectedItem(GenericProtectedItem), + MabFileFolderProtectedItem(MabFileFolderProtectedItem), +} #[doc = "Filters to list backup items."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectedItemQueryObject { @@ -9495,7 +9573,7 @@ pub struct ProtectedItemResource { pub resource: Resource, #[doc = "Base class for backup items."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectedItemResource { pub fn new() -> Self { @@ -9698,6 +9776,19 @@ pub mod protection_container { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "containerType")] +pub enum ProtectionContainerUnion { + AzureSqlContainer(AzureSqlContainer), + StorageContainer(AzureStorageContainer), + AzureWorkloadContainer(AzureWorkloadContainer), + #[serde(rename = "DPMContainer")] + DpmContainer(DpmContainer), + GenericContainer(GenericContainer), + #[serde(rename = "IaasVMContainer")] + IaasVmContainer(IaaSvmContainer), + Windows(MabContainer), +} #[doc = "Base class for container with backup items. Containers with specific workloads are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionContainerResource { @@ -9705,7 +9796,7 @@ pub struct ProtectionContainerResource { pub resource: Resource, #[doc = "Base class for container with backup items. Containers with specific workloads are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionContainerResource { pub fn new() -> Self { @@ -9924,6 +10015,13 @@ pub mod protection_intent { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectionIntentItemType")] +pub enum ProtectionIntentUnion { + RecoveryServiceVaultItem(AzureRecoveryServiceVaultProtectionIntent), + AzureResourceItem(AzureResourceProtectionIntent), + AzureWorkloadContainerAutoProtectionIntent(AzureWorkloadContainerAutoProtectionIntent), +} #[doc = "Filters to list protection intent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionIntentQueryObject { @@ -10050,7 +10148,7 @@ pub struct ProtectionIntentResource { pub resource: Resource, #[doc = "Base class for backup ProtectionIntent."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionIntentResource { pub fn new() -> Self { @@ -10108,6 +10206,18 @@ impl ProtectionPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "backupManagementType")] +pub enum ProtectionPolicyUnion { + AzureStorage(AzureFileShareProtectionPolicy), + #[serde(rename = "AzureIaasVM")] + AzureIaasVm(AzureIaaSvmProtectionPolicy), + AzureSql(AzureSqlProtectionPolicy), + AzureWorkload(AzureVmWorkloadProtectionPolicy), + GenericProtectionPolicy(GenericProtectionPolicy), + #[serde(rename = "MAB")] + Mab(MabProtectionPolicy), +} #[doc = "Filters the list backup policies API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionPolicyQueryObject { @@ -10262,7 +10372,7 @@ pub struct ProtectionPolicyResource { pub resource: Resource, #[doc = "Base class for backup policy. Workload-specific backup policies are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionPolicyResource { pub fn new() -> Self { @@ -10305,6 +10415,15 @@ impl RecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RecoveryPointUnion { + AzureFileShareRecoveryPoint(AzureFileShareRecoveryPoint), + AzureWorkloadRecoveryPoint(AzureWorkloadRecoveryPoint), + GenericRecoveryPoint(GenericRecoveryPoint), + #[serde(rename = "IaasVMRecoveryPoint")] + IaasVmRecoveryPoint(IaasVmRecoveryPoint), +} #[doc = "Disk configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPointDiskConfiguration { @@ -10425,7 +10544,7 @@ pub struct RecoveryPointResource { pub resource: Resource, #[doc = "Base class for backup copies. Workload-specific backup copies are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl RecoveryPointResource { pub fn new() -> Self { @@ -10767,6 +10886,14 @@ impl RestoreRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreRequestUnion { + AzureFileShareRestoreRequest(AzureFileShareRestoreRequest), + AzureWorkloadRestoreRequest(AzureWorkloadRestoreRequest), + #[serde(rename = "IaasVMRestoreRequest")] + IaasVmRestoreRequest(IaasVmRestoreRequest), +} #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestoreRequestResource { @@ -10774,7 +10901,7 @@ pub struct RestoreRequestResource { pub resource: Resource, #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl RestoreRequestResource { pub fn new() -> Self { @@ -10854,6 +10981,12 @@ impl RetentionPolicy { Self { retention_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "retentionPolicyType")] +pub enum RetentionPolicyUnion { + LongTermRetentionPolicy(LongTermRetentionPolicy), + SimpleRetentionPolicy(SimpleRetentionPolicy), +} #[doc = "SQLDataDirectory info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SqlDataDirectory { @@ -10989,6 +11122,14 @@ impl SchedulePolicy { Self { schedule_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "schedulePolicyType")] +pub enum SchedulePolicyUnion { + LogSchedulePolicy(LogSchedulePolicy), + LongTermSchedulePolicy(LongTermSchedulePolicy), + SimpleSchedulePolicy(SimpleSchedulePolicy), + SimpleSchedulePolicyV2(SimpleSchedulePolicyV2), +} #[doc = "Base class for get security pin request body"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityPinBase { @@ -11205,10 +11346,10 @@ pub struct SubProtectionPolicy { pub policy_type: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "Tiering policy to automatically move RPs to another tier.\r\nKey is Target Tier, defined in RecoveryPointTierType enum.\r\nTiering policy specifies the criteria to move RP to the target tier."] #[serde(rename = "tieringPolicy", default, skip_serializing_if = "Option::is_none")] pub tiering_policy: Option, @@ -11612,6 +11753,11 @@ impl ValidateOperationRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum ValidateOperationRequestUnion { + ValidateRestoreOperationRequest(ValidateRestoreOperationRequest), +} #[doc = "Base class for validate operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidateOperationResponse { @@ -11647,7 +11793,7 @@ pub struct ValidateRestoreOperationRequest { pub validate_operation_request: ValidateOperationRequest, #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[serde(rename = "restoreRequest", default, skip_serializing_if = "Option::is_none")] - pub restore_request: Option, + pub restore_request: Option, } impl ValidateRestoreOperationRequest { pub fn new(validate_operation_request: ValidateOperationRequest) -> Self { @@ -11742,6 +11888,11 @@ impl VaultStorageConfigOperationResultResponse { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum VaultStorageConfigOperationResultResponseUnion { + PrepareDataMoveResponse(PrepareDataMoveResponse), +} #[doc = "Weekly retention format."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WeeklyRetentionFormat { @@ -11912,6 +12063,11 @@ pub mod workload_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "workloadItemType")] +pub enum WorkloadItemUnion { + AzureVmWorkloadItem(AzureVmWorkloadItem), +} #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadItemResource { @@ -11919,7 +12075,7 @@ pub struct WorkloadItemResource { pub resource: Resource, #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadItemResource { pub fn new() -> Self { @@ -12026,6 +12182,14 @@ pub mod workload_protectable_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectableItemType")] +pub enum WorkloadProtectableItemUnion { + AzureFileShare(AzureFileShareProtectableItem), + AzureVmWorkloadProtectableItem(AzureVmWorkloadProtectableItem), + #[serde(rename = "IaaSVMProtectableItem")] + IaaSvmProtectableItem(IaaSvmProtectableItem), +} #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadProtectableItemResource { @@ -12033,7 +12197,7 @@ pub struct WorkloadProtectableItemResource { pub resource: Resource, #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadProtectableItemResource { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservicesbackup/src/package_2023_02/mod.rs b/services/mgmt/recoveryservicesbackup/src/package_2023_02/mod.rs index 549e161474..2517ea66c9 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_2023_02/mod.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_2023_02/mod.rs @@ -1284,7 +1284,7 @@ pub mod feature_support { &self, azure_region: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> validate::RequestBuilder { validate::RequestBuilder { client: self.0.clone(), @@ -1348,7 +1348,7 @@ pub mod feature_support { pub(crate) client: super::super::Client, pub(crate) azure_region: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::FeatureSupportRequest, + pub(crate) parameters: models::FeatureSupportRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3560,9 +3560,9 @@ pub mod bms_prepare_data_move_operation_result { #[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::VaultStorageConfigOperationResultResponse = serde_json::from_slice(&bytes)?; + let body: models::VaultStorageConfigOperationResultResponseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3642,8 +3642,8 @@ pub mod bms_prepare_data_move_operation_result { } } 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`."] @@ -6381,7 +6381,7 @@ pub mod operation { vault_name: impl Into, resource_group_name: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> validate::RequestBuilder { validate::RequestBuilder { client: self.0.clone(), @@ -6447,7 +6447,7 @@ pub mod operation { pub(crate) vault_name: String, pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::ValidateOperationRequest, + pub(crate) parameters: models::ValidateOperationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6523,7 +6523,7 @@ pub mod validate_operation { vault_name: impl Into, resource_group_name: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> trigger::RequestBuilder { trigger::RequestBuilder { client: self.0.clone(), @@ -6583,7 +6583,7 @@ pub mod validate_operation { pub(crate) vault_name: String, pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::ValidateOperationRequest, + pub(crate) parameters: models::ValidateOperationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/recoveryservicesbackup/src/package_2023_02/models.rs b/services/mgmt/recoveryservicesbackup/src/package_2023_02/models.rs index 6ea3311136..dd87e92a19 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_2023_02/models.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_2023_02/models.rs @@ -131,10 +131,10 @@ pub struct AzureFileShareProtectionPolicy { pub work_load_type: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "TimeZone optional input as string. For example: TimeZone = \"Pacific Standard Time\"."] #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] pub time_zone: Option, @@ -1028,10 +1028,10 @@ pub struct AzureIaaSvmProtectionPolicy { pub instant_rp_details: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "Tiering policy to automatically move RPs to another tier\r\nKey is Target Tier, defined in RecoveryPointTierType enum.\r\nTiering policy specifies the criteria to move RP to the target tier."] #[serde(rename = "tieringPolicy", default, skip_serializing_if = "Option::is_none")] pub tiering_policy: Option, @@ -1250,7 +1250,7 @@ pub struct AzureSqlProtectionPolicy { pub protection_policy: ProtectionPolicy, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl AzureSqlProtectionPolicy { pub fn new(protection_policy: ProtectionPolicy) -> Self { @@ -4323,6 +4323,12 @@ pub mod backup_engine_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "backupEngineType")] +pub enum BackupEngineBaseUnion { + AzureBackupServerEngine(AzureBackupServerEngine), + DpmBackupEngine(DpmBackupEngine), +} #[doc = "The base backup engine class. All workload specific backup engines derive from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupEngineBaseResource { @@ -4330,7 +4336,7 @@ pub struct BackupEngineBaseResource { pub resource: Resource, #[doc = "The base backup engine class. All workload specific backup engines derive from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BackupEngineBaseResource { pub fn new() -> Self { @@ -4503,6 +4509,14 @@ impl BackupRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupRequestUnion { + AzureFileShareBackupRequest(AzureFileShareBackupRequest), + AzureWorkloadBackupRequest(AzureWorkloadBackupRequest), + #[serde(rename = "IaasVMBackupRequest")] + IaasVmBackupRequest(IaasVmBackupRequest), +} #[doc = "Base class for backup request. Workload-specific backup requests are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupRequestResource { @@ -4510,7 +4524,7 @@ pub struct BackupRequestResource { pub resource: Resource, #[doc = "Base class for backup request. Workload-specific backup requests are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BackupRequestResource { pub fn new() -> Self { @@ -6214,6 +6228,13 @@ impl FeatureSupportRequest { Self { feature_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "featureType")] +pub enum FeatureSupportRequestUnion { + AzureBackupGoals(AzureBackupGoalFeatureSupportRequest), + #[serde(rename = "AzureVMResourceBackup")] + AzureVmResourceBackup(AzureVmResourceFeatureSupportRequest), +} #[doc = "Base class for generic container of backup items"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GenericContainer { @@ -6445,6 +6466,14 @@ impl IlrRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum IlrRequestUnion { + #[serde(rename = "AzureFileShareProvisionILRRequest")] + AzureFileShareProvisionIlrRequest(AzureFileShareProvisionIlrRequest), + #[serde(rename = "IaasVMILRRegistrationRequest")] + IaasVmilrRegistrationRequest(IaasVmilrRegistrationRequest), +} #[doc = "Parameters to Provision ILR API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IlrRequestResource { @@ -6452,7 +6481,7 @@ pub struct IlrRequestResource { pub resource: Resource, #[doc = "Parameters to Provision ILR API."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl IlrRequestResource { pub fn new() -> Self { @@ -7028,6 +7057,19 @@ pub mod job { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobType")] +pub enum JobUnion { + #[serde(rename = "AzureIaaSVMJob")] + AzureIaaSvmJob(AzureIaaSvmJob), + #[serde(rename = "AzureIaaSVMJobV2")] + AzureIaaSvmJobV2(AzureIaaSvmJobV2), + AzureStorageJob(AzureStorageJob), + AzureWorkloadJob(AzureWorkloadJob), + DpmJob(DpmJob), + MabJob(MabJob), + VaultJob(VaultJob), +} #[doc = "Filters to list the jobs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobQueryObject { @@ -7221,7 +7263,7 @@ pub struct JobResource { pub resource: Resource, #[doc = "Defines workload agnostic properties for a job."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl JobResource { pub fn new() -> Self { @@ -7935,10 +7977,10 @@ pub struct MabProtectionPolicy { pub protection_policy: ProtectionPolicy, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl MabProtectionPolicy { pub fn new(protection_policy: ProtectionPolicy) -> Self { @@ -8159,6 +8201,12 @@ impl OperationResultInfoBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationResultInfoBaseUnion { + ExportJobsOperationResultInfo(ExportJobsOperationResultInfo), + OperationResultInfo(OperationResultInfo), +} #[doc = "Base class for operation result info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationResultInfoBaseResource { @@ -8166,7 +8214,7 @@ pub struct OperationResultInfoBaseResource { pub operation_worker_response: OperationWorkerResponse, #[doc = "Base class for operation result info."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option, + pub operation: Option, } impl OperationResultInfoBaseResource { pub fn new() -> Self { @@ -8196,7 +8244,7 @@ pub struct OperationStatus { pub error: Option, #[doc = "Base class for additional information of operation status."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl OperationStatus { pub fn new() -> Self { @@ -8276,6 +8324,15 @@ impl OperationStatusExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationStatusExtendedInfoUnion { + OperationStatusJobExtendedInfo(OperationStatusJobExtendedInfo), + OperationStatusJobsExtendedInfo(OperationStatusJobsExtendedInfo), + #[serde(rename = "OperationStatusProvisionILRExtendedInfo")] + OperationStatusProvisionIlrExtendedInfo(OperationStatusProvisionIlrExtendedInfo), + OperationStatusValidateOperationExtendedInfo(OperationStatusValidateOperationExtendedInfo), +} #[doc = "Operation status job extended info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationStatusJobExtendedInfo { @@ -9036,6 +9093,13 @@ pub mod protectable_container { AzureWorkloadContainer, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectableContainerType")] +pub enum ProtectableContainerUnion { + StorageContainer(AzureStorageProtectableContainer), + #[serde(rename = "VMAppContainer")] + VmAppContainer(AzureVmAppContainerProtectableContainer), +} #[doc = "Protectable Container Class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectableContainerResource { @@ -9043,7 +9107,7 @@ pub struct ProtectableContainerResource { pub resource: Resource, #[doc = "Protectable Container Class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectableContainerResource { pub fn new() -> Self { @@ -9329,6 +9393,20 @@ pub mod protected_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectedItemType")] +pub enum ProtectedItemUnion { + AzureFileShareProtectedItem(AzureFileshareProtectedItem), + #[serde(rename = "AzureIaaSVMProtectedItem")] + AzureIaaSvmProtectedItem(AzureIaaSvmProtectedItem), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(AzureSqlProtectedItem), + AzureVmWorkloadProtectedItem(AzureVmWorkloadProtectedItem), + #[serde(rename = "DPMProtectedItem")] + DpmProtectedItem(DpmProtectedItem), + GenericProtectedItem(GenericProtectedItem), + MabFileFolderProtectedItem(MabFileFolderProtectedItem), +} #[doc = "Filters to list backup items."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectedItemQueryObject { @@ -9542,7 +9620,7 @@ pub struct ProtectedItemResource { pub resource: Resource, #[doc = "Base class for backup items."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectedItemResource { pub fn new() -> Self { @@ -9745,6 +9823,19 @@ pub mod protection_container { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "containerType")] +pub enum ProtectionContainerUnion { + AzureSqlContainer(AzureSqlContainer), + StorageContainer(AzureStorageContainer), + AzureWorkloadContainer(AzureWorkloadContainer), + #[serde(rename = "DPMContainer")] + DpmContainer(DpmContainer), + GenericContainer(GenericContainer), + #[serde(rename = "IaasVMContainer")] + IaasVmContainer(IaaSvmContainer), + Windows(MabContainer), +} #[doc = "Base class for container with backup items. Containers with specific workloads are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionContainerResource { @@ -9752,7 +9843,7 @@ pub struct ProtectionContainerResource { pub resource: Resource, #[doc = "Base class for container with backup items. Containers with specific workloads are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionContainerResource { pub fn new() -> Self { @@ -9971,6 +10062,13 @@ pub mod protection_intent { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectionIntentItemType")] +pub enum ProtectionIntentUnion { + RecoveryServiceVaultItem(AzureRecoveryServiceVaultProtectionIntent), + AzureResourceItem(AzureResourceProtectionIntent), + AzureWorkloadContainerAutoProtectionIntent(AzureWorkloadContainerAutoProtectionIntent), +} #[doc = "Filters to list protection intent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionIntentQueryObject { @@ -10097,7 +10195,7 @@ pub struct ProtectionIntentResource { pub resource: Resource, #[doc = "Base class for backup ProtectionIntent."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionIntentResource { pub fn new() -> Self { @@ -10155,6 +10253,18 @@ impl ProtectionPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "backupManagementType")] +pub enum ProtectionPolicyUnion { + AzureStorage(AzureFileShareProtectionPolicy), + #[serde(rename = "AzureIaasVM")] + AzureIaasVm(AzureIaaSvmProtectionPolicy), + AzureSql(AzureSqlProtectionPolicy), + AzureWorkload(AzureVmWorkloadProtectionPolicy), + GenericProtectionPolicy(GenericProtectionPolicy), + #[serde(rename = "MAB")] + Mab(MabProtectionPolicy), +} #[doc = "Filters the list backup policies API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionPolicyQueryObject { @@ -10309,7 +10419,7 @@ pub struct ProtectionPolicyResource { pub resource: Resource, #[doc = "Base class for backup policy. Workload-specific backup policies are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionPolicyResource { pub fn new() -> Self { @@ -10352,6 +10462,15 @@ impl RecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RecoveryPointUnion { + AzureFileShareRecoveryPoint(AzureFileShareRecoveryPoint), + AzureWorkloadRecoveryPoint(AzureWorkloadRecoveryPoint), + GenericRecoveryPoint(GenericRecoveryPoint), + #[serde(rename = "IaasVMRecoveryPoint")] + IaasVmRecoveryPoint(IaasVmRecoveryPoint), +} #[doc = "Disk configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPointDiskConfiguration { @@ -10475,7 +10594,7 @@ pub struct RecoveryPointResource { pub resource: Resource, #[doc = "Base class for backup copies. Workload-specific backup copies are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl RecoveryPointResource { pub fn new() -> Self { @@ -10817,6 +10936,14 @@ impl RestoreRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreRequestUnion { + AzureFileShareRestoreRequest(AzureFileShareRestoreRequest), + AzureWorkloadRestoreRequest(AzureWorkloadRestoreRequest), + #[serde(rename = "IaasVMRestoreRequest")] + IaasVmRestoreRequest(IaasVmRestoreRequest), +} #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestoreRequestResource { @@ -10824,7 +10951,7 @@ pub struct RestoreRequestResource { pub resource: Resource, #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl RestoreRequestResource { pub fn new() -> Self { @@ -10904,6 +11031,12 @@ impl RetentionPolicy { Self { retention_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "retentionPolicyType")] +pub enum RetentionPolicyUnion { + LongTermRetentionPolicy(LongTermRetentionPolicy), + SimpleRetentionPolicy(SimpleRetentionPolicy), +} #[doc = "SQLDataDirectory info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SqlDataDirectory { @@ -11039,6 +11172,14 @@ impl SchedulePolicy { Self { schedule_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "schedulePolicyType")] +pub enum SchedulePolicyUnion { + LogSchedulePolicy(LogSchedulePolicy), + LongTermSchedulePolicy(LongTermSchedulePolicy), + SimpleSchedulePolicy(SimpleSchedulePolicy), + SimpleSchedulePolicyV2(SimpleSchedulePolicyV2), +} #[doc = "Restore request parameters for Secured VMs"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecuredVmDetails { @@ -11267,10 +11408,10 @@ pub struct SubProtectionPolicy { pub policy_type: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "Tiering policy to automatically move RPs to another tier.\r\nKey is Target Tier, defined in RecoveryPointTierType enum.\r\nTiering policy specifies the criteria to move RP to the target tier."] #[serde(rename = "tieringPolicy", default, skip_serializing_if = "Option::is_none")] pub tiering_policy: Option, @@ -11699,6 +11840,11 @@ impl ValidateOperationRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum ValidateOperationRequestUnion { + ValidateRestoreOperationRequest(ValidateRestoreOperationRequest), +} #[doc = "Base class for validate operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidateOperationResponse { @@ -11734,7 +11880,7 @@ pub struct ValidateRestoreOperationRequest { pub validate_operation_request: ValidateOperationRequest, #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[serde(rename = "restoreRequest", default, skip_serializing_if = "Option::is_none")] - pub restore_request: Option, + pub restore_request: Option, } impl ValidateRestoreOperationRequest { pub fn new(validate_operation_request: ValidateOperationRequest) -> Self { @@ -11829,6 +11975,11 @@ impl VaultStorageConfigOperationResultResponse { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum VaultStorageConfigOperationResultResponseUnion { + PrepareDataMoveResponse(PrepareDataMoveResponse), +} #[doc = "Weekly retention format."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WeeklyRetentionFormat { @@ -11999,6 +12150,11 @@ pub mod workload_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "workloadItemType")] +pub enum WorkloadItemUnion { + AzureVmWorkloadItem(AzureVmWorkloadItem), +} #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadItemResource { @@ -12006,7 +12162,7 @@ pub struct WorkloadItemResource { pub resource: Resource, #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadItemResource { pub fn new() -> Self { @@ -12113,6 +12269,14 @@ pub mod workload_protectable_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectableItemType")] +pub enum WorkloadProtectableItemUnion { + AzureFileShare(AzureFileShareProtectableItem), + AzureVmWorkloadProtectableItem(AzureVmWorkloadProtectableItem), + #[serde(rename = "IaaSVMProtectableItem")] + IaaSvmProtectableItem(IaaSvmProtectableItem), +} #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadProtectableItemResource { @@ -12120,7 +12284,7 @@ pub struct WorkloadProtectableItemResource { pub resource: Resource, #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadProtectableItemResource { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservicesbackup/src/package_2023_04/mod.rs b/services/mgmt/recoveryservicesbackup/src/package_2023_04/mod.rs index 23b3231364..5ff2bcd9e6 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_2023_04/mod.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_2023_04/mod.rs @@ -1284,7 +1284,7 @@ pub mod feature_support { &self, azure_region: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> validate::RequestBuilder { validate::RequestBuilder { client: self.0.clone(), @@ -1348,7 +1348,7 @@ pub mod feature_support { pub(crate) client: super::super::Client, pub(crate) azure_region: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::FeatureSupportRequest, + pub(crate) parameters: models::FeatureSupportRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3560,9 +3560,9 @@ pub mod bms_prepare_data_move_operation_result { #[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::VaultStorageConfigOperationResultResponse = serde_json::from_slice(&bytes)?; + let body: models::VaultStorageConfigOperationResultResponseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3642,8 +3642,8 @@ pub mod bms_prepare_data_move_operation_result { } } 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`."] @@ -6381,7 +6381,7 @@ pub mod operation { vault_name: impl Into, resource_group_name: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> validate::RequestBuilder { validate::RequestBuilder { client: self.0.clone(), @@ -6447,7 +6447,7 @@ pub mod operation { pub(crate) vault_name: String, pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::ValidateOperationRequest, + pub(crate) parameters: models::ValidateOperationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6523,7 +6523,7 @@ pub mod validate_operation { vault_name: impl Into, resource_group_name: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> trigger::RequestBuilder { trigger::RequestBuilder { client: self.0.clone(), @@ -6583,7 +6583,7 @@ pub mod validate_operation { pub(crate) vault_name: String, pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::ValidateOperationRequest, + pub(crate) parameters: models::ValidateOperationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/recoveryservicesbackup/src/package_2023_04/models.rs b/services/mgmt/recoveryservicesbackup/src/package_2023_04/models.rs index 7af545132c..428eceaa31 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_2023_04/models.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_2023_04/models.rs @@ -131,10 +131,10 @@ pub struct AzureFileShareProtectionPolicy { pub work_load_type: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "TimeZone optional input as string. For example: TimeZone = \"Pacific Standard Time\"."] #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] pub time_zone: Option, @@ -1028,10 +1028,10 @@ pub struct AzureIaaSvmProtectionPolicy { pub instant_rp_details: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "Tiering policy to automatically move RPs to another tier\r\nKey is Target Tier, defined in RecoveryPointTierType enum.\r\nTiering policy specifies the criteria to move RP to the target tier."] #[serde(rename = "tieringPolicy", default, skip_serializing_if = "Option::is_none")] pub tiering_policy: Option, @@ -1250,7 +1250,7 @@ pub struct AzureSqlProtectionPolicy { pub protection_policy: ProtectionPolicy, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl AzureSqlProtectionPolicy { pub fn new(protection_policy: ProtectionPolicy) -> Self { @@ -4345,6 +4345,12 @@ pub mod backup_engine_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "backupEngineType")] +pub enum BackupEngineBaseUnion { + AzureBackupServerEngine(AzureBackupServerEngine), + DpmBackupEngine(DpmBackupEngine), +} #[doc = "The base backup engine class. All workload specific backup engines derive from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupEngineBaseResource { @@ -4352,7 +4358,7 @@ pub struct BackupEngineBaseResource { pub resource: Resource, #[doc = "The base backup engine class. All workload specific backup engines derive from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BackupEngineBaseResource { pub fn new() -> Self { @@ -4525,6 +4531,14 @@ impl BackupRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupRequestUnion { + AzureFileShareBackupRequest(AzureFileShareBackupRequest), + AzureWorkloadBackupRequest(AzureWorkloadBackupRequest), + #[serde(rename = "IaasVMBackupRequest")] + IaasVmBackupRequest(IaasVmBackupRequest), +} #[doc = "Base class for backup request. Workload-specific backup requests are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupRequestResource { @@ -4532,7 +4546,7 @@ pub struct BackupRequestResource { pub resource: Resource, #[doc = "Base class for backup request. Workload-specific backup requests are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BackupRequestResource { pub fn new() -> Self { @@ -6282,6 +6296,13 @@ impl FeatureSupportRequest { Self { feature_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "featureType")] +pub enum FeatureSupportRequestUnion { + AzureBackupGoals(AzureBackupGoalFeatureSupportRequest), + #[serde(rename = "AzureVMResourceBackup")] + AzureVmResourceBackup(AzureVmResourceFeatureSupportRequest), +} #[doc = "Base class for generic container of backup items"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GenericContainer { @@ -6513,6 +6534,14 @@ impl IlrRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum IlrRequestUnion { + #[serde(rename = "AzureFileShareProvisionILRRequest")] + AzureFileShareProvisionIlrRequest(AzureFileShareProvisionIlrRequest), + #[serde(rename = "IaasVMILRRegistrationRequest")] + IaasVmilrRegistrationRequest(IaasVmilrRegistrationRequest), +} #[doc = "Parameters to Provision ILR API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IlrRequestResource { @@ -6520,7 +6549,7 @@ pub struct IlrRequestResource { pub resource: Resource, #[doc = "Parameters to Provision ILR API."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl IlrRequestResource { pub fn new() -> Self { @@ -7096,6 +7125,19 @@ pub mod job { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobType")] +pub enum JobUnion { + #[serde(rename = "AzureIaaSVMJob")] + AzureIaaSvmJob(AzureIaaSvmJob), + #[serde(rename = "AzureIaaSVMJobV2")] + AzureIaaSvmJobV2(AzureIaaSvmJobV2), + AzureStorageJob(AzureStorageJob), + AzureWorkloadJob(AzureWorkloadJob), + DpmJob(DpmJob), + MabJob(MabJob), + VaultJob(VaultJob), +} #[doc = "Filters to list the jobs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobQueryObject { @@ -7289,7 +7331,7 @@ pub struct JobResource { pub resource: Resource, #[doc = "Defines workload agnostic properties for a job."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl JobResource { pub fn new() -> Self { @@ -8003,10 +8045,10 @@ pub struct MabProtectionPolicy { pub protection_policy: ProtectionPolicy, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl MabProtectionPolicy { pub fn new(protection_policy: ProtectionPolicy) -> Self { @@ -8227,6 +8269,12 @@ impl OperationResultInfoBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationResultInfoBaseUnion { + ExportJobsOperationResultInfo(ExportJobsOperationResultInfo), + OperationResultInfo(OperationResultInfo), +} #[doc = "Base class for operation result info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationResultInfoBaseResource { @@ -8234,7 +8282,7 @@ pub struct OperationResultInfoBaseResource { pub operation_worker_response: OperationWorkerResponse, #[doc = "Base class for operation result info."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option, + pub operation: Option, } impl OperationResultInfoBaseResource { pub fn new() -> Self { @@ -8264,7 +8312,7 @@ pub struct OperationStatus { pub error: Option, #[doc = "Base class for additional information of operation status."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl OperationStatus { pub fn new() -> Self { @@ -8344,6 +8392,15 @@ impl OperationStatusExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationStatusExtendedInfoUnion { + OperationStatusJobExtendedInfo(OperationStatusJobExtendedInfo), + OperationStatusJobsExtendedInfo(OperationStatusJobsExtendedInfo), + #[serde(rename = "OperationStatusProvisionILRExtendedInfo")] + OperationStatusProvisionIlrExtendedInfo(OperationStatusProvisionIlrExtendedInfo), + OperationStatusValidateOperationExtendedInfo(OperationStatusValidateOperationExtendedInfo), +} #[doc = "Operation status job extended info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationStatusJobExtendedInfo { @@ -9104,6 +9161,13 @@ pub mod protectable_container { AzureWorkloadContainer, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectableContainerType")] +pub enum ProtectableContainerUnion { + StorageContainer(AzureStorageProtectableContainer), + #[serde(rename = "VMAppContainer")] + VmAppContainer(AzureVmAppContainerProtectableContainer), +} #[doc = "Protectable Container Class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectableContainerResource { @@ -9111,7 +9175,7 @@ pub struct ProtectableContainerResource { pub resource: Resource, #[doc = "Protectable Container Class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectableContainerResource { pub fn new() -> Self { @@ -9397,6 +9461,20 @@ pub mod protected_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectedItemType")] +pub enum ProtectedItemUnion { + AzureFileShareProtectedItem(AzureFileshareProtectedItem), + #[serde(rename = "AzureIaaSVMProtectedItem")] + AzureIaaSvmProtectedItem(AzureIaaSvmProtectedItem), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(AzureSqlProtectedItem), + AzureVmWorkloadProtectedItem(AzureVmWorkloadProtectedItem), + #[serde(rename = "DPMProtectedItem")] + DpmProtectedItem(DpmProtectedItem), + GenericProtectedItem(GenericProtectedItem), + MabFileFolderProtectedItem(MabFileFolderProtectedItem), +} #[doc = "Filters to list backup items."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectedItemQueryObject { @@ -9610,7 +9688,7 @@ pub struct ProtectedItemResource { pub resource: Resource, #[doc = "Base class for backup items."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectedItemResource { pub fn new() -> Self { @@ -9813,6 +9891,19 @@ pub mod protection_container { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "containerType")] +pub enum ProtectionContainerUnion { + AzureSqlContainer(AzureSqlContainer), + StorageContainer(AzureStorageContainer), + AzureWorkloadContainer(AzureWorkloadContainer), + #[serde(rename = "DPMContainer")] + DpmContainer(DpmContainer), + GenericContainer(GenericContainer), + #[serde(rename = "IaasVMContainer")] + IaasVmContainer(IaaSvmContainer), + Windows(MabContainer), +} #[doc = "Base class for container with backup items. Containers with specific workloads are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionContainerResource { @@ -9820,7 +9911,7 @@ pub struct ProtectionContainerResource { pub resource: Resource, #[doc = "Base class for container with backup items. Containers with specific workloads are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionContainerResource { pub fn new() -> Self { @@ -10039,6 +10130,13 @@ pub mod protection_intent { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectionIntentItemType")] +pub enum ProtectionIntentUnion { + RecoveryServiceVaultItem(AzureRecoveryServiceVaultProtectionIntent), + AzureResourceItem(AzureResourceProtectionIntent), + AzureWorkloadContainerAutoProtectionIntent(AzureWorkloadContainerAutoProtectionIntent), +} #[doc = "Filters to list protection intent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionIntentQueryObject { @@ -10165,7 +10263,7 @@ pub struct ProtectionIntentResource { pub resource: Resource, #[doc = "Base class for backup ProtectionIntent."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionIntentResource { pub fn new() -> Self { @@ -10223,6 +10321,18 @@ impl ProtectionPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "backupManagementType")] +pub enum ProtectionPolicyUnion { + AzureStorage(AzureFileShareProtectionPolicy), + #[serde(rename = "AzureIaasVM")] + AzureIaasVm(AzureIaaSvmProtectionPolicy), + AzureSql(AzureSqlProtectionPolicy), + AzureWorkload(AzureVmWorkloadProtectionPolicy), + GenericProtectionPolicy(GenericProtectionPolicy), + #[serde(rename = "MAB")] + Mab(MabProtectionPolicy), +} #[doc = "Filters the list backup policies API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionPolicyQueryObject { @@ -10377,7 +10487,7 @@ pub struct ProtectionPolicyResource { pub resource: Resource, #[doc = "Base class for backup policy. Workload-specific backup policies are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionPolicyResource { pub fn new() -> Self { @@ -10420,6 +10530,15 @@ impl RecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RecoveryPointUnion { + AzureFileShareRecoveryPoint(AzureFileShareRecoveryPoint), + AzureWorkloadRecoveryPoint(AzureWorkloadRecoveryPoint), + GenericRecoveryPoint(GenericRecoveryPoint), + #[serde(rename = "IaasVMRecoveryPoint")] + IaasVmRecoveryPoint(IaasVmRecoveryPoint), +} #[doc = "Disk configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPointDiskConfiguration { @@ -10543,7 +10662,7 @@ pub struct RecoveryPointResource { pub resource: Resource, #[doc = "Base class for backup copies. Workload-specific backup copies are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl RecoveryPointResource { pub fn new() -> Self { @@ -10885,6 +11004,14 @@ impl RestoreRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreRequestUnion { + AzureFileShareRestoreRequest(AzureFileShareRestoreRequest), + AzureWorkloadRestoreRequest(AzureWorkloadRestoreRequest), + #[serde(rename = "IaasVMRestoreRequest")] + IaasVmRestoreRequest(IaasVmRestoreRequest), +} #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestoreRequestResource { @@ -10892,7 +11019,7 @@ pub struct RestoreRequestResource { pub resource: Resource, #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl RestoreRequestResource { pub fn new() -> Self { @@ -10972,6 +11099,12 @@ impl RetentionPolicy { Self { retention_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "retentionPolicyType")] +pub enum RetentionPolicyUnion { + LongTermRetentionPolicy(LongTermRetentionPolicy), + SimpleRetentionPolicy(SimpleRetentionPolicy), +} #[doc = "SQLDataDirectory info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SqlDataDirectory { @@ -11107,6 +11240,14 @@ impl SchedulePolicy { Self { schedule_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "schedulePolicyType")] +pub enum SchedulePolicyUnion { + LogSchedulePolicy(LogSchedulePolicy), + LongTermSchedulePolicy(LongTermSchedulePolicy), + SimpleSchedulePolicy(SimpleSchedulePolicy), + SimpleSchedulePolicyV2(SimpleSchedulePolicyV2), +} #[doc = "Restore request parameters for Secured VMs"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecuredVmDetails { @@ -11335,10 +11476,10 @@ pub struct SubProtectionPolicy { pub policy_type: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "Tiering policy to automatically move RPs to another tier.\r\nKey is Target Tier, defined in RecoveryPointTierType enum.\r\nTiering policy specifies the criteria to move RP to the target tier."] #[serde(rename = "tieringPolicy", default, skip_serializing_if = "Option::is_none")] pub tiering_policy: Option, @@ -11767,6 +11908,11 @@ impl ValidateOperationRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum ValidateOperationRequestUnion { + ValidateRestoreOperationRequest(ValidateRestoreOperationRequest), +} #[doc = "Base class for validate operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidateOperationResponse { @@ -11802,7 +11948,7 @@ pub struct ValidateRestoreOperationRequest { pub validate_operation_request: ValidateOperationRequest, #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[serde(rename = "restoreRequest", default, skip_serializing_if = "Option::is_none")] - pub restore_request: Option, + pub restore_request: Option, } impl ValidateRestoreOperationRequest { pub fn new(validate_operation_request: ValidateOperationRequest) -> Self { @@ -11897,6 +12043,11 @@ impl VaultStorageConfigOperationResultResponse { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum VaultStorageConfigOperationResultResponseUnion { + PrepareDataMoveResponse(PrepareDataMoveResponse), +} #[doc = "Weekly retention format."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WeeklyRetentionFormat { @@ -12067,6 +12218,11 @@ pub mod workload_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "workloadItemType")] +pub enum WorkloadItemUnion { + AzureVmWorkloadItem(AzureVmWorkloadItem), +} #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadItemResource { @@ -12074,7 +12230,7 @@ pub struct WorkloadItemResource { pub resource: Resource, #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadItemResource { pub fn new() -> Self { @@ -12181,6 +12337,14 @@ pub mod workload_protectable_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectableItemType")] +pub enum WorkloadProtectableItemUnion { + AzureFileShare(AzureFileShareProtectableItem), + AzureVmWorkloadProtectableItem(AzureVmWorkloadProtectableItem), + #[serde(rename = "IaaSVMProtectableItem")] + IaaSvmProtectableItem(IaaSvmProtectableItem), +} #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadProtectableItemResource { @@ -12188,7 +12352,7 @@ pub struct WorkloadProtectableItemResource { pub resource: Resource, #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadProtectableItemResource { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservicesbackup/src/package_passivestamp_2023_01_15/models.rs b/services/mgmt/recoveryservicesbackup/src/package_passivestamp_2023_01_15/models.rs index f599982aa8..0ec118b380 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_passivestamp_2023_01_15/models.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_passivestamp_2023_01_15/models.rs @@ -2220,10 +2220,10 @@ impl ClientScriptForConnect { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CrossRegionRestoreRequest { #[serde(rename = "crossRegionRestoreAccessDetails", default, skip_serializing_if = "Option::is_none")] - pub cross_region_restore_access_details: Option, + pub cross_region_restore_access_details: Option, #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[serde(rename = "restoreRequest", default, skip_serializing_if = "Option::is_none")] - pub restore_request: Option, + pub restore_request: Option, } impl CrossRegionRestoreRequest { pub fn new() -> Self { @@ -2355,12 +2355,17 @@ impl CrrAccessToken { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum CrrAccessTokenUnion { + WorkloadCrrAccessToken(WorkloadCrrAccessToken), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CrrAccessTokenResource { #[serde(flatten)] pub resource: Resource, #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl CrrAccessTokenResource { pub fn new() -> Self { @@ -3249,6 +3254,16 @@ pub mod job { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobType")] +pub enum JobUnion { + #[serde(rename = "AzureIaaSVMJob")] + AzureIaaSvmJob(AzureIaaSvmJob), + AzureStorageJob(AzureStorageJob), + AzureWorkloadJob(AzureWorkloadJob), + DpmJob(DpmJob), + MabJob(MabJob), +} #[doc = "Filters to list the jobs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobQueryObject { @@ -3442,7 +3457,7 @@ pub struct JobResource { pub resource: Resource, #[doc = "Defines workload agnostic properties for a job."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl JobResource { pub fn new() -> Self { @@ -3986,7 +4001,7 @@ pub struct OperationStatus { pub error: Option, #[doc = "Base class for additional information of operation status."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl OperationStatus { pub fn new() -> Self { @@ -4066,6 +4081,15 @@ impl OperationStatusExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationStatusExtendedInfoUnion { + OperationStatusJobExtendedInfo(OperationStatusJobExtendedInfo), + OperationStatusJobsExtendedInfo(OperationStatusJobsExtendedInfo), + #[serde(rename = "OperationStatusProvisionILRExtendedInfo")] + OperationStatusProvisionIlrExtendedInfo(OperationStatusProvisionIlrExtendedInfo), + OperationStatusRecoveryPointExtendedInfo(OperationStatusRecoveryPointExtendedInfo), +} #[doc = "Operation status job extended info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationStatusJobExtendedInfo { @@ -4133,7 +4157,7 @@ pub struct OperationStatusRecoveryPointExtendedInfo { pub operation_status_extended_info: OperationStatusExtendedInfo, #[doc = "Base class for backup copies. Workload-specific backup copies are derived from this class."] #[serde(rename = "updatedRecoveryPoint", default, skip_serializing_if = "Option::is_none")] - pub updated_recovery_point: Option, + pub updated_recovery_point: Option, #[doc = "In case the share is in soft-deleted state, populate this field with deleted backup item"] #[serde(rename = "deletedBackupItemVersion", default, skip_serializing_if = "Option::is_none")] pub deleted_backup_item_version: Option, @@ -4402,6 +4426,20 @@ pub mod protected_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectedItemType")] +pub enum ProtectedItemUnion { + AzureFileShareProtectedItem(AzureFileshareProtectedItem), + #[serde(rename = "AzureIaaSVMProtectedItem")] + AzureIaaSvmProtectedItem(AzureIaaSvmProtectedItem), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(AzureSqlProtectedItem), + AzureVmWorkloadProtectedItem(AzureVmWorkloadProtectedItem), + #[serde(rename = "DPMProtectedItem")] + DpmProtectedItem(DpmProtectedItem), + GenericProtectedItem(GenericProtectedItem), + MabFileFolderProtectedItem(MabFileFolderProtectedItem), +} #[doc = "Filters to list backup items."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectedItemQueryObject { @@ -4612,7 +4650,7 @@ pub struct ProtectedItemResource { pub resource: Resource, #[doc = "Base class for backup items."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectedItemResource { pub fn new() -> Self { @@ -4655,6 +4693,15 @@ impl RecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RecoveryPointUnion { + AzureFileShareRecoveryPoint(AzureFileShareRecoveryPoint), + AzureWorkloadRecoveryPoint(AzureWorkloadRecoveryPoint), + GenericRecoveryPoint(GenericRecoveryPoint), + #[serde(rename = "IaasVMRecoveryPoint")] + IaasVmRecoveryPoint(IaasVmRecoveryPoint), +} #[doc = "Disk configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPointDiskConfiguration { @@ -4723,7 +4770,7 @@ pub struct RecoveryPointResource { pub resource: Resource, #[doc = "Base class for backup copies. Workload-specific backup copies are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl RecoveryPointResource { pub fn new() -> Self { @@ -4889,6 +4936,14 @@ impl RestoreRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreRequestUnion { + AzureFileShareRestoreRequest(AzureFileShareRestoreRequest), + AzureWorkloadRestoreRequest(AzureWorkloadRestoreRequest), + #[serde(rename = "IaasVMRestoreRequest")] + IaasVmRestoreRequest(IaasVmRestoreRequest), +} #[doc = "SQLDataDirectory info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SqlDataDirectory { diff --git a/services/mgmt/recoveryservicesbackup/src/package_preview_2022_09/mod.rs b/services/mgmt/recoveryservicesbackup/src/package_preview_2022_09/mod.rs index 5497b7acd9..bdd8f8b773 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_preview_2022_09/mod.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_preview_2022_09/mod.rs @@ -1284,7 +1284,7 @@ pub mod feature_support { &self, azure_region: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> validate::RequestBuilder { validate::RequestBuilder { client: self.0.clone(), @@ -1348,7 +1348,7 @@ pub mod feature_support { pub(crate) client: super::super::Client, pub(crate) azure_region: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::FeatureSupportRequest, + pub(crate) parameters: models::FeatureSupportRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3560,9 +3560,9 @@ pub mod bms_prepare_data_move_operation_result { #[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::VaultStorageConfigOperationResultResponse = serde_json::from_slice(&bytes)?; + let body: models::VaultStorageConfigOperationResultResponseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3642,8 +3642,8 @@ pub mod bms_prepare_data_move_operation_result { } } 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`."] @@ -6381,7 +6381,7 @@ pub mod operation { vault_name: impl Into, resource_group_name: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> validate::RequestBuilder { validate::RequestBuilder { client: self.0.clone(), @@ -6447,7 +6447,7 @@ pub mod operation { pub(crate) vault_name: String, pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::ValidateOperationRequest, + pub(crate) parameters: models::ValidateOperationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6523,7 +6523,7 @@ pub mod validate_operation { vault_name: impl Into, resource_group_name: impl Into, subscription_id: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> trigger::RequestBuilder { trigger::RequestBuilder { client: self.0.clone(), @@ -6583,7 +6583,7 @@ pub mod validate_operation { pub(crate) vault_name: String, pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) parameters: models::ValidateOperationRequest, + pub(crate) parameters: models::ValidateOperationRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/recoveryservicesbackup/src/package_preview_2022_09/models.rs b/services/mgmt/recoveryservicesbackup/src/package_preview_2022_09/models.rs index c7f8c045d0..0e99219478 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_preview_2022_09/models.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_preview_2022_09/models.rs @@ -131,10 +131,10 @@ pub struct AzureFileShareProtectionPolicy { pub work_load_type: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "TimeZone optional input as string. For example: TimeZone = \"Pacific Standard Time\"."] #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] pub time_zone: Option, @@ -1020,10 +1020,10 @@ pub struct AzureIaaSvmProtectionPolicy { pub instant_rp_details: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "Tiering policy to automatically move RPs to another tier\r\nKey is Target Tier, defined in RecoveryPointTierType enum.\r\nTiering policy specifies the criteria to move RP to the target tier."] #[serde(rename = "tieringPolicy", default, skip_serializing_if = "Option::is_none")] pub tiering_policy: Option, @@ -1240,7 +1240,7 @@ pub struct AzureSqlProtectionPolicy { pub protection_policy: ProtectionPolicy, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl AzureSqlProtectionPolicy { pub fn new(protection_policy: ProtectionPolicy) -> Self { @@ -4304,6 +4304,12 @@ pub mod backup_engine_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "backupEngineType")] +pub enum BackupEngineBaseUnion { + AzureBackupServerEngine(AzureBackupServerEngine), + DpmBackupEngine(DpmBackupEngine), +} #[doc = "The base backup engine class. All workload specific backup engines derive from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupEngineBaseResource { @@ -4311,7 +4317,7 @@ pub struct BackupEngineBaseResource { pub resource: Resource, #[doc = "The base backup engine class. All workload specific backup engines derive from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BackupEngineBaseResource { pub fn new() -> Self { @@ -4484,6 +4490,14 @@ impl BackupRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum BackupRequestUnion { + AzureFileShareBackupRequest(AzureFileShareBackupRequest), + AzureWorkloadBackupRequest(AzureWorkloadBackupRequest), + #[serde(rename = "IaasVMBackupRequest")] + IaasVmBackupRequest(IaasVmBackupRequest), +} #[doc = "Base class for backup request. Workload-specific backup requests are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupRequestResource { @@ -4491,7 +4505,7 @@ pub struct BackupRequestResource { pub resource: Resource, #[doc = "Base class for backup request. Workload-specific backup requests are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl BackupRequestResource { pub fn new() -> Self { @@ -6172,6 +6186,13 @@ impl FeatureSupportRequest { Self { feature_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "featureType")] +pub enum FeatureSupportRequestUnion { + AzureBackupGoals(AzureBackupGoalFeatureSupportRequest), + #[serde(rename = "AzureVMResourceBackup")] + AzureVmResourceBackup(AzureVmResourceFeatureSupportRequest), +} #[doc = "Base class for generic container of backup items"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GenericContainer { @@ -6397,6 +6418,14 @@ impl IlrRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum IlrRequestUnion { + #[serde(rename = "AzureFileShareProvisionILRRequest")] + AzureFileShareProvisionIlrRequest(AzureFileShareProvisionIlrRequest), + #[serde(rename = "IaasVMILRRegistrationRequest")] + IaasVmilrRegistrationRequest(IaasVmilrRegistrationRequest), +} #[doc = "Parameters to Provision ILR API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IlrRequestResource { @@ -6404,7 +6433,7 @@ pub struct IlrRequestResource { pub resource: Resource, #[doc = "Parameters to Provision ILR API."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl IlrRequestResource { pub fn new() -> Self { @@ -6953,6 +6982,19 @@ pub mod job { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobType")] +pub enum JobUnion { + #[serde(rename = "AzureIaaSVMJob")] + AzureIaaSvmJob(AzureIaaSvmJob), + #[serde(rename = "AzureIaaSVMJobV2")] + AzureIaaSvmJobV2(AzureIaaSvmJobV2), + AzureStorageJob(AzureStorageJob), + AzureWorkloadJob(AzureWorkloadJob), + DpmJob(DpmJob), + MabJob(MabJob), + VaultJob(VaultJob), +} #[doc = "Filters to list the jobs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobQueryObject { @@ -7146,7 +7188,7 @@ pub struct JobResource { pub resource: Resource, #[doc = "Defines workload agnostic properties for a job."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl JobResource { pub fn new() -> Self { @@ -7860,10 +7902,10 @@ pub struct MabProtectionPolicy { pub protection_policy: ProtectionPolicy, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl MabProtectionPolicy { pub fn new(protection_policy: ProtectionPolicy) -> Self { @@ -8084,6 +8126,12 @@ impl OperationResultInfoBase { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationResultInfoBaseUnion { + ExportJobsOperationResultInfo(ExportJobsOperationResultInfo), + OperationResultInfo(OperationResultInfo), +} #[doc = "Base class for operation result info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationResultInfoBaseResource { @@ -8091,7 +8139,7 @@ pub struct OperationResultInfoBaseResource { pub operation_worker_response: OperationWorkerResponse, #[doc = "Base class for operation result info."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option, + pub operation: Option, } impl OperationResultInfoBaseResource { pub fn new() -> Self { @@ -8121,7 +8169,7 @@ pub struct OperationStatus { pub error: Option, #[doc = "Base class for additional information of operation status."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl OperationStatus { pub fn new() -> Self { @@ -8201,6 +8249,15 @@ impl OperationStatusExtendedInfo { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum OperationStatusExtendedInfoUnion { + OperationStatusJobExtendedInfo(OperationStatusJobExtendedInfo), + OperationStatusJobsExtendedInfo(OperationStatusJobsExtendedInfo), + #[serde(rename = "OperationStatusProvisionILRExtendedInfo")] + OperationStatusProvisionIlrExtendedInfo(OperationStatusProvisionIlrExtendedInfo), + OperationStatusValidateOperationExtendedInfo(OperationStatusValidateOperationExtendedInfo), +} #[doc = "Operation status job extended info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationStatusJobExtendedInfo { @@ -8953,6 +9010,13 @@ pub mod protectable_container { AzureWorkloadContainer, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectableContainerType")] +pub enum ProtectableContainerUnion { + StorageContainer(AzureStorageProtectableContainer), + #[serde(rename = "VMAppContainer")] + VmAppContainer(AzureVmAppContainerProtectableContainer), +} #[doc = "Protectable Container Class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectableContainerResource { @@ -8960,7 +9024,7 @@ pub struct ProtectableContainerResource { pub resource: Resource, #[doc = "Protectable Container Class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectableContainerResource { pub fn new() -> Self { @@ -9246,6 +9310,20 @@ pub mod protected_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectedItemType")] +pub enum ProtectedItemUnion { + AzureFileShareProtectedItem(AzureFileshareProtectedItem), + #[serde(rename = "AzureIaaSVMProtectedItem")] + AzureIaaSvmProtectedItem(AzureIaaSvmProtectedItem), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(AzureSqlProtectedItem), + AzureVmWorkloadProtectedItem(AzureVmWorkloadProtectedItem), + #[serde(rename = "DPMProtectedItem")] + DpmProtectedItem(DpmProtectedItem), + GenericProtectedItem(GenericProtectedItem), + MabFileFolderProtectedItem(MabFileFolderProtectedItem), +} #[doc = "Filters to list backup items."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectedItemQueryObject { @@ -9459,7 +9537,7 @@ pub struct ProtectedItemResource { pub resource: Resource, #[doc = "Base class for backup items."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectedItemResource { pub fn new() -> Self { @@ -9662,6 +9740,19 @@ pub mod protection_container { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "containerType")] +pub enum ProtectionContainerUnion { + AzureSqlContainer(AzureSqlContainer), + StorageContainer(AzureStorageContainer), + AzureWorkloadContainer(AzureWorkloadContainer), + #[serde(rename = "DPMContainer")] + DpmContainer(DpmContainer), + GenericContainer(GenericContainer), + #[serde(rename = "IaasVMContainer")] + IaasVmContainer(IaaSvmContainer), + Windows(MabContainer), +} #[doc = "Base class for container with backup items. Containers with specific workloads are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionContainerResource { @@ -9669,7 +9760,7 @@ pub struct ProtectionContainerResource { pub resource: Resource, #[doc = "Base class for container with backup items. Containers with specific workloads are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionContainerResource { pub fn new() -> Self { @@ -9888,6 +9979,13 @@ pub mod protection_intent { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectionIntentItemType")] +pub enum ProtectionIntentUnion { + RecoveryServiceVaultItem(AzureRecoveryServiceVaultProtectionIntent), + AzureResourceItem(AzureResourceProtectionIntent), + AzureWorkloadContainerAutoProtectionIntent(AzureWorkloadContainerAutoProtectionIntent), +} #[doc = "Filters to list protection intent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionIntentQueryObject { @@ -10014,7 +10112,7 @@ pub struct ProtectionIntentResource { pub resource: Resource, #[doc = "Base class for backup ProtectionIntent."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionIntentResource { pub fn new() -> Self { @@ -10072,6 +10170,18 @@ impl ProtectionPolicy { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "backupManagementType")] +pub enum ProtectionPolicyUnion { + AzureStorage(AzureFileShareProtectionPolicy), + #[serde(rename = "AzureIaasVM")] + AzureIaasVm(AzureIaaSvmProtectionPolicy), + AzureSql(AzureSqlProtectionPolicy), + AzureWorkload(AzureVmWorkloadProtectionPolicy), + GenericProtectionPolicy(GenericProtectionPolicy), + #[serde(rename = "MAB")] + Mab(MabProtectionPolicy), +} #[doc = "Filters the list backup policies API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionPolicyQueryObject { @@ -10226,7 +10336,7 @@ pub struct ProtectionPolicyResource { pub resource: Resource, #[doc = "Base class for backup policy. Workload-specific backup policies are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ProtectionPolicyResource { pub fn new() -> Self { @@ -10269,6 +10379,15 @@ impl RecoveryPoint { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RecoveryPointUnion { + AzureFileShareRecoveryPoint(AzureFileShareRecoveryPoint), + AzureWorkloadRecoveryPoint(AzureWorkloadRecoveryPoint), + GenericRecoveryPoint(GenericRecoveryPoint), + #[serde(rename = "IaasVMRecoveryPoint")] + IaasVmRecoveryPoint(IaasVmRecoveryPoint), +} #[doc = "Disk configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPointDiskConfiguration { @@ -10374,7 +10493,7 @@ pub struct RecoveryPointResource { pub resource: Resource, #[doc = "Base class for backup copies. Workload-specific backup copies are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl RecoveryPointResource { pub fn new() -> Self { @@ -10716,6 +10835,14 @@ impl RestoreRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum RestoreRequestUnion { + AzureFileShareRestoreRequest(AzureFileShareRestoreRequest), + AzureWorkloadRestoreRequest(AzureWorkloadRestoreRequest), + #[serde(rename = "IaasVMRestoreRequest")] + IaasVmRestoreRequest(IaasVmRestoreRequest), +} #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestoreRequestResource { @@ -10723,7 +10850,7 @@ pub struct RestoreRequestResource { pub resource: Resource, #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl RestoreRequestResource { pub fn new() -> Self { @@ -10803,6 +10930,12 @@ impl RetentionPolicy { Self { retention_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "retentionPolicyType")] +pub enum RetentionPolicyUnion { + LongTermRetentionPolicy(LongTermRetentionPolicy), + SimpleRetentionPolicy(SimpleRetentionPolicy), +} #[doc = "SQLDataDirectory info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SqlDataDirectory { @@ -10938,6 +11071,14 @@ impl SchedulePolicy { Self { schedule_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "schedulePolicyType")] +pub enum SchedulePolicyUnion { + LogSchedulePolicy(LogSchedulePolicy), + LongTermSchedulePolicy(LongTermSchedulePolicy), + SimpleSchedulePolicy(SimpleSchedulePolicy), + SimpleSchedulePolicyV2(SimpleSchedulePolicyV2), +} #[doc = "Base class for get security pin request body"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityPinBase { @@ -11154,10 +11295,10 @@ pub struct SubProtectionPolicy { pub policy_type: Option, #[doc = "Base class for backup schedule."] #[serde(rename = "schedulePolicy", default, skip_serializing_if = "Option::is_none")] - pub schedule_policy: Option, + pub schedule_policy: Option, #[doc = "Base class for retention policy."] #[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, #[doc = "Tiering policy to automatically move RPs to another tier.\r\nKey is Target Tier, defined in RecoveryPointTierType enum.\r\nTiering policy specifies the criteria to move RP to the target tier."] #[serde(rename = "tieringPolicy", default, skip_serializing_if = "Option::is_none")] pub tiering_policy: Option, @@ -11561,6 +11702,11 @@ impl ValidateOperationRequest { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum ValidateOperationRequestUnion { + ValidateRestoreOperationRequest(ValidateRestoreOperationRequest), +} #[doc = "Base class for validate operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidateOperationResponse { @@ -11596,7 +11742,7 @@ pub struct ValidateRestoreOperationRequest { pub validate_operation_request: ValidateOperationRequest, #[doc = "Base class for restore request. Workload-specific restore requests are derived from this class."] #[serde(rename = "restoreRequest", default, skip_serializing_if = "Option::is_none")] - pub restore_request: Option, + pub restore_request: Option, } impl ValidateRestoreOperationRequest { pub fn new(validate_operation_request: ValidateOperationRequest) -> Self { @@ -11691,6 +11837,11 @@ impl VaultStorageConfigOperationResultResponse { Self { object_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum VaultStorageConfigOperationResultResponseUnion { + PrepareDataMoveResponse(PrepareDataMoveResponse), +} #[doc = "Weekly retention format."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WeeklyRetentionFormat { @@ -11861,6 +12012,11 @@ pub mod workload_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "workloadItemType")] +pub enum WorkloadItemUnion { + AzureVmWorkloadItem(AzureVmWorkloadItem), +} #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadItemResource { @@ -11868,7 +12024,7 @@ pub struct WorkloadItemResource { pub resource: Resource, #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadItemResource { pub fn new() -> Self { @@ -11975,6 +12131,14 @@ pub mod workload_protectable_item { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "protectableItemType")] +pub enum WorkloadProtectableItemUnion { + AzureFileShare(AzureFileShareProtectableItem), + AzureVmWorkloadProtectableItem(AzureVmWorkloadProtectableItem), + #[serde(rename = "IaaSVMProtectableItem")] + IaaSvmProtectableItem(IaaSvmProtectableItem), +} #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadProtectableItemResource { @@ -11982,7 +12146,7 @@ pub struct WorkloadProtectableItemResource { pub resource: Resource, #[doc = "Base class for backup item. Workload-specific backup items are derived from this class."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadProtectableItemResource { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservicesdatareplication/src/package_2021_02_16_preview/models.rs b/services/mgmt/recoveryservicesdatareplication/src/package_2021_02_16_preview/models.rs index 076d061ea6..03cd615223 100644 --- a/services/mgmt/recoveryservicesdatareplication/src/package_2021_02_16_preview/models.rs +++ b/services/mgmt/recoveryservicesdatareplication/src/package_2021_02_16_preview/models.rs @@ -219,6 +219,11 @@ impl DraModelCustomProperties { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum DraModelCustomPropertiesUnion { + VMware(VMwareDraModelCustomProperties), +} #[doc = "Dra model properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DraModelProperties { @@ -259,7 +264,7 @@ pub struct DraModelProperties { pub health_errors: Vec, #[doc = "Dra model custom properties."] #[serde(rename = "customProperties")] - pub custom_properties: DraModelCustomProperties, + pub custom_properties: DraModelCustomPropertiesUnion, } impl DraModelProperties { pub fn new( @@ -267,7 +272,7 @@ impl DraModelProperties { machine_name: String, authentication_identity: IdentityModel, resource_access_identity: IdentityModel, - custom_properties: DraModelCustomProperties, + custom_properties: DraModelCustomPropertiesUnion, ) -> Self { Self { correlation_id: None, @@ -575,6 +580,12 @@ impl EventModelCustomProperties { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventModelCustomPropertiesUnion { + #[serde(rename = "HyperVToAzStackHCI")] + HyperVToAzStackHci(HyperVToAzStackHciEventModelCustomProperties), +} #[doc = "Event model properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventModelProperties { @@ -612,10 +623,10 @@ pub struct EventModelProperties { pub health_errors: Vec, #[doc = "Event model custom properties."] #[serde(rename = "customProperties")] - pub custom_properties: EventModelCustomProperties, + pub custom_properties: EventModelCustomPropertiesUnion, } impl EventModelProperties { - pub fn new(custom_properties: EventModelCustomProperties) -> Self { + pub fn new(custom_properties: EventModelCustomPropertiesUnion) -> Self { Self { resource_type: None, resource_name: None, @@ -702,6 +713,14 @@ impl FabricModelCustomProperties { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricModelCustomPropertiesUnion { + #[serde(rename = "AzStackHCI")] + AzStackHci(AzStackHciFabricModelCustomProperties), + HyperVMigrate(HyperVMigrateFabricModelCustomProperties), + VMwareMigrate(VMwareMigrateFabricModelCustomProperties), +} #[doc = "Fabric model properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricModelProperties { @@ -727,10 +746,10 @@ pub struct FabricModelProperties { pub health_errors: Vec, #[doc = "Fabric model custom properties."] #[serde(rename = "customProperties")] - pub custom_properties: FabricModelCustomProperties, + pub custom_properties: FabricModelCustomPropertiesUnion, } impl FabricModelProperties { - pub fn new(custom_properties: FabricModelCustomProperties) -> Self { + pub fn new(custom_properties: FabricModelCustomPropertiesUnion) -> Self { Self { provisioning_state: None, service_endpoint: None, @@ -1981,15 +2000,23 @@ impl PlannedFailoverModelCustomProperties { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PlannedFailoverModelCustomPropertiesUnion { + #[serde(rename = "HyperVToAzStackHCI")] + HyperVToAzStackHci(HyperVToAzStackHciPlannedFailoverModelCustomProperties), + #[serde(rename = "VMwareToAzStackHCI")] + VMwareToAzStackHci(VMwareToAzStackHciPlannedFailoverModelCustomProperties), +} #[doc = "Planned failover model properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PlannedFailoverModelProperties { #[doc = "Planned failover model custom properties."] #[serde(rename = "customProperties")] - pub custom_properties: PlannedFailoverModelCustomProperties, + pub custom_properties: PlannedFailoverModelCustomPropertiesUnion, } impl PlannedFailoverModelProperties { - pub fn new(custom_properties: PlannedFailoverModelCustomProperties) -> Self { + pub fn new(custom_properties: PlannedFailoverModelCustomPropertiesUnion) -> Self { Self { custom_properties } } } @@ -2058,6 +2085,14 @@ impl PolicyModelCustomProperties { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyModelCustomPropertiesUnion { + #[serde(rename = "HyperVToAzStackHCI")] + HyperVToAzStackHci(HyperVToAzStackHciPolicyModelCustomProperties), + #[serde(rename = "VMwareToAzStackHCI")] + VMwareToAzStackHci(VMwareToAzStackHciPolicyModelCustomProperties), +} #[doc = "Policy model properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyModelProperties { @@ -2066,10 +2101,10 @@ pub struct PolicyModelProperties { pub provisioning_state: Option, #[doc = "Policy model custom properties."] #[serde(rename = "customProperties")] - pub custom_properties: PolicyModelCustomProperties, + pub custom_properties: PolicyModelCustomPropertiesUnion, } impl PolicyModelProperties { - pub fn new(custom_properties: PolicyModelCustomProperties) -> Self { + pub fn new(custom_properties: PolicyModelCustomPropertiesUnion) -> Self { Self { provisioning_state: None, custom_properties, @@ -2243,6 +2278,14 @@ impl ProtectedItemModelCustomProperties { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProtectedItemModelCustomPropertiesUnion { + #[serde(rename = "HyperVToAzStackHCI")] + HyperVToAzStackHci(HyperVToAzStackHciProtectedItemModelCustomProperties), + #[serde(rename = "VMwareToAzStackHCI")] + VMwareToAzStackHci(VMwareToAzStackHciProtectedItemModelCustomProperties), +} #[doc = "Protected item model properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProtectedItemModelProperties { @@ -2342,10 +2385,14 @@ pub struct ProtectedItemModelProperties { pub health_errors: Vec, #[doc = "Protected item model custom properties."] #[serde(rename = "customProperties")] - pub custom_properties: ProtectedItemModelCustomProperties, + pub custom_properties: ProtectedItemModelCustomPropertiesUnion, } impl ProtectedItemModelProperties { - pub fn new(policy_name: String, replication_extension_name: String, custom_properties: ProtectedItemModelCustomProperties) -> Self { + pub fn new( + policy_name: String, + replication_extension_name: String, + custom_properties: ProtectedItemModelCustomPropertiesUnion, + ) -> Self { Self { policy_name, replication_extension_name, @@ -2826,6 +2873,12 @@ impl RecoveryPointModelCustomProperties { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPointModelCustomPropertiesUnion { + #[serde(rename = "HyperVToAzStackHCI")] + HyperVToAzStackHci(HyperVToAzStackHciRecoveryPointModelCustomProperties), +} #[doc = "Recovery point model properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPointModelProperties { @@ -2837,13 +2890,13 @@ pub struct RecoveryPointModelProperties { pub recovery_point_type: recovery_point_model_properties::RecoveryPointType, #[doc = "Recovery point model custom properties."] #[serde(rename = "customProperties")] - pub custom_properties: RecoveryPointModelCustomProperties, + pub custom_properties: RecoveryPointModelCustomPropertiesUnion, } impl RecoveryPointModelProperties { pub fn new( recovery_point_time: time::OffsetDateTime, recovery_point_type: recovery_point_model_properties::RecoveryPointType, - custom_properties: RecoveryPointModelCustomProperties, + custom_properties: RecoveryPointModelCustomPropertiesUnion, ) -> Self { Self { recovery_point_time, @@ -2957,6 +3010,14 @@ impl ReplicationExtensionModelCustomProperties { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationExtensionModelCustomPropertiesUnion { + #[serde(rename = "HyperVToAzStackHCI")] + HyperVToAzStackHci(HyperVToAzStackHciReplicationExtensionModelCustomProperties), + #[serde(rename = "VMwareToAzStackHCI")] + VMwareToAzStackHci(VMwareToAzStackHciReplicationExtensionModelCustomProperties), +} #[doc = "Replication extension model properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationExtensionModelProperties { @@ -2965,10 +3026,10 @@ pub struct ReplicationExtensionModelProperties { pub provisioning_state: Option, #[doc = "Replication extension model custom properties."] #[serde(rename = "customProperties")] - pub custom_properties: ReplicationExtensionModelCustomProperties, + pub custom_properties: ReplicationExtensionModelCustomPropertiesUnion, } impl ReplicationExtensionModelProperties { - pub fn new(custom_properties: ReplicationExtensionModelCustomProperties) -> Self { + pub fn new(custom_properties: ReplicationExtensionModelCustomPropertiesUnion) -> Self { Self { provisioning_state: None, custom_properties, @@ -4179,6 +4240,13 @@ impl WorkflowModelCustomProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum WorkflowModelCustomPropertiesUnion { + FailoverWorkflowDetails(FailoverWorkflowModelCustomProperties), + TestFailoverCleanupWorkflowDetails(TestFailoverCleanupWorkflowModelCustomProperties), + TestFailoverWorkflowDetails(TestFailoverWorkflowModelCustomProperties), +} #[doc = "Workflow model properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkflowModelProperties { @@ -4245,10 +4313,10 @@ pub struct WorkflowModelProperties { pub errors: Vec, #[doc = "Workflow model custom properties."] #[serde(rename = "customProperties")] - pub custom_properties: WorkflowModelCustomProperties, + pub custom_properties: WorkflowModelCustomPropertiesUnion, } impl WorkflowModelProperties { - pub fn new(custom_properties: WorkflowModelCustomProperties) -> Self { + pub fn new(custom_properties: WorkflowModelCustomPropertiesUnion) -> Self { Self { display_name: None, state: None, diff --git a/services/mgmt/recoveryservicessiterecovery/src/package_2022_10/models.rs b/services/mgmt/recoveryservicessiterecovery/src/package_2022_10/models.rs index fc971ea617..348ebea808 100644 --- a/services/mgmt/recoveryservicessiterecovery/src/package_2022_10/models.rs +++ b/services/mgmt/recoveryservicessiterecovery/src/package_2022_10/models.rs @@ -191,7 +191,7 @@ pub struct A2aCreateProtectionIntentInput { pub recovery_availability_type: a2a_create_protection_intent_input::RecoveryAvailabilityType, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfileCustomInput", default, skip_serializing_if = "Option::is_none")] - pub protection_profile_custom_input: Option, + pub protection_profile_custom_input: Option, #[doc = "The recovery resource group Id. Valid for V2 scenarios."] #[serde(rename = "recoveryResourceGroupId")] pub recovery_resource_group_id: String, @@ -201,20 +201,20 @@ pub struct A2aCreateProtectionIntentInput { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySetCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set_custom_input: Option, + pub recovery_availability_set_custom_input: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetworkCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network_custom_input: Option, + pub recovery_virtual_network_custom_input: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde( rename = "recoveryProximityPlacementGroupCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub recovery_proximity_placement_group_custom_input: Option, + pub recovery_proximity_placement_group_custom_input: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -242,7 +242,7 @@ pub struct A2aCreateProtectionIntentInput { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -1123,14 +1123,14 @@ pub struct A2aProtectionIntentDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub recovery_azure_storage_account_custom_input: Option, + pub recovery_azure_storage_account_custom_input: Option, #[doc = "Storage account custom input."] #[serde( rename = "primaryStagingStorageAccountCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, } impl A2aProtectionIntentDiskInputDetails { pub fn new(disk_uri: String) -> Self { @@ -1153,10 +1153,10 @@ pub struct A2aProtectionIntentManagedDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Resource Group custom input."] #[serde(rename = "recoveryResourceGroupCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_resource_group_custom_input: Option, + pub recovery_resource_group_custom_input: Option, #[doc = "The replica disk type. Its an optional value and will be same as source disk type if not user provided."] #[serde(rename = "recoveryReplicaDiskAccountType", default, skip_serializing_if = "Option::is_none")] pub recovery_replica_disk_account_type: Option, @@ -1684,19 +1684,19 @@ pub struct A2aReplicationIntentDetails { pub recovery_resource_group_id: Option, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfile", default, skip_serializing_if = "Option::is_none")] - pub protection_profile: Option, + pub protection_profile: Option, #[doc = "Storage account custom input."] #[serde(rename = "primaryStagingStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub primary_staging_storage_account: Option, + pub primary_staging_storage_account: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySet", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set: Option, + pub recovery_availability_set: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetwork", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network: Option, + pub recovery_virtual_network: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde(rename = "recoveryProximityPlacementGroup", default, skip_serializing_if = "Option::is_none")] - pub recovery_proximity_placement_group: Option, + pub recovery_proximity_placement_group: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -1708,7 +1708,7 @@ pub struct A2aReplicationIntentDetails { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -2399,10 +2399,10 @@ pub struct AsrTask { pub task_type: Option, #[doc = "Task details based on specific task type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "This class represents the group task details when parent child relationship exists in the drill down."] #[serde(rename = "groupTaskCustomDetails", default, skip_serializing_if = "Option::is_none")] - pub group_task_custom_details: Option, + pub group_task_custom_details: Option, #[doc = "The task error details."] #[serde( default, @@ -2433,10 +2433,10 @@ impl AddDisksInput { pub struct AddDisksInputProperties { #[doc = "Add Disks provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: AddDisksProviderSpecificInput, + pub provider_specific_details: AddDisksProviderSpecificInputUnion, } impl AddDisksInputProperties { - pub fn new(provider_specific_details: AddDisksProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: AddDisksProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -2452,6 +2452,12 @@ impl AddDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum AddDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aAddDisksInput), +} #[doc = "Input required to add a provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddRecoveryServicesProviderInput { @@ -2700,6 +2706,11 @@ impl ApplianceSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplianceSpecificDetailsUnion { + InMageRcm(InMageRcmApplianceSpecificDetails), +} #[doc = "Input to apply recovery point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplyRecoveryPointInput { @@ -2719,10 +2730,10 @@ pub struct ApplyRecoveryPointInputProperties { pub recovery_point_id: Option, #[doc = "Provider specific input for apply recovery point."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ApplyRecoveryPointProviderSpecificInput, + pub provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion, } impl ApplyRecoveryPointInputProperties { - pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion) -> Self { Self { recovery_point_id: None, provider_specific_details, @@ -2741,6 +2752,17 @@ impl ApplyRecoveryPointProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplyRecoveryPointProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aApplyRecoveryPointInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationApplyRecoveryPointInput), + HyperVReplicaAzure(HyperVReplicaAzureApplyRecoveryPointInput), + InMageAzureV2(InMageAzureV2ApplyRecoveryPointInput), + InMageRcm(InMageRcmApplyRecoveryPointInput), +} #[doc = "This class represents job details based on specific job type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AsrJobDetails { @@ -3002,6 +3024,13 @@ impl ConfigurationSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ConfigurationSettingsUnion { + HyperVVirtualMachine(HyperVVirtualMachineDetails), + ReplicationGroupDetails(ReplicationGroupDetails), + VMwareVirtualMachine(VMwareVirtualMachineDetails), +} #[doc = "Request to configure alerts for the system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConfigureAlertRequest { @@ -3081,7 +3110,7 @@ pub struct CreateNetworkMappingInputProperties { pub recovery_network_id: String, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl CreateNetworkMappingInputProperties { pub fn new(recovery_network_id: String) -> Self { @@ -3109,7 +3138,7 @@ impl CreatePolicyInput { pub struct CreatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreatePolicyInputProperties { pub fn new() -> Self { @@ -3138,7 +3167,7 @@ pub struct CreateProtectionContainerInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateProtectionContainerInputProperties { pub fn new() -> Self { @@ -3168,7 +3197,7 @@ pub struct CreateProtectionContainerMappingInputProperties { pub policy_id: Option, #[doc = "Provider specific input for pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -3192,7 +3221,7 @@ impl CreateProtectionIntentInput { pub struct CreateProtectionIntentProperties { #[doc = "Create protection intent provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl CreateProtectionIntentProperties { pub fn new() -> Self { @@ -3211,6 +3240,12 @@ impl CreateProtectionIntentProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum CreateProtectionIntentProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aCreateProtectionIntentInput), +} #[doc = "Create recovery plan input class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateRecoveryPlanInput { @@ -3243,7 +3278,7 @@ pub struct CreateRecoveryPlanInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateRecoveryPlanInputProperties { pub fn new(primary_fabric_id: String, recovery_fabric_id: String, groups: Vec) -> Self { @@ -3398,7 +3433,7 @@ pub struct DisableProtectionInputProperties { pub disable_protection_reason: Option, #[doc = "Disable protection provider specific input."] #[serde(rename = "replicationProviderInput", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_input: Option, + pub replication_provider_input: Option, } impl DisableProtectionInputProperties { pub fn new() -> Self { @@ -3457,6 +3492,11 @@ impl DisableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum DisableProtectionProviderSpecificInputUnion { + InMage(InMageDisableProtectionProviderSpecificInput), +} #[doc = "Request to add a physical machine as a protectable item in a container."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiscoverProtectableItemRequest { @@ -3678,10 +3718,10 @@ pub struct EnableMigrationInputProperties { pub policy_id: String, #[doc = "Enable migration provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: EnableMigrationProviderSpecificInput, + pub provider_specific_details: EnableMigrationProviderSpecificInputUnion, } impl EnableMigrationInputProperties { - pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInput) -> Self { + pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInputUnion) -> Self { Self { policy_id, provider_specific_details, @@ -3700,6 +3740,11 @@ impl EnableMigrationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableMigrationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtEnableMigrationInput), +} #[doc = "Enable protection input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnableProtectionInput { @@ -3723,7 +3768,7 @@ pub struct EnableProtectionInputProperties { pub protectable_item_id: Option, #[doc = "Enable protection provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl EnableProtectionInputProperties { pub fn new() -> Self { @@ -3742,6 +3787,18 @@ impl EnableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableProtectionProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationEnableProtectionInput), + #[serde(rename = "A2A")] + A2a(A2aEnableProtectionInput), + HyperVReplicaAzure(HyperVReplicaAzureEnableProtectionInput), + InMageAzureV2(InMageAzureV2EnableProtectionInput), + InMage(InMageEnableProtectionInput), + InMageRcm(InMageRcmEnableProtectionInput), +} #[doc = "Encryption details for the fabric."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EncryptionDetails { @@ -3828,10 +3885,10 @@ pub struct EventProperties { pub fabric_id: Option, #[doc = "Model class for provider specific details for an event."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Model class for event specific details for an event."] #[serde(rename = "eventSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub event_specific_details: Option, + pub event_specific_details: Option, #[doc = "The list of errors / warnings capturing details associated with the issue(s)."] #[serde( rename = "healthErrors", @@ -3858,6 +3915,20 @@ impl EventProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aEventDetails), + HyperVReplica2012(HyperVReplica2012EventDetails), + HyperVReplica2012R2(HyperVReplica2012R2EventDetails), + HyperVReplicaAzure(HyperVReplicaAzureEventDetails), + HyperVReplicaBaseEventDetails(HyperVReplicaBaseEventDetails), + InMageAzureV2(InMageAzureV2EventDetails), + InMageRcm(InMageRcmEventDetails), + InMageRcmFailback(InMageRcmFailbackEventDetails), + VMwareCbt(VMwareCbtEventDetails), +} #[doc = "Implements the event query parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventQueryParameter { @@ -3903,6 +3974,11 @@ impl EventSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventSpecificDetailsUnion { + JobStatus(JobStatusEventDetails), +} #[doc = "Existing storage account input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExistingProtectionProfile { @@ -4138,7 +4214,7 @@ impl FabricCreationInput { pub struct FabricCreationInputProperties { #[doc = "Fabric provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl FabricCreationInputProperties { pub fn new() -> Self { @@ -4165,7 +4241,7 @@ pub struct FabricProperties { pub bcdr_state: Option, #[doc = "Fabric specific details."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "Fabric health error details."] #[serde( rename = "healthErrorDetails", @@ -4243,6 +4319,13 @@ impl FabricSpecificCreateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureCreateNetworkMappingInput), + VmmToAzure(VmmToAzureCreateNetworkMappingInput), + VmmToVmm(VmmToVmmCreateNetworkMappingInput), +} #[doc = "Fabric provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificCreationInput { @@ -4255,6 +4338,13 @@ impl FabricSpecificCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreationInputUnion { + Azure(AzureFabricCreationInput), + InMageRcm(InMageRcmFabricCreationInput), + VMwareV2(VMwareV2FabricCreationInput), +} #[doc = "Fabric specific details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificDetails { @@ -4267,6 +4357,17 @@ impl FabricSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificDetailsUnion { + Azure(AzureFabricSpecificDetails), + HyperVSite(HyperVSiteDetails), + InMageRcm(InMageRcmFabricSpecificDetails), + VMware(VMwareDetails), + VMwareV2(VMwareV2FabricSpecificDetails), + #[serde(rename = "VMM")] + Vmm(VmmDetails), +} #[doc = "Input details specific to fabrics during Network Mapping."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificUpdateNetworkMappingInput { @@ -4279,6 +4380,13 @@ impl FabricSpecificUpdateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificUpdateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureUpdateNetworkMappingInput), + VmmToAzure(VmmToAzureUpdateNetworkMappingInput), + VmmToVmm(VmmToVmmUpdateNetworkMappingInput), +} #[doc = "This class represents the details for a failover job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FailoverJobDetails { @@ -4401,6 +4509,12 @@ impl GroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum GroupTaskDetailsUnion { + InlineWorkflowTaskDetails(InlineWorkflowTaskDetails), + RecoveryPlanGroupTaskDetails(RecoveryPlanGroupTaskDetails), +} #[doc = "Health Error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HealthError { @@ -5980,6 +6094,11 @@ impl HyperVReplicaPolicyInput { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVReplicaPolicyInputUnion { + HyperVReplica2012R2(HyperVReplicaBluePolicyInput), +} #[doc = "HyperV replica 2012 replication details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HyperVReplicaReplicationDetails { @@ -6223,6 +6342,11 @@ pub mod hyper_v_virtual_machine_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVVirtualMachineDetailsUnion { + VmmVirtualMachine(VmmVirtualMachineDetails), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IpConfigDetails { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -11105,6 +11229,15 @@ impl JobDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobDetailsUnion { + AsrJobDetails(AsrJobDetails), + ExportJobDetails(ExportJobDetails), + FailoverJobDetails(FailoverJobDetails), + SwitchProtectionJobDetails(SwitchProtectionJobDetails), + TestFailoverJobDetails(TestFailoverJobDetails), +} #[doc = "This class contains the minimal job details required to navigate to the desired drill down."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobEntity { @@ -11213,7 +11346,7 @@ pub struct JobProperties { pub target_instance_type: Option, #[doc = "Job details based on specific job type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl JobProperties { pub fn new() -> Self { @@ -11341,6 +11474,12 @@ impl JobTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobTaskDetailsUnion { + FabricReplicationGroupTaskDetails(FabricReplicationGroupTaskDetails), + VirtualMachineTaskDetails(VirtualMachineTaskDetails), +} #[doc = "Key Encryption Key (KEK) information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KeyEncryptionKeyInfo { @@ -11625,10 +11764,10 @@ impl MigrateInput { pub struct MigrateInputProperties { #[doc = "Migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: MigrateProviderSpecificInput, + pub provider_specific_details: MigrateProviderSpecificInputUnion, } impl MigrateInputProperties { - pub fn new(provider_specific_details: MigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: MigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -11644,6 +11783,11 @@ impl MigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtMigrateInput), +} #[doc = "Migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationItem { @@ -11760,7 +11904,7 @@ pub struct MigrationItemProperties { pub event_correlation_id: Option, #[doc = "Migration provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl MigrationItemProperties { pub fn new() -> Self { @@ -11965,6 +12109,11 @@ impl MigrationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrationProviderSpecificSettingsUnion { + VMwareCbt(VMwareCbtMigrationDetails), +} #[doc = "Recovery point for a migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationRecoveryPoint { @@ -12169,6 +12318,13 @@ impl NetworkMappingFabricSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum NetworkMappingFabricSpecificSettingsUnion { + AzureToAzure(AzureToAzureNetworkMappingSettings), + VmmToAzure(VmmToAzureNetworkMappingSettings), + VmmToVmm(VmmToVmmNetworkMappingSettings), +} #[doc = "Network Mapping Properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NetworkMappingProperties { @@ -12198,7 +12354,7 @@ pub struct NetworkMappingProperties { pub recovery_fabric_friendly_name: Option, #[doc = "Network Mapping fabric specific settings."] #[serde(rename = "fabricSpecificSettings", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_settings: Option, + pub fabric_specific_settings: Option, } impl NetworkMappingProperties { pub fn new() -> Self { @@ -12489,7 +12645,7 @@ pub struct PlannedFailoverInputProperties { pub failover_direction: Option, #[doc = "Provider specific failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PlannedFailoverInputProperties { pub fn new() -> Self { @@ -12508,6 +12664,13 @@ impl PlannedFailoverProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PlannedFailoverProviderSpecificFailoverInputUnion { + HyperVReplicaAzureFailback(HyperVReplicaAzureFailbackProviderInput), + HyperVReplicaAzure(HyperVReplicaAzurePlannedFailoverProviderInput), + InMageRcmFailback(InMageRcmFailbackPlannedFailoverProviderInput), +} #[doc = "Protection profile details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Policy { @@ -12555,7 +12718,7 @@ pub struct PolicyProperties { pub friendly_name: Option, #[doc = "Base class for Provider specific details for policies."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PolicyProperties { pub fn new() -> Self { @@ -12574,6 +12737,22 @@ impl PolicyProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aPolicyDetails), + HyperVReplicaAzure(HyperVReplicaAzurePolicyDetails), + HyperVReplicaBasePolicyDetails(HyperVReplicaBasePolicyDetails), + HyperVReplica2012R2(HyperVReplicaBluePolicyDetails), + HyperVReplica2012(HyperVReplicaPolicyDetails), + InMageAzureV2(InMageAzureV2PolicyDetails), + InMageBasePolicyDetails(InMageBasePolicyDetails), + InMage(InMagePolicyDetails), + InMageRcmFailback(InMageRcmFailbackPolicyDetails), + InMageRcm(InMageRcmPolicyDetails), + VMwareCbt(VmwareCbtPolicyDetails), +} #[doc = "Base class for provider specific input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyProviderSpecificInput { @@ -12586,6 +12765,21 @@ impl PolicyProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationPolicyCreationInput), + #[serde(rename = "A2A")] + A2a(A2aPolicyCreationInput), + HyperVReplicaAzure(HyperVReplicaAzurePolicyInput), + HyperVReplica2012(HyperVReplicaPolicyInput), + InMageAzureV2(InMageAzureV2PolicyInput), + InMage(InMagePolicyInput), + InMageRcmFailback(InMageRcmFailbackPolicyCreationInput), + InMageRcm(InMageRcmPolicyCreationInput), + VMwareCbt(VMwareCbtPolicyCreationInput), +} #[doc = "Details of the Process Server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessServer { @@ -13225,7 +13419,7 @@ pub struct ProtectableItemProperties { pub supported_replication_providers: Vec, #[doc = "Replication provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl ProtectableItemProperties { pub fn new() -> Self { @@ -13418,7 +13612,7 @@ pub struct ProtectionContainerMappingProperties { pub target_protection_container_friendly_name: Option, #[doc = "Container mapping provider specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Health of pairing."] #[serde(default, skip_serializing_if = "Option::is_none")] pub health: Option, @@ -13466,6 +13660,14 @@ impl ProtectionContainerMappingProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProtectionContainerMappingProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aProtectionContainerMappingDetails), + InMageRcm(InMageRcmProtectionContainerMappingDetails), + VMwareCbt(VMwareCbtProtectionContainerMappingDetails), +} #[doc = "Protection profile custom data details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionContainerProperties { @@ -13508,6 +13710,12 @@ impl ProtectionProfileCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ProtectionProfileCustomDetailsUnion { + Existing(ExistingProtectionProfile), + New(NewProtectionProfile), +} #[doc = "This class contains the error details per object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProviderError { @@ -13544,6 +13752,14 @@ impl ProviderSpecificRecoveryPointDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProviderSpecificRecoveryPointDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aRecoveryPointDetails), + InMageAzureV2(InMageAzureV2RecoveryPointDetails), + InMageRcm(InMageRcmRecoveryPointDetails), +} #[doc = "Push installer details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PushInstallerDetails { @@ -13729,6 +13945,11 @@ impl RecoveryAvailabilitySetCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryAvailabilitySetCustomDetailsUnion { + Existing(ExistingRecoveryAvailabilitySet), +} #[doc = "Recovery plan details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPlan { @@ -13928,14 +14149,14 @@ pub struct RecoveryPlanAction { pub failover_directions: Vec, #[doc = "Recovery plan action custom details."] #[serde(rename = "customDetails")] - pub custom_details: RecoveryPlanActionDetails, + pub custom_details: RecoveryPlanActionDetailsUnion, } impl RecoveryPlanAction { pub fn new( action_name: String, failover_types: Vec, failover_directions: Vec, - custom_details: RecoveryPlanActionDetails, + custom_details: RecoveryPlanActionDetailsUnion, ) -> Self { Self { action_name, @@ -13957,6 +14178,13 @@ impl RecoveryPlanActionDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanActionDetailsUnion { + AutomationRunbookActionDetails(RecoveryPlanAutomationRunbookActionDetails), + ManualActionDetails(RecoveryPlanManualActionDetails), + ScriptActionDetails(RecoveryPlanScriptActionDetails), +} #[doc = "Recovery plan Automation runbook action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanAutomationRunbookActionDetails { @@ -14158,6 +14386,11 @@ impl RecoveryPlanGroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanGroupTaskDetailsUnion { + RecoveryPlanShutdownGroupTaskDetails(RecoveryPlanShutdownGroupTaskDetails), +} #[doc = "Recovery plan HVR Azure failback input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanHyperVReplicaAzureFailbackInput { @@ -14636,7 +14869,7 @@ pub struct RecoveryPlanPlannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanPlannedFailoverInputProperties { pub fn new(failover_direction: recovery_plan_planned_failover_input_properties::FailoverDirection) -> Self { @@ -14755,7 +14988,7 @@ pub struct RecoveryPlanProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanProperties { pub fn new() -> Self { @@ -14789,6 +15022,12 @@ impl RecoveryPlanProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aDetails), +} #[doc = "Recovery plan provider specific failover input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificFailoverInput { @@ -14801,6 +15040,18 @@ impl RecoveryPlanProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificFailoverInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aFailoverInput), + HyperVReplicaAzureFailback(RecoveryPlanHyperVReplicaAzureFailbackInput), + HyperVReplicaAzure(RecoveryPlanHyperVReplicaAzureFailoverInput), + InMageAzureV2(RecoveryPlanInMageAzureV2FailoverInput), + InMage(RecoveryPlanInMageFailoverInput), + InMageRcmFailback(RecoveryPlanInMageRcmFailbackFailoverInput), + InMageRcm(RecoveryPlanInMageRcmFailoverInput), +} #[doc = "Recovery plan provider specific input base class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificInput { @@ -14813,6 +15064,12 @@ impl RecoveryPlanProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aInput), +} #[doc = "Recovery plan script action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanScriptActionDetails { @@ -14947,7 +15204,7 @@ pub struct RecoveryPlanTestFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanTestFailoverInputProperties { pub fn new(failover_direction: recovery_plan_test_failover_input_properties::FailoverDirection, network_type: String) -> Self { @@ -15026,7 +15283,7 @@ pub struct RecoveryPlanUnplannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanUnplannedFailoverInputProperties { pub fn new( @@ -15167,7 +15424,7 @@ pub struct RecoveryPointProperties { pub recovery_point_type: Option, #[doc = "Replication provider specific recovery point details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RecoveryPointProperties { pub fn new() -> Self { @@ -15186,6 +15443,11 @@ impl RecoveryProximityPlacementGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryProximityPlacementGroupCustomDetailsUnion { + Existing(ExistingRecoveryProximityPlacementGroup), +} #[doc = "Recovery Resource Group custom input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryResourceGroupCustomDetails { @@ -15198,6 +15460,11 @@ impl RecoveryResourceGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryResourceGroupCustomDetailsUnion { + Existing(ExistingRecoveryRecoveryResourceGroup), +} #[doc = "Provider details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryServicesProvider { @@ -15332,6 +15599,12 @@ impl RecoveryVirtualNetworkCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryVirtualNetworkCustomDetailsUnion { + Existing(ExistingRecoveryVirtualNetwork), + New(NewRecoveryVirtualNetwork), +} #[doc = "Input for remove disk(s) operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveDisksInput { @@ -15349,7 +15622,7 @@ impl RemoveDisksInput { pub struct RemoveDisksInputProperties { #[doc = "Remove Disk provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RemoveDisksInputProperties { pub fn new() -> Self { @@ -15368,6 +15641,12 @@ impl RemoveDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RemoveDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aRemoveDisksInput), +} #[doc = "Container unpairing input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveProtectionContainerMappingInput { @@ -15518,7 +15797,7 @@ impl ReplicationAppliance { pub struct ReplicationApplianceProperties { #[doc = "Appliance specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationApplianceProperties { pub fn new() -> Self { @@ -15759,7 +16038,7 @@ pub struct ReplicationProtectedItemProperties { pub failover_recovery_point_id: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "The recovery container Id."] #[serde(rename = "recoveryContainerId", default, skip_serializing_if = "Option::is_none")] pub recovery_container_id: Option, @@ -15831,7 +16110,7 @@ pub struct ReplicationProtectionIntentProperties { pub creation_time_utc: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationProtectionIntentProperties { pub fn new() -> Self { @@ -15850,6 +16129,12 @@ impl ReplicationProtectionIntentProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProtectionIntentProviderSpecificSettingsUnion { + #[serde(rename = "A2A")] + A2a(A2aReplicationIntentDetails), +} #[doc = "Provider specific input for unpairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicationProviderContainerUnmappingInput { @@ -15874,6 +16159,15 @@ impl ReplicationProviderSpecificContainerCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerCreationInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerCreationInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationContainerCreationInput), + VMwareCbt(VMwareCbtContainerCreationInput), +} #[doc = "Provider specific input for pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificContainerMappingInput { @@ -15886,6 +16180,13 @@ impl ReplicationProviderSpecificContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerMappingInput), + VMwareCbt(VMwareCbtContainerMappingInput), +} #[doc = "Replication provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificSettings { @@ -15898,6 +16199,22 @@ impl ReplicationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificSettingsUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationReplicationDetails), + #[serde(rename = "A2A")] + A2a(A2aReplicationDetails), + HyperVReplicaAzure(HyperVReplicaAzureReplicationDetails), + HyperVReplicaBaseReplicationDetails(HyperVReplicaBaseReplicationDetails), + HyperVReplica2012R2(HyperVReplicaBlueReplicationDetails), + HyperVReplica2012(HyperVReplicaReplicationDetails), + InMageAzureV2(InMageAzureV2ReplicationDetails), + InMageRcmFailback(InMageRcmFailbackReplicationDetails), + InMageRcm(InMageRcmReplicationDetails), + InMage(InMageReplicationDetails), +} #[doc = "Provider specific input for update pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificUpdateContainerMappingInput { @@ -15910,6 +16227,13 @@ impl ReplicationProviderSpecificUpdateContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificUpdateContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateContainerMappingInput), + InMageRcm(InMageRcmUpdateContainerMappingInput), +} #[doc = "Reprotect agent details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReprotectAgentDetails { @@ -16136,10 +16460,10 @@ impl ResumeReplicationInput { pub struct ResumeReplicationInputProperties { #[doc = "Resume replication provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResumeReplicationProviderSpecificInput, + pub provider_specific_details: ResumeReplicationProviderSpecificInputUnion, } impl ResumeReplicationInputProperties { - pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16155,6 +16479,11 @@ impl ResumeReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResumeReplicationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResumeReplicationInput), +} #[doc = "Resync input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResyncInput { @@ -16171,10 +16500,10 @@ impl ResyncInput { pub struct ResyncInputProperties { #[doc = "Resync provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResyncProviderSpecificInput, + pub provider_specific_details: ResyncProviderSpecificInputUnion, } impl ResyncInputProperties { - pub fn new(provider_specific_details: ResyncProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResyncProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16190,6 +16519,11 @@ impl ResyncProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResyncProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResyncInput), +} #[doc = "The retention details of the MT."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionVolume { @@ -16231,7 +16565,7 @@ pub struct ReverseReplicationInputProperties { pub failover_direction: Option, #[doc = "Provider specific reverse replication input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReverseReplicationInputProperties { pub fn new() -> Self { @@ -16250,6 +16584,17 @@ impl ReverseReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReverseReplicationProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aReprotectInput), + HyperVReplicaAzure(HyperVReplicaAzureReprotectInput), + InMageAzureV2(InMageAzureV2ReprotectInput), + InMageRcmFailback(InMageRcmFailbackReprotectInput), + InMageRcm(InMageRcmReprotectInput), + InMage(InMageReprotectInput), +} #[doc = "Azure role assignment details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleAssignment { @@ -16354,6 +16699,11 @@ impl StorageAccountCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum StorageAccountCustomDetailsUnion { + Existing(ExistingStorageAccount), +} #[doc = "Storage object definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageClassification { @@ -16597,7 +16947,7 @@ pub struct SwitchProtectionInputProperties { pub replication_protected_item_name: Option, #[doc = "Provider specific switch protection input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProtectionInputProperties { pub fn new() -> Self { @@ -16633,6 +16983,12 @@ impl SwitchProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProtectionProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aSwitchProtectionInput), +} #[doc = "Input definition for switch provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SwitchProviderInput { @@ -16653,7 +17009,7 @@ pub struct SwitchProviderInputProperties { pub target_instance_type: Option, #[doc = "Provider specific switch provider input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProviderInputProperties { pub fn new() -> Self { @@ -16672,6 +17028,11 @@ impl SwitchProviderProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProviderProviderSpecificInputUnion { + InMageAzureV2(InMageAzureV2SwitchProviderProviderInput), +} #[doc = "Represents applicable recovery vm sizes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TargetComputeSize { @@ -16778,6 +17139,16 @@ impl TaskTypeDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TaskTypeDetailsUnion { + AutomationRunbookTaskDetails(AutomationRunbookTaskDetails), + ConsistencyCheckTaskDetails(ConsistencyCheckTaskDetails), + JobTaskDetails(JobTaskDetails), + ManualActionTaskDetails(ManualActionTaskDetails), + ScriptActionTaskDetails(ScriptActionTaskDetails), + VmNicUpdatesTaskDetails(VmNicUpdatesTaskDetails), +} #[doc = "Input definition for test failover cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestFailoverCleanupInput { @@ -16826,7 +17197,7 @@ pub struct TestFailoverInputProperties { pub network_id: Option, #[doc = "Provider specific test failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl TestFailoverInputProperties { pub fn new() -> Self { @@ -16887,6 +17258,16 @@ impl TestFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aTestFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureTestFailoverInput), + InMageAzureV2(InMageAzureV2TestFailoverInput), + InMageRcm(InMageRcmTestFailoverInput), + InMage(InMageTestFailoverInput), +} #[doc = "Input for test migrate cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestMigrateCleanupInput { @@ -16926,10 +17307,10 @@ impl TestMigrateInput { pub struct TestMigrateInputProperties { #[doc = "Test migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: TestMigrateProviderSpecificInput, + pub provider_specific_details: TestMigrateProviderSpecificInputUnion, } impl TestMigrateInputProperties { - pub fn new(provider_specific_details: TestMigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: TestMigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16945,6 +17326,11 @@ impl TestMigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestMigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtTestMigrateInput), +} #[doc = "Input definition for unplanned failover."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UnplannedFailoverInput { @@ -16967,7 +17353,7 @@ pub struct UnplannedFailoverInputProperties { pub source_site_operations: Option, #[doc = "Provider specific unplanned failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UnplannedFailoverInputProperties { pub fn new() -> Self { @@ -16986,6 +17372,16 @@ impl UnplannedFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UnplannedFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUnplannedFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureUnplannedFailoverInput), + InMageAzureV2(InMageAzureV2UnplannedFailoverInput), + InMageRcm(InMageRcmUnplannedFailoverInput), + InMage(InMageUnplannedFailoverInput), +} #[doc = "Update appliance for replication protected item input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateApplianceForReplicationProtectedItemInput { @@ -17005,12 +17401,12 @@ pub struct UpdateApplianceForReplicationProtectedItemInputProperties { pub target_appliance_id: String, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, } impl UpdateApplianceForReplicationProtectedItemInputProperties { pub fn new( target_appliance_id: String, - provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, ) -> Self { Self { target_appliance_id, @@ -17030,6 +17426,11 @@ impl UpdateApplianceForReplicationProtectedItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion { + InMageRcm(InMageRcmUpdateApplianceForReplicationProtectedItemInput), +} #[doc = "Disk input for update."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateDiskInput { @@ -17065,10 +17466,10 @@ impl UpdateMigrationItemInput { pub struct UpdateMigrationItemInputProperties { #[doc = "Update migration item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateMigrationItemProviderSpecificInput, + pub provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion, } impl UpdateMigrationItemInputProperties { - pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -17084,6 +17485,11 @@ impl UpdateMigrationItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateMigrationItemProviderSpecificInputUnion { + VMwareCbt(VMwareCbtUpdateMigrationItemInput), +} #[doc = "Request to update the mobility service on a protected item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateMobilityServiceRequest { @@ -17131,7 +17537,7 @@ pub struct UpdateNetworkMappingInputProperties { pub recovery_network_id: Option, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl UpdateNetworkMappingInputProperties { pub fn new() -> Self { @@ -17155,7 +17561,7 @@ impl UpdatePolicyInput { pub struct UpdatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "replicationProviderSettings", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_settings: Option, + pub replication_provider_settings: Option, } impl UpdatePolicyInputProperties { pub fn new() -> Self { @@ -17179,7 +17585,7 @@ impl UpdateProtectionContainerMappingInput { pub struct UpdateProtectionContainerMappingInputProperties { #[doc = "Provider specific input for update pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl UpdateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -17263,7 +17669,7 @@ pub struct UpdateReplicationProtectedItemInputProperties { pub recovery_availability_set_id: Option, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UpdateReplicationProtectedItemInputProperties { pub fn new() -> Self { @@ -17324,6 +17730,15 @@ impl UpdateReplicationProtectedItemProviderInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateReplicationProtectedItemProviderInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateReplicationProtectedItemInput), + HyperVReplicaAzure(HyperVReplicaAzureUpdateReplicationProtectedItemInput), + InMageAzureV2(InMageAzureV2UpdateReplicationProtectedItemInput), + InMageRcm(InMageRcmUpdateReplicationProtectedItemInput), +} #[doc = "Input required to update vCenter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateVCenterRequest { diff --git a/services/mgmt/recoveryservicessiterecovery/src/package_2023_01/models.rs b/services/mgmt/recoveryservicessiterecovery/src/package_2023_01/models.rs index 33895c5946..309070ca20 100644 --- a/services/mgmt/recoveryservicessiterecovery/src/package_2023_01/models.rs +++ b/services/mgmt/recoveryservicessiterecovery/src/package_2023_01/models.rs @@ -191,7 +191,7 @@ pub struct A2aCreateProtectionIntentInput { pub recovery_availability_type: a2a_create_protection_intent_input::RecoveryAvailabilityType, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfileCustomInput", default, skip_serializing_if = "Option::is_none")] - pub protection_profile_custom_input: Option, + pub protection_profile_custom_input: Option, #[doc = "The recovery resource group Id. Valid for V2 scenarios."] #[serde(rename = "recoveryResourceGroupId")] pub recovery_resource_group_id: String, @@ -201,20 +201,20 @@ pub struct A2aCreateProtectionIntentInput { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySetCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set_custom_input: Option, + pub recovery_availability_set_custom_input: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetworkCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network_custom_input: Option, + pub recovery_virtual_network_custom_input: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde( rename = "recoveryProximityPlacementGroupCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub recovery_proximity_placement_group_custom_input: Option, + pub recovery_proximity_placement_group_custom_input: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -242,7 +242,7 @@ pub struct A2aCreateProtectionIntentInput { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -1123,14 +1123,14 @@ pub struct A2aProtectionIntentDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub recovery_azure_storage_account_custom_input: Option, + pub recovery_azure_storage_account_custom_input: Option, #[doc = "Storage account custom input."] #[serde( rename = "primaryStagingStorageAccountCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, } impl A2aProtectionIntentDiskInputDetails { pub fn new(disk_uri: String) -> Self { @@ -1153,10 +1153,10 @@ pub struct A2aProtectionIntentManagedDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Resource Group custom input."] #[serde(rename = "recoveryResourceGroupCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_resource_group_custom_input: Option, + pub recovery_resource_group_custom_input: Option, #[doc = "The replica disk type. Its an optional value and will be same as source disk type if not user provided."] #[serde(rename = "recoveryReplicaDiskAccountType", default, skip_serializing_if = "Option::is_none")] pub recovery_replica_disk_account_type: Option, @@ -1684,19 +1684,19 @@ pub struct A2aReplicationIntentDetails { pub recovery_resource_group_id: Option, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfile", default, skip_serializing_if = "Option::is_none")] - pub protection_profile: Option, + pub protection_profile: Option, #[doc = "Storage account custom input."] #[serde(rename = "primaryStagingStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub primary_staging_storage_account: Option, + pub primary_staging_storage_account: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySet", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set: Option, + pub recovery_availability_set: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetwork", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network: Option, + pub recovery_virtual_network: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde(rename = "recoveryProximityPlacementGroup", default, skip_serializing_if = "Option::is_none")] - pub recovery_proximity_placement_group: Option, + pub recovery_proximity_placement_group: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -1708,7 +1708,7 @@ pub struct A2aReplicationIntentDetails { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -2399,10 +2399,10 @@ pub struct AsrTask { pub task_type: Option, #[doc = "Task details based on specific task type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "This class represents the group task details when parent child relationship exists in the drill down."] #[serde(rename = "groupTaskCustomDetails", default, skip_serializing_if = "Option::is_none")] - pub group_task_custom_details: Option, + pub group_task_custom_details: Option, #[doc = "The task error details."] #[serde( default, @@ -2433,10 +2433,10 @@ impl AddDisksInput { pub struct AddDisksInputProperties { #[doc = "Add Disks provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: AddDisksProviderSpecificInput, + pub provider_specific_details: AddDisksProviderSpecificInputUnion, } impl AddDisksInputProperties { - pub fn new(provider_specific_details: AddDisksProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: AddDisksProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -2452,6 +2452,12 @@ impl AddDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum AddDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aAddDisksInput), +} #[doc = "Input required to add a provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddRecoveryServicesProviderInput { @@ -2700,6 +2706,11 @@ impl ApplianceSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplianceSpecificDetailsUnion { + InMageRcm(InMageRcmApplianceSpecificDetails), +} #[doc = "Input to apply recovery point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplyRecoveryPointInput { @@ -2719,10 +2730,10 @@ pub struct ApplyRecoveryPointInputProperties { pub recovery_point_id: Option, #[doc = "Provider specific input for apply recovery point."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ApplyRecoveryPointProviderSpecificInput, + pub provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion, } impl ApplyRecoveryPointInputProperties { - pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion) -> Self { Self { recovery_point_id: None, provider_specific_details, @@ -2741,6 +2752,17 @@ impl ApplyRecoveryPointProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplyRecoveryPointProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aApplyRecoveryPointInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationApplyRecoveryPointInput), + HyperVReplicaAzure(HyperVReplicaAzureApplyRecoveryPointInput), + InMageAzureV2(InMageAzureV2ApplyRecoveryPointInput), + InMageRcm(InMageRcmApplyRecoveryPointInput), +} #[doc = "This class represents job details based on specific job type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AsrJobDetails { @@ -3002,6 +3024,13 @@ impl ConfigurationSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ConfigurationSettingsUnion { + HyperVVirtualMachine(HyperVVirtualMachineDetails), + ReplicationGroupDetails(ReplicationGroupDetails), + VMwareVirtualMachine(VMwareVirtualMachineDetails), +} #[doc = "Request to configure alerts for the system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConfigureAlertRequest { @@ -3081,7 +3110,7 @@ pub struct CreateNetworkMappingInputProperties { pub recovery_network_id: String, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl CreateNetworkMappingInputProperties { pub fn new(recovery_network_id: String) -> Self { @@ -3109,7 +3138,7 @@ impl CreatePolicyInput { pub struct CreatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreatePolicyInputProperties { pub fn new() -> Self { @@ -3138,7 +3167,7 @@ pub struct CreateProtectionContainerInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateProtectionContainerInputProperties { pub fn new() -> Self { @@ -3168,7 +3197,7 @@ pub struct CreateProtectionContainerMappingInputProperties { pub policy_id: Option, #[doc = "Provider specific input for pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -3192,7 +3221,7 @@ impl CreateProtectionIntentInput { pub struct CreateProtectionIntentProperties { #[doc = "Create protection intent provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl CreateProtectionIntentProperties { pub fn new() -> Self { @@ -3211,6 +3240,12 @@ impl CreateProtectionIntentProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum CreateProtectionIntentProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aCreateProtectionIntentInput), +} #[doc = "Create recovery plan input class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateRecoveryPlanInput { @@ -3243,7 +3278,7 @@ pub struct CreateRecoveryPlanInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateRecoveryPlanInputProperties { pub fn new(primary_fabric_id: String, recovery_fabric_id: String, groups: Vec) -> Self { @@ -3398,7 +3433,7 @@ pub struct DisableProtectionInputProperties { pub disable_protection_reason: Option, #[doc = "Disable protection provider specific input."] #[serde(rename = "replicationProviderInput", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_input: Option, + pub replication_provider_input: Option, } impl DisableProtectionInputProperties { pub fn new() -> Self { @@ -3457,6 +3492,11 @@ impl DisableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum DisableProtectionProviderSpecificInputUnion { + InMage(InMageDisableProtectionProviderSpecificInput), +} #[doc = "Request to add a physical machine as a protectable item in a container."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiscoverProtectableItemRequest { @@ -3678,10 +3718,10 @@ pub struct EnableMigrationInputProperties { pub policy_id: String, #[doc = "Enable migration provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: EnableMigrationProviderSpecificInput, + pub provider_specific_details: EnableMigrationProviderSpecificInputUnion, } impl EnableMigrationInputProperties { - pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInput) -> Self { + pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInputUnion) -> Self { Self { policy_id, provider_specific_details, @@ -3700,6 +3740,11 @@ impl EnableMigrationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableMigrationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtEnableMigrationInput), +} #[doc = "Enable protection input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnableProtectionInput { @@ -3723,7 +3768,7 @@ pub struct EnableProtectionInputProperties { pub protectable_item_id: Option, #[doc = "Enable protection provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl EnableProtectionInputProperties { pub fn new() -> Self { @@ -3742,6 +3787,18 @@ impl EnableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableProtectionProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationEnableProtectionInput), + #[serde(rename = "A2A")] + A2a(A2aEnableProtectionInput), + HyperVReplicaAzure(HyperVReplicaAzureEnableProtectionInput), + InMageAzureV2(InMageAzureV2EnableProtectionInput), + InMage(InMageEnableProtectionInput), + InMageRcm(InMageRcmEnableProtectionInput), +} #[doc = "Encryption details for the fabric."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EncryptionDetails { @@ -3828,10 +3885,10 @@ pub struct EventProperties { pub fabric_id: Option, #[doc = "Model class for provider specific details for an event."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Model class for event specific details for an event."] #[serde(rename = "eventSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub event_specific_details: Option, + pub event_specific_details: Option, #[doc = "The list of errors / warnings capturing details associated with the issue(s)."] #[serde( rename = "healthErrors", @@ -3858,6 +3915,20 @@ impl EventProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aEventDetails), + HyperVReplica2012(HyperVReplica2012EventDetails), + HyperVReplica2012R2(HyperVReplica2012R2EventDetails), + HyperVReplicaAzure(HyperVReplicaAzureEventDetails), + HyperVReplicaBaseEventDetails(HyperVReplicaBaseEventDetails), + InMageAzureV2(InMageAzureV2EventDetails), + InMageRcm(InMageRcmEventDetails), + InMageRcmFailback(InMageRcmFailbackEventDetails), + VMwareCbt(VMwareCbtEventDetails), +} #[doc = "Implements the event query parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventQueryParameter { @@ -3903,6 +3974,11 @@ impl EventSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventSpecificDetailsUnion { + JobStatus(JobStatusEventDetails), +} #[doc = "Existing storage account input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExistingProtectionProfile { @@ -4138,7 +4214,7 @@ impl FabricCreationInput { pub struct FabricCreationInputProperties { #[doc = "Fabric provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl FabricCreationInputProperties { pub fn new() -> Self { @@ -4165,7 +4241,7 @@ pub struct FabricProperties { pub bcdr_state: Option, #[doc = "Fabric specific details."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "Fabric health error details."] #[serde( rename = "healthErrorDetails", @@ -4243,6 +4319,13 @@ impl FabricSpecificCreateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureCreateNetworkMappingInput), + VmmToAzure(VmmToAzureCreateNetworkMappingInput), + VmmToVmm(VmmToVmmCreateNetworkMappingInput), +} #[doc = "Fabric provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificCreationInput { @@ -4255,6 +4338,13 @@ impl FabricSpecificCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreationInputUnion { + Azure(AzureFabricCreationInput), + InMageRcm(InMageRcmFabricCreationInput), + VMwareV2(VMwareV2FabricCreationInput), +} #[doc = "Fabric specific details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificDetails { @@ -4267,6 +4357,17 @@ impl FabricSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificDetailsUnion { + Azure(AzureFabricSpecificDetails), + HyperVSite(HyperVSiteDetails), + InMageRcm(InMageRcmFabricSpecificDetails), + VMware(VMwareDetails), + VMwareV2(VMwareV2FabricSpecificDetails), + #[serde(rename = "VMM")] + Vmm(VmmDetails), +} #[doc = "Input details specific to fabrics during Network Mapping."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificUpdateNetworkMappingInput { @@ -4279,6 +4380,13 @@ impl FabricSpecificUpdateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificUpdateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureUpdateNetworkMappingInput), + VmmToAzure(VmmToAzureUpdateNetworkMappingInput), + VmmToVmm(VmmToVmmUpdateNetworkMappingInput), +} #[doc = "This class represents the details for a failover job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FailoverJobDetails { @@ -4401,6 +4509,12 @@ impl GroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum GroupTaskDetailsUnion { + InlineWorkflowTaskDetails(InlineWorkflowTaskDetails), + RecoveryPlanGroupTaskDetails(RecoveryPlanGroupTaskDetails), +} #[doc = "Health Error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HealthError { @@ -5980,6 +6094,11 @@ impl HyperVReplicaPolicyInput { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVReplicaPolicyInputUnion { + HyperVReplica2012R2(HyperVReplicaBluePolicyInput), +} #[doc = "HyperV replica 2012 replication details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HyperVReplicaReplicationDetails { @@ -6223,6 +6342,11 @@ pub mod hyper_v_virtual_machine_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVVirtualMachineDetailsUnion { + VmmVirtualMachine(VmmVirtualMachineDetails), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IpConfigDetails { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -11105,6 +11229,15 @@ impl JobDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobDetailsUnion { + AsrJobDetails(AsrJobDetails), + ExportJobDetails(ExportJobDetails), + FailoverJobDetails(FailoverJobDetails), + SwitchProtectionJobDetails(SwitchProtectionJobDetails), + TestFailoverJobDetails(TestFailoverJobDetails), +} #[doc = "This class contains the minimal job details required to navigate to the desired drill down."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobEntity { @@ -11213,7 +11346,7 @@ pub struct JobProperties { pub target_instance_type: Option, #[doc = "Job details based on specific job type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl JobProperties { pub fn new() -> Self { @@ -11341,6 +11474,12 @@ impl JobTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobTaskDetailsUnion { + FabricReplicationGroupTaskDetails(FabricReplicationGroupTaskDetails), + VirtualMachineTaskDetails(VirtualMachineTaskDetails), +} #[doc = "Key Encryption Key (KEK) information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KeyEncryptionKeyInfo { @@ -11625,10 +11764,10 @@ impl MigrateInput { pub struct MigrateInputProperties { #[doc = "Migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: MigrateProviderSpecificInput, + pub provider_specific_details: MigrateProviderSpecificInputUnion, } impl MigrateInputProperties { - pub fn new(provider_specific_details: MigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: MigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -11644,6 +11783,11 @@ impl MigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtMigrateInput), +} #[doc = "Migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationItem { @@ -11760,7 +11904,7 @@ pub struct MigrationItemProperties { pub event_correlation_id: Option, #[doc = "Migration provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl MigrationItemProperties { pub fn new() -> Self { @@ -11965,6 +12109,11 @@ impl MigrationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrationProviderSpecificSettingsUnion { + VMwareCbt(VMwareCbtMigrationDetails), +} #[doc = "Recovery point for a migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationRecoveryPoint { @@ -12169,6 +12318,13 @@ impl NetworkMappingFabricSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum NetworkMappingFabricSpecificSettingsUnion { + AzureToAzure(AzureToAzureNetworkMappingSettings), + VmmToAzure(VmmToAzureNetworkMappingSettings), + VmmToVmm(VmmToVmmNetworkMappingSettings), +} #[doc = "Network Mapping Properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NetworkMappingProperties { @@ -12198,7 +12354,7 @@ pub struct NetworkMappingProperties { pub recovery_fabric_friendly_name: Option, #[doc = "Network Mapping fabric specific settings."] #[serde(rename = "fabricSpecificSettings", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_settings: Option, + pub fabric_specific_settings: Option, } impl NetworkMappingProperties { pub fn new() -> Self { @@ -12489,7 +12645,7 @@ pub struct PlannedFailoverInputProperties { pub failover_direction: Option, #[doc = "Provider specific failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PlannedFailoverInputProperties { pub fn new() -> Self { @@ -12508,6 +12664,13 @@ impl PlannedFailoverProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PlannedFailoverProviderSpecificFailoverInputUnion { + HyperVReplicaAzureFailback(HyperVReplicaAzureFailbackProviderInput), + HyperVReplicaAzure(HyperVReplicaAzurePlannedFailoverProviderInput), + InMageRcmFailback(InMageRcmFailbackPlannedFailoverProviderInput), +} #[doc = "Protection profile details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Policy { @@ -12555,7 +12718,7 @@ pub struct PolicyProperties { pub friendly_name: Option, #[doc = "Base class for Provider specific details for policies."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PolicyProperties { pub fn new() -> Self { @@ -12574,6 +12737,22 @@ impl PolicyProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aPolicyDetails), + HyperVReplicaAzure(HyperVReplicaAzurePolicyDetails), + HyperVReplicaBasePolicyDetails(HyperVReplicaBasePolicyDetails), + HyperVReplica2012R2(HyperVReplicaBluePolicyDetails), + HyperVReplica2012(HyperVReplicaPolicyDetails), + InMageAzureV2(InMageAzureV2PolicyDetails), + InMageBasePolicyDetails(InMageBasePolicyDetails), + InMage(InMagePolicyDetails), + InMageRcmFailback(InMageRcmFailbackPolicyDetails), + InMageRcm(InMageRcmPolicyDetails), + VMwareCbt(VmwareCbtPolicyDetails), +} #[doc = "Base class for provider specific input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyProviderSpecificInput { @@ -12586,6 +12765,21 @@ impl PolicyProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationPolicyCreationInput), + #[serde(rename = "A2A")] + A2a(A2aPolicyCreationInput), + HyperVReplicaAzure(HyperVReplicaAzurePolicyInput), + HyperVReplica2012(HyperVReplicaPolicyInput), + InMageAzureV2(InMageAzureV2PolicyInput), + InMage(InMagePolicyInput), + InMageRcmFailback(InMageRcmFailbackPolicyCreationInput), + InMageRcm(InMageRcmPolicyCreationInput), + VMwareCbt(VMwareCbtPolicyCreationInput), +} #[doc = "Details of the Process Server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessServer { @@ -13225,7 +13419,7 @@ pub struct ProtectableItemProperties { pub supported_replication_providers: Vec, #[doc = "Replication provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl ProtectableItemProperties { pub fn new() -> Self { @@ -13418,7 +13612,7 @@ pub struct ProtectionContainerMappingProperties { pub target_protection_container_friendly_name: Option, #[doc = "Container mapping provider specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Health of pairing."] #[serde(default, skip_serializing_if = "Option::is_none")] pub health: Option, @@ -13466,6 +13660,14 @@ impl ProtectionContainerMappingProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProtectionContainerMappingProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aProtectionContainerMappingDetails), + InMageRcm(InMageRcmProtectionContainerMappingDetails), + VMwareCbt(VMwareCbtProtectionContainerMappingDetails), +} #[doc = "Protection profile custom data details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionContainerProperties { @@ -13508,6 +13710,12 @@ impl ProtectionProfileCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ProtectionProfileCustomDetailsUnion { + Existing(ExistingProtectionProfile), + New(NewProtectionProfile), +} #[doc = "This class contains the error details per object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProviderError { @@ -13544,6 +13752,14 @@ impl ProviderSpecificRecoveryPointDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProviderSpecificRecoveryPointDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aRecoveryPointDetails), + InMageAzureV2(InMageAzureV2RecoveryPointDetails), + InMageRcm(InMageRcmRecoveryPointDetails), +} #[doc = "Push installer details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PushInstallerDetails { @@ -13729,6 +13945,11 @@ impl RecoveryAvailabilitySetCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryAvailabilitySetCustomDetailsUnion { + Existing(ExistingRecoveryAvailabilitySet), +} #[doc = "Recovery plan details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPlan { @@ -13928,14 +14149,14 @@ pub struct RecoveryPlanAction { pub failover_directions: Vec, #[doc = "Recovery plan action custom details."] #[serde(rename = "customDetails")] - pub custom_details: RecoveryPlanActionDetails, + pub custom_details: RecoveryPlanActionDetailsUnion, } impl RecoveryPlanAction { pub fn new( action_name: String, failover_types: Vec, failover_directions: Vec, - custom_details: RecoveryPlanActionDetails, + custom_details: RecoveryPlanActionDetailsUnion, ) -> Self { Self { action_name, @@ -13957,6 +14178,13 @@ impl RecoveryPlanActionDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanActionDetailsUnion { + AutomationRunbookActionDetails(RecoveryPlanAutomationRunbookActionDetails), + ManualActionDetails(RecoveryPlanManualActionDetails), + ScriptActionDetails(RecoveryPlanScriptActionDetails), +} #[doc = "Recovery plan Automation runbook action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanAutomationRunbookActionDetails { @@ -14158,6 +14386,11 @@ impl RecoveryPlanGroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanGroupTaskDetailsUnion { + RecoveryPlanShutdownGroupTaskDetails(RecoveryPlanShutdownGroupTaskDetails), +} #[doc = "Recovery plan HVR Azure failback input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanHyperVReplicaAzureFailbackInput { @@ -14636,7 +14869,7 @@ pub struct RecoveryPlanPlannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanPlannedFailoverInputProperties { pub fn new(failover_direction: recovery_plan_planned_failover_input_properties::FailoverDirection) -> Self { @@ -14755,7 +14988,7 @@ pub struct RecoveryPlanProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanProperties { pub fn new() -> Self { @@ -14789,6 +15022,12 @@ impl RecoveryPlanProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aDetails), +} #[doc = "Recovery plan provider specific failover input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificFailoverInput { @@ -14801,6 +15040,18 @@ impl RecoveryPlanProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificFailoverInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aFailoverInput), + HyperVReplicaAzureFailback(RecoveryPlanHyperVReplicaAzureFailbackInput), + HyperVReplicaAzure(RecoveryPlanHyperVReplicaAzureFailoverInput), + InMageAzureV2(RecoveryPlanInMageAzureV2FailoverInput), + InMage(RecoveryPlanInMageFailoverInput), + InMageRcmFailback(RecoveryPlanInMageRcmFailbackFailoverInput), + InMageRcm(RecoveryPlanInMageRcmFailoverInput), +} #[doc = "Recovery plan provider specific input base class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificInput { @@ -14813,6 +15064,12 @@ impl RecoveryPlanProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aInput), +} #[doc = "Recovery plan script action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanScriptActionDetails { @@ -14947,7 +15204,7 @@ pub struct RecoveryPlanTestFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanTestFailoverInputProperties { pub fn new(failover_direction: recovery_plan_test_failover_input_properties::FailoverDirection, network_type: String) -> Self { @@ -15026,7 +15283,7 @@ pub struct RecoveryPlanUnplannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanUnplannedFailoverInputProperties { pub fn new( @@ -15167,7 +15424,7 @@ pub struct RecoveryPointProperties { pub recovery_point_type: Option, #[doc = "Replication provider specific recovery point details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RecoveryPointProperties { pub fn new() -> Self { @@ -15186,6 +15443,11 @@ impl RecoveryProximityPlacementGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryProximityPlacementGroupCustomDetailsUnion { + Existing(ExistingRecoveryProximityPlacementGroup), +} #[doc = "Recovery Resource Group custom input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryResourceGroupCustomDetails { @@ -15198,6 +15460,11 @@ impl RecoveryResourceGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryResourceGroupCustomDetailsUnion { + Existing(ExistingRecoveryRecoveryResourceGroup), +} #[doc = "Provider details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryServicesProvider { @@ -15332,6 +15599,12 @@ impl RecoveryVirtualNetworkCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryVirtualNetworkCustomDetailsUnion { + Existing(ExistingRecoveryVirtualNetwork), + New(NewRecoveryVirtualNetwork), +} #[doc = "Input for remove disk(s) operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveDisksInput { @@ -15349,7 +15622,7 @@ impl RemoveDisksInput { pub struct RemoveDisksInputProperties { #[doc = "Remove Disk provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RemoveDisksInputProperties { pub fn new() -> Self { @@ -15368,6 +15641,12 @@ impl RemoveDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RemoveDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aRemoveDisksInput), +} #[doc = "Container unpairing input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveProtectionContainerMappingInput { @@ -15518,7 +15797,7 @@ impl ReplicationAppliance { pub struct ReplicationApplianceProperties { #[doc = "Appliance specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationApplianceProperties { pub fn new() -> Self { @@ -15759,7 +16038,7 @@ pub struct ReplicationProtectedItemProperties { pub failover_recovery_point_id: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "The recovery container Id."] #[serde(rename = "recoveryContainerId", default, skip_serializing_if = "Option::is_none")] pub recovery_container_id: Option, @@ -15831,7 +16110,7 @@ pub struct ReplicationProtectionIntentProperties { pub creation_time_utc: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationProtectionIntentProperties { pub fn new() -> Self { @@ -15850,6 +16129,12 @@ impl ReplicationProtectionIntentProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProtectionIntentProviderSpecificSettingsUnion { + #[serde(rename = "A2A")] + A2a(A2aReplicationIntentDetails), +} #[doc = "Provider specific input for unpairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicationProviderContainerUnmappingInput { @@ -15874,6 +16159,15 @@ impl ReplicationProviderSpecificContainerCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerCreationInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerCreationInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationContainerCreationInput), + VMwareCbt(VMwareCbtContainerCreationInput), +} #[doc = "Provider specific input for pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificContainerMappingInput { @@ -15886,6 +16180,13 @@ impl ReplicationProviderSpecificContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerMappingInput), + VMwareCbt(VMwareCbtContainerMappingInput), +} #[doc = "Replication provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificSettings { @@ -15898,6 +16199,22 @@ impl ReplicationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificSettingsUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationReplicationDetails), + #[serde(rename = "A2A")] + A2a(A2aReplicationDetails), + HyperVReplicaAzure(HyperVReplicaAzureReplicationDetails), + HyperVReplicaBaseReplicationDetails(HyperVReplicaBaseReplicationDetails), + HyperVReplica2012R2(HyperVReplicaBlueReplicationDetails), + HyperVReplica2012(HyperVReplicaReplicationDetails), + InMageAzureV2(InMageAzureV2ReplicationDetails), + InMageRcmFailback(InMageRcmFailbackReplicationDetails), + InMageRcm(InMageRcmReplicationDetails), + InMage(InMageReplicationDetails), +} #[doc = "Provider specific input for update pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificUpdateContainerMappingInput { @@ -15910,6 +16227,13 @@ impl ReplicationProviderSpecificUpdateContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificUpdateContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateContainerMappingInput), + InMageRcm(InMageRcmUpdateContainerMappingInput), +} #[doc = "Reprotect agent details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReprotectAgentDetails { @@ -16136,10 +16460,10 @@ impl ResumeReplicationInput { pub struct ResumeReplicationInputProperties { #[doc = "Resume replication provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResumeReplicationProviderSpecificInput, + pub provider_specific_details: ResumeReplicationProviderSpecificInputUnion, } impl ResumeReplicationInputProperties { - pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16155,6 +16479,11 @@ impl ResumeReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResumeReplicationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResumeReplicationInput), +} #[doc = "Resync input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResyncInput { @@ -16171,10 +16500,10 @@ impl ResyncInput { pub struct ResyncInputProperties { #[doc = "Resync provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResyncProviderSpecificInput, + pub provider_specific_details: ResyncProviderSpecificInputUnion, } impl ResyncInputProperties { - pub fn new(provider_specific_details: ResyncProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResyncProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16190,6 +16519,11 @@ impl ResyncProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResyncProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResyncInput), +} #[doc = "The retention details of the MT."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionVolume { @@ -16231,7 +16565,7 @@ pub struct ReverseReplicationInputProperties { pub failover_direction: Option, #[doc = "Provider specific reverse replication input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReverseReplicationInputProperties { pub fn new() -> Self { @@ -16250,6 +16584,17 @@ impl ReverseReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReverseReplicationProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aReprotectInput), + HyperVReplicaAzure(HyperVReplicaAzureReprotectInput), + InMageAzureV2(InMageAzureV2ReprotectInput), + InMageRcmFailback(InMageRcmFailbackReprotectInput), + InMageRcm(InMageRcmReprotectInput), + InMage(InMageReprotectInput), +} #[doc = "Azure role assignment details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleAssignment { @@ -16354,6 +16699,11 @@ impl StorageAccountCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum StorageAccountCustomDetailsUnion { + Existing(ExistingStorageAccount), +} #[doc = "Storage object definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageClassification { @@ -16597,7 +16947,7 @@ pub struct SwitchProtectionInputProperties { pub replication_protected_item_name: Option, #[doc = "Provider specific switch protection input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProtectionInputProperties { pub fn new() -> Self { @@ -16633,6 +16983,12 @@ impl SwitchProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProtectionProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aSwitchProtectionInput), +} #[doc = "Input definition for switch provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SwitchProviderInput { @@ -16653,7 +17009,7 @@ pub struct SwitchProviderInputProperties { pub target_instance_type: Option, #[doc = "Provider specific switch provider input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProviderInputProperties { pub fn new() -> Self { @@ -16672,6 +17028,11 @@ impl SwitchProviderProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProviderProviderSpecificInputUnion { + InMageAzureV2(InMageAzureV2SwitchProviderProviderInput), +} #[doc = "Represents applicable recovery vm sizes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TargetComputeSize { @@ -16778,6 +17139,16 @@ impl TaskTypeDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TaskTypeDetailsUnion { + AutomationRunbookTaskDetails(AutomationRunbookTaskDetails), + ConsistencyCheckTaskDetails(ConsistencyCheckTaskDetails), + JobTaskDetails(JobTaskDetails), + ManualActionTaskDetails(ManualActionTaskDetails), + ScriptActionTaskDetails(ScriptActionTaskDetails), + VmNicUpdatesTaskDetails(VmNicUpdatesTaskDetails), +} #[doc = "Input definition for test failover cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestFailoverCleanupInput { @@ -16826,7 +17197,7 @@ pub struct TestFailoverInputProperties { pub network_id: Option, #[doc = "Provider specific test failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl TestFailoverInputProperties { pub fn new() -> Self { @@ -16887,6 +17258,16 @@ impl TestFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aTestFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureTestFailoverInput), + InMageAzureV2(InMageAzureV2TestFailoverInput), + InMageRcm(InMageRcmTestFailoverInput), + InMage(InMageTestFailoverInput), +} #[doc = "Input for test migrate cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestMigrateCleanupInput { @@ -16926,10 +17307,10 @@ impl TestMigrateInput { pub struct TestMigrateInputProperties { #[doc = "Test migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: TestMigrateProviderSpecificInput, + pub provider_specific_details: TestMigrateProviderSpecificInputUnion, } impl TestMigrateInputProperties { - pub fn new(provider_specific_details: TestMigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: TestMigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16945,6 +17326,11 @@ impl TestMigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestMigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtTestMigrateInput), +} #[doc = "Input definition for unplanned failover."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UnplannedFailoverInput { @@ -16967,7 +17353,7 @@ pub struct UnplannedFailoverInputProperties { pub source_site_operations: Option, #[doc = "Provider specific unplanned failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UnplannedFailoverInputProperties { pub fn new() -> Self { @@ -16986,6 +17372,16 @@ impl UnplannedFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UnplannedFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUnplannedFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureUnplannedFailoverInput), + InMageAzureV2(InMageAzureV2UnplannedFailoverInput), + InMageRcm(InMageRcmUnplannedFailoverInput), + InMage(InMageUnplannedFailoverInput), +} #[doc = "Update appliance for replication protected item input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateApplianceForReplicationProtectedItemInput { @@ -17005,12 +17401,12 @@ pub struct UpdateApplianceForReplicationProtectedItemInputProperties { pub target_appliance_id: String, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, } impl UpdateApplianceForReplicationProtectedItemInputProperties { pub fn new( target_appliance_id: String, - provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, ) -> Self { Self { target_appliance_id, @@ -17030,6 +17426,11 @@ impl UpdateApplianceForReplicationProtectedItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion { + InMageRcm(InMageRcmUpdateApplianceForReplicationProtectedItemInput), +} #[doc = "Disk input for update."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateDiskInput { @@ -17065,10 +17466,10 @@ impl UpdateMigrationItemInput { pub struct UpdateMigrationItemInputProperties { #[doc = "Update migration item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateMigrationItemProviderSpecificInput, + pub provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion, } impl UpdateMigrationItemInputProperties { - pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -17084,6 +17485,11 @@ impl UpdateMigrationItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateMigrationItemProviderSpecificInputUnion { + VMwareCbt(VMwareCbtUpdateMigrationItemInput), +} #[doc = "Request to update the mobility service on a protected item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateMobilityServiceRequest { @@ -17131,7 +17537,7 @@ pub struct UpdateNetworkMappingInputProperties { pub recovery_network_id: Option, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl UpdateNetworkMappingInputProperties { pub fn new() -> Self { @@ -17155,7 +17561,7 @@ impl UpdatePolicyInput { pub struct UpdatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "replicationProviderSettings", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_settings: Option, + pub replication_provider_settings: Option, } impl UpdatePolicyInputProperties { pub fn new() -> Self { @@ -17179,7 +17585,7 @@ impl UpdateProtectionContainerMappingInput { pub struct UpdateProtectionContainerMappingInputProperties { #[doc = "Provider specific input for update pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl UpdateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -17263,7 +17669,7 @@ pub struct UpdateReplicationProtectedItemInputProperties { pub recovery_availability_set_id: Option, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UpdateReplicationProtectedItemInputProperties { pub fn new() -> Self { @@ -17324,6 +17730,15 @@ impl UpdateReplicationProtectedItemProviderInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateReplicationProtectedItemProviderInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateReplicationProtectedItemInput), + HyperVReplicaAzure(HyperVReplicaAzureUpdateReplicationProtectedItemInput), + InMageAzureV2(InMageAzureV2UpdateReplicationProtectedItemInput), + InMageRcm(InMageRcmUpdateReplicationProtectedItemInput), +} #[doc = "Input required to update vCenter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateVCenterRequest { diff --git a/services/mgmt/recoveryservicessiterecovery/src/package_2023_02/models.rs b/services/mgmt/recoveryservicessiterecovery/src/package_2023_02/models.rs index 58f677b50f..f9fc45460a 100644 --- a/services/mgmt/recoveryservicessiterecovery/src/package_2023_02/models.rs +++ b/services/mgmt/recoveryservicessiterecovery/src/package_2023_02/models.rs @@ -191,7 +191,7 @@ pub struct A2aCreateProtectionIntentInput { pub recovery_availability_type: a2a_create_protection_intent_input::RecoveryAvailabilityType, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfileCustomInput", default, skip_serializing_if = "Option::is_none")] - pub protection_profile_custom_input: Option, + pub protection_profile_custom_input: Option, #[doc = "The recovery resource group Id. Valid for V2 scenarios."] #[serde(rename = "recoveryResourceGroupId")] pub recovery_resource_group_id: String, @@ -201,20 +201,20 @@ pub struct A2aCreateProtectionIntentInput { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySetCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set_custom_input: Option, + pub recovery_availability_set_custom_input: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetworkCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network_custom_input: Option, + pub recovery_virtual_network_custom_input: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde( rename = "recoveryProximityPlacementGroupCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub recovery_proximity_placement_group_custom_input: Option, + pub recovery_proximity_placement_group_custom_input: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -242,7 +242,7 @@ pub struct A2aCreateProtectionIntentInput { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -1168,14 +1168,14 @@ pub struct A2aProtectionIntentDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub recovery_azure_storage_account_custom_input: Option, + pub recovery_azure_storage_account_custom_input: Option, #[doc = "Storage account custom input."] #[serde( rename = "primaryStagingStorageAccountCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, } impl A2aProtectionIntentDiskInputDetails { pub fn new(disk_uri: String) -> Self { @@ -1198,10 +1198,10 @@ pub struct A2aProtectionIntentManagedDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Resource Group custom input."] #[serde(rename = "recoveryResourceGroupCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_resource_group_custom_input: Option, + pub recovery_resource_group_custom_input: Option, #[doc = "The replica disk type. Its an optional value and will be same as source disk type if not user provided."] #[serde(rename = "recoveryReplicaDiskAccountType", default, skip_serializing_if = "Option::is_none")] pub recovery_replica_disk_account_type: Option, @@ -1729,19 +1729,19 @@ pub struct A2aReplicationIntentDetails { pub recovery_resource_group_id: Option, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfile", default, skip_serializing_if = "Option::is_none")] - pub protection_profile: Option, + pub protection_profile: Option, #[doc = "Storage account custom input."] #[serde(rename = "primaryStagingStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub primary_staging_storage_account: Option, + pub primary_staging_storage_account: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySet", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set: Option, + pub recovery_availability_set: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetwork", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network: Option, + pub recovery_virtual_network: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde(rename = "recoveryProximityPlacementGroup", default, skip_serializing_if = "Option::is_none")] - pub recovery_proximity_placement_group: Option, + pub recovery_proximity_placement_group: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -1753,7 +1753,7 @@ pub struct A2aReplicationIntentDetails { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -2444,10 +2444,10 @@ pub struct AsrTask { pub task_type: Option, #[doc = "Task details based on specific task type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "This class represents the group task details when parent child relationship exists in the drill down."] #[serde(rename = "groupTaskCustomDetails", default, skip_serializing_if = "Option::is_none")] - pub group_task_custom_details: Option, + pub group_task_custom_details: Option, #[doc = "The task error details."] #[serde( default, @@ -2478,10 +2478,10 @@ impl AddDisksInput { pub struct AddDisksInputProperties { #[doc = "Add Disks provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: AddDisksProviderSpecificInput, + pub provider_specific_details: AddDisksProviderSpecificInputUnion, } impl AddDisksInputProperties { - pub fn new(provider_specific_details: AddDisksProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: AddDisksProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -2497,6 +2497,12 @@ impl AddDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum AddDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aAddDisksInput), +} #[doc = "Input required to add a provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddRecoveryServicesProviderInput { @@ -2745,6 +2751,11 @@ impl ApplianceSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplianceSpecificDetailsUnion { + InMageRcm(InMageRcmApplianceSpecificDetails), +} #[doc = "Input to apply recovery point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplyRecoveryPointInput { @@ -2764,10 +2775,10 @@ pub struct ApplyRecoveryPointInputProperties { pub recovery_point_id: Option, #[doc = "Provider specific input for apply recovery point."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ApplyRecoveryPointProviderSpecificInput, + pub provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion, } impl ApplyRecoveryPointInputProperties { - pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion) -> Self { Self { recovery_point_id: None, provider_specific_details, @@ -2786,6 +2797,17 @@ impl ApplyRecoveryPointProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplyRecoveryPointProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aApplyRecoveryPointInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationApplyRecoveryPointInput), + HyperVReplicaAzure(HyperVReplicaAzureApplyRecoveryPointInput), + InMageAzureV2(InMageAzureV2ApplyRecoveryPointInput), + InMageRcm(InMageRcmApplyRecoveryPointInput), +} #[doc = "This class represents job details based on specific job type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AsrJobDetails { @@ -3056,6 +3078,13 @@ impl ConfigurationSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ConfigurationSettingsUnion { + HyperVVirtualMachine(HyperVVirtualMachineDetails), + ReplicationGroupDetails(ReplicationGroupDetails), + VMwareVirtualMachine(VMwareVirtualMachineDetails), +} #[doc = "Request to configure alerts for the system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConfigureAlertRequest { @@ -3135,7 +3164,7 @@ pub struct CreateNetworkMappingInputProperties { pub recovery_network_id: String, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl CreateNetworkMappingInputProperties { pub fn new(recovery_network_id: String) -> Self { @@ -3163,7 +3192,7 @@ impl CreatePolicyInput { pub struct CreatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreatePolicyInputProperties { pub fn new() -> Self { @@ -3192,7 +3221,7 @@ pub struct CreateProtectionContainerInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateProtectionContainerInputProperties { pub fn new() -> Self { @@ -3222,7 +3251,7 @@ pub struct CreateProtectionContainerMappingInputProperties { pub policy_id: Option, #[doc = "Provider specific input for pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -3246,7 +3275,7 @@ impl CreateProtectionIntentInput { pub struct CreateProtectionIntentProperties { #[doc = "Create protection intent provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl CreateProtectionIntentProperties { pub fn new() -> Self { @@ -3265,6 +3294,12 @@ impl CreateProtectionIntentProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum CreateProtectionIntentProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aCreateProtectionIntentInput), +} #[doc = "Create recovery plan input class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateRecoveryPlanInput { @@ -3297,7 +3332,7 @@ pub struct CreateRecoveryPlanInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateRecoveryPlanInputProperties { pub fn new(primary_fabric_id: String, recovery_fabric_id: String, groups: Vec) -> Self { @@ -3452,7 +3487,7 @@ pub struct DisableProtectionInputProperties { pub disable_protection_reason: Option, #[doc = "Disable protection provider specific input."] #[serde(rename = "replicationProviderInput", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_input: Option, + pub replication_provider_input: Option, } impl DisableProtectionInputProperties { pub fn new() -> Self { @@ -3511,6 +3546,11 @@ impl DisableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum DisableProtectionProviderSpecificInputUnion { + InMage(InMageDisableProtectionProviderSpecificInput), +} #[doc = "Request to add a physical machine as a protectable item in a container."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiscoverProtectableItemRequest { @@ -3732,10 +3772,10 @@ pub struct EnableMigrationInputProperties { pub policy_id: String, #[doc = "Enable migration provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: EnableMigrationProviderSpecificInput, + pub provider_specific_details: EnableMigrationProviderSpecificInputUnion, } impl EnableMigrationInputProperties { - pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInput) -> Self { + pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInputUnion) -> Self { Self { policy_id, provider_specific_details, @@ -3754,6 +3794,11 @@ impl EnableMigrationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableMigrationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtEnableMigrationInput), +} #[doc = "Enable protection input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnableProtectionInput { @@ -3777,7 +3822,7 @@ pub struct EnableProtectionInputProperties { pub protectable_item_id: Option, #[doc = "Enable protection provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl EnableProtectionInputProperties { pub fn new() -> Self { @@ -3796,6 +3841,18 @@ impl EnableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableProtectionProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationEnableProtectionInput), + #[serde(rename = "A2A")] + A2a(A2aEnableProtectionInput), + HyperVReplicaAzure(HyperVReplicaAzureEnableProtectionInput), + InMageAzureV2(InMageAzureV2EnableProtectionInput), + InMage(InMageEnableProtectionInput), + InMageRcm(InMageRcmEnableProtectionInput), +} #[doc = "Encryption details for the fabric."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EncryptionDetails { @@ -3882,10 +3939,10 @@ pub struct EventProperties { pub fabric_id: Option, #[doc = "Model class for provider specific details for an event."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Model class for event specific details for an event."] #[serde(rename = "eventSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub event_specific_details: Option, + pub event_specific_details: Option, #[doc = "The list of errors / warnings capturing details associated with the issue(s)."] #[serde( rename = "healthErrors", @@ -3912,6 +3969,20 @@ impl EventProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aEventDetails), + HyperVReplica2012(HyperVReplica2012EventDetails), + HyperVReplica2012R2(HyperVReplica2012R2EventDetails), + HyperVReplicaAzure(HyperVReplicaAzureEventDetails), + HyperVReplicaBaseEventDetails(HyperVReplicaBaseEventDetails), + InMageAzureV2(InMageAzureV2EventDetails), + InMageRcm(InMageRcmEventDetails), + InMageRcmFailback(InMageRcmFailbackEventDetails), + VMwareCbt(VMwareCbtEventDetails), +} #[doc = "Implements the event query parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventQueryParameter { @@ -3957,6 +4028,11 @@ impl EventSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventSpecificDetailsUnion { + JobStatus(JobStatusEventDetails), +} #[doc = "Existing storage account input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExistingProtectionProfile { @@ -4192,7 +4268,7 @@ impl FabricCreationInput { pub struct FabricCreationInputProperties { #[doc = "Fabric provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl FabricCreationInputProperties { pub fn new() -> Self { @@ -4219,7 +4295,7 @@ pub struct FabricProperties { pub bcdr_state: Option, #[doc = "Fabric specific details."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "Fabric health error details."] #[serde( rename = "healthErrorDetails", @@ -4303,6 +4379,13 @@ impl FabricSpecificCreateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureCreateNetworkMappingInput), + VmmToAzure(VmmToAzureCreateNetworkMappingInput), + VmmToVmm(VmmToVmmCreateNetworkMappingInput), +} #[doc = "Fabric provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificCreationInput { @@ -4315,6 +4398,13 @@ impl FabricSpecificCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreationInputUnion { + Azure(AzureFabricCreationInput), + InMageRcm(InMageRcmFabricCreationInput), + VMwareV2(VMwareV2FabricCreationInput), +} #[doc = "Fabric specific details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificDetails { @@ -4327,6 +4417,17 @@ impl FabricSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificDetailsUnion { + Azure(AzureFabricSpecificDetails), + HyperVSite(HyperVSiteDetails), + InMageRcm(InMageRcmFabricSpecificDetails), + VMware(VMwareDetails), + VMwareV2(VMwareV2FabricSpecificDetails), + #[serde(rename = "VMM")] + Vmm(VmmDetails), +} #[doc = "Input details specific to fabrics during Network Mapping."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificUpdateNetworkMappingInput { @@ -4339,6 +4440,13 @@ impl FabricSpecificUpdateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificUpdateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureUpdateNetworkMappingInput), + VmmToAzure(VmmToAzureUpdateNetworkMappingInput), + VmmToVmm(VmmToVmmUpdateNetworkMappingInput), +} #[doc = "This class represents the details for a failover job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FailoverJobDetails { @@ -4461,6 +4569,12 @@ impl GroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum GroupTaskDetailsUnion { + InlineWorkflowTaskDetails(InlineWorkflowTaskDetails), + RecoveryPlanGroupTaskDetails(RecoveryPlanGroupTaskDetails), +} #[doc = "Health Error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HealthError { @@ -6040,6 +6154,11 @@ impl HyperVReplicaPolicyInput { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVReplicaPolicyInputUnion { + HyperVReplica2012R2(HyperVReplicaBluePolicyInput), +} #[doc = "HyperV replica 2012 replication details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HyperVReplicaReplicationDetails { @@ -6283,6 +6402,11 @@ pub mod hyper_v_virtual_machine_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVVirtualMachineDetailsUnion { + VmmVirtualMachine(VmmVirtualMachineDetails), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IpConfigDetails { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -11165,6 +11289,15 @@ impl JobDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobDetailsUnion { + AsrJobDetails(AsrJobDetails), + ExportJobDetails(ExportJobDetails), + FailoverJobDetails(FailoverJobDetails), + SwitchProtectionJobDetails(SwitchProtectionJobDetails), + TestFailoverJobDetails(TestFailoverJobDetails), +} #[doc = "This class contains the minimal job details required to navigate to the desired drill down."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobEntity { @@ -11273,7 +11406,7 @@ pub struct JobProperties { pub target_instance_type: Option, #[doc = "Job details based on specific job type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl JobProperties { pub fn new() -> Self { @@ -11401,6 +11534,12 @@ impl JobTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobTaskDetailsUnion { + FabricReplicationGroupTaskDetails(FabricReplicationGroupTaskDetails), + VirtualMachineTaskDetails(VirtualMachineTaskDetails), +} #[doc = "Key Encryption Key (KEK) information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KeyEncryptionKeyInfo { @@ -11685,10 +11824,10 @@ impl MigrateInput { pub struct MigrateInputProperties { #[doc = "Migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: MigrateProviderSpecificInput, + pub provider_specific_details: MigrateProviderSpecificInputUnion, } impl MigrateInputProperties { - pub fn new(provider_specific_details: MigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: MigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -11704,6 +11843,11 @@ impl MigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtMigrateInput), +} #[doc = "Migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationItem { @@ -11820,7 +11964,7 @@ pub struct MigrationItemProperties { pub event_correlation_id: Option, #[doc = "Migration provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl MigrationItemProperties { pub fn new() -> Self { @@ -12025,6 +12169,11 @@ impl MigrationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrationProviderSpecificSettingsUnion { + VMwareCbt(VMwareCbtMigrationDetails), +} #[doc = "Recovery point for a migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationRecoveryPoint { @@ -12229,6 +12378,13 @@ impl NetworkMappingFabricSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum NetworkMappingFabricSpecificSettingsUnion { + AzureToAzure(AzureToAzureNetworkMappingSettings), + VmmToAzure(VmmToAzureNetworkMappingSettings), + VmmToVmm(VmmToVmmNetworkMappingSettings), +} #[doc = "Network Mapping Properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NetworkMappingProperties { @@ -12258,7 +12414,7 @@ pub struct NetworkMappingProperties { pub recovery_fabric_friendly_name: Option, #[doc = "Network Mapping fabric specific settings."] #[serde(rename = "fabricSpecificSettings", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_settings: Option, + pub fabric_specific_settings: Option, } impl NetworkMappingProperties { pub fn new() -> Self { @@ -12549,7 +12705,7 @@ pub struct PlannedFailoverInputProperties { pub failover_direction: Option, #[doc = "Provider specific failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PlannedFailoverInputProperties { pub fn new() -> Self { @@ -12568,6 +12724,13 @@ impl PlannedFailoverProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PlannedFailoverProviderSpecificFailoverInputUnion { + HyperVReplicaAzureFailback(HyperVReplicaAzureFailbackProviderInput), + HyperVReplicaAzure(HyperVReplicaAzurePlannedFailoverProviderInput), + InMageRcmFailback(InMageRcmFailbackPlannedFailoverProviderInput), +} #[doc = "Protection profile details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Policy { @@ -12615,7 +12778,7 @@ pub struct PolicyProperties { pub friendly_name: Option, #[doc = "Base class for Provider specific details for policies."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PolicyProperties { pub fn new() -> Self { @@ -12634,6 +12797,22 @@ impl PolicyProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aPolicyDetails), + HyperVReplicaAzure(HyperVReplicaAzurePolicyDetails), + HyperVReplicaBasePolicyDetails(HyperVReplicaBasePolicyDetails), + HyperVReplica2012R2(HyperVReplicaBluePolicyDetails), + HyperVReplica2012(HyperVReplicaPolicyDetails), + InMageAzureV2(InMageAzureV2PolicyDetails), + InMageBasePolicyDetails(InMageBasePolicyDetails), + InMage(InMagePolicyDetails), + InMageRcmFailback(InMageRcmFailbackPolicyDetails), + InMageRcm(InMageRcmPolicyDetails), + VMwareCbt(VmwareCbtPolicyDetails), +} #[doc = "Base class for provider specific input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyProviderSpecificInput { @@ -12646,6 +12825,21 @@ impl PolicyProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationPolicyCreationInput), + #[serde(rename = "A2A")] + A2a(A2aPolicyCreationInput), + HyperVReplicaAzure(HyperVReplicaAzurePolicyInput), + HyperVReplica2012(HyperVReplicaPolicyInput), + InMageAzureV2(InMageAzureV2PolicyInput), + InMage(InMagePolicyInput), + InMageRcmFailback(InMageRcmFailbackPolicyCreationInput), + InMageRcm(InMageRcmPolicyCreationInput), + VMwareCbt(VMwareCbtPolicyCreationInput), +} #[doc = "Details of the Process Server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessServer { @@ -13285,7 +13479,7 @@ pub struct ProtectableItemProperties { pub supported_replication_providers: Vec, #[doc = "Replication provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl ProtectableItemProperties { pub fn new() -> Self { @@ -13478,7 +13672,7 @@ pub struct ProtectionContainerMappingProperties { pub target_protection_container_friendly_name: Option, #[doc = "Container mapping provider specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Health of pairing."] #[serde(default, skip_serializing_if = "Option::is_none")] pub health: Option, @@ -13526,6 +13720,14 @@ impl ProtectionContainerMappingProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProtectionContainerMappingProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aProtectionContainerMappingDetails), + InMageRcm(InMageRcmProtectionContainerMappingDetails), + VMwareCbt(VMwareCbtProtectionContainerMappingDetails), +} #[doc = "Protection profile custom data details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionContainerProperties { @@ -13568,6 +13770,12 @@ impl ProtectionProfileCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ProtectionProfileCustomDetailsUnion { + Existing(ExistingProtectionProfile), + New(NewProtectionProfile), +} #[doc = "This class contains the error details per object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProviderError { @@ -13604,6 +13812,14 @@ impl ProviderSpecificRecoveryPointDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProviderSpecificRecoveryPointDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aRecoveryPointDetails), + InMageAzureV2(InMageAzureV2RecoveryPointDetails), + InMageRcm(InMageRcmRecoveryPointDetails), +} #[doc = "Push installer details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PushInstallerDetails { @@ -13789,6 +14005,11 @@ impl RecoveryAvailabilitySetCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryAvailabilitySetCustomDetailsUnion { + Existing(ExistingRecoveryAvailabilitySet), +} #[doc = "Recovery plan details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPlan { @@ -13988,14 +14209,14 @@ pub struct RecoveryPlanAction { pub failover_directions: Vec, #[doc = "Recovery plan action custom details."] #[serde(rename = "customDetails")] - pub custom_details: RecoveryPlanActionDetails, + pub custom_details: RecoveryPlanActionDetailsUnion, } impl RecoveryPlanAction { pub fn new( action_name: String, failover_types: Vec, failover_directions: Vec, - custom_details: RecoveryPlanActionDetails, + custom_details: RecoveryPlanActionDetailsUnion, ) -> Self { Self { action_name, @@ -14017,6 +14238,13 @@ impl RecoveryPlanActionDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanActionDetailsUnion { + AutomationRunbookActionDetails(RecoveryPlanAutomationRunbookActionDetails), + ManualActionDetails(RecoveryPlanManualActionDetails), + ScriptActionDetails(RecoveryPlanScriptActionDetails), +} #[doc = "Recovery plan Automation runbook action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanAutomationRunbookActionDetails { @@ -14218,6 +14446,11 @@ impl RecoveryPlanGroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanGroupTaskDetailsUnion { + RecoveryPlanShutdownGroupTaskDetails(RecoveryPlanShutdownGroupTaskDetails), +} #[doc = "Recovery plan HVR Azure failback input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanHyperVReplicaAzureFailbackInput { @@ -14696,7 +14929,7 @@ pub struct RecoveryPlanPlannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanPlannedFailoverInputProperties { pub fn new(failover_direction: recovery_plan_planned_failover_input_properties::FailoverDirection) -> Self { @@ -14815,7 +15048,7 @@ pub struct RecoveryPlanProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanProperties { pub fn new() -> Self { @@ -14849,6 +15082,12 @@ impl RecoveryPlanProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aDetails), +} #[doc = "Recovery plan provider specific failover input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificFailoverInput { @@ -14861,6 +15100,18 @@ impl RecoveryPlanProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificFailoverInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aFailoverInput), + HyperVReplicaAzureFailback(RecoveryPlanHyperVReplicaAzureFailbackInput), + HyperVReplicaAzure(RecoveryPlanHyperVReplicaAzureFailoverInput), + InMageAzureV2(RecoveryPlanInMageAzureV2FailoverInput), + InMage(RecoveryPlanInMageFailoverInput), + InMageRcmFailback(RecoveryPlanInMageRcmFailbackFailoverInput), + InMageRcm(RecoveryPlanInMageRcmFailoverInput), +} #[doc = "Recovery plan provider specific input base class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificInput { @@ -14873,6 +15124,12 @@ impl RecoveryPlanProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aInput), +} #[doc = "Recovery plan script action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanScriptActionDetails { @@ -15007,7 +15264,7 @@ pub struct RecoveryPlanTestFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanTestFailoverInputProperties { pub fn new(failover_direction: recovery_plan_test_failover_input_properties::FailoverDirection, network_type: String) -> Self { @@ -15086,7 +15343,7 @@ pub struct RecoveryPlanUnplannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanUnplannedFailoverInputProperties { pub fn new( @@ -15227,7 +15484,7 @@ pub struct RecoveryPointProperties { pub recovery_point_type: Option, #[doc = "Replication provider specific recovery point details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RecoveryPointProperties { pub fn new() -> Self { @@ -15246,6 +15503,11 @@ impl RecoveryProximityPlacementGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryProximityPlacementGroupCustomDetailsUnion { + Existing(ExistingRecoveryProximityPlacementGroup), +} #[doc = "Recovery Resource Group custom input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryResourceGroupCustomDetails { @@ -15258,6 +15520,11 @@ impl RecoveryResourceGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryResourceGroupCustomDetailsUnion { + Existing(ExistingRecoveryRecoveryResourceGroup), +} #[doc = "Provider details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryServicesProvider { @@ -15392,6 +15659,12 @@ impl RecoveryVirtualNetworkCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryVirtualNetworkCustomDetailsUnion { + Existing(ExistingRecoveryVirtualNetwork), + New(NewRecoveryVirtualNetwork), +} #[doc = "Input for remove disk(s) operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveDisksInput { @@ -15409,7 +15682,7 @@ impl RemoveDisksInput { pub struct RemoveDisksInputProperties { #[doc = "Remove Disk provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RemoveDisksInputProperties { pub fn new() -> Self { @@ -15428,6 +15701,12 @@ impl RemoveDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RemoveDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aRemoveDisksInput), +} #[doc = "Container unpairing input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveProtectionContainerMappingInput { @@ -15578,7 +15857,7 @@ impl ReplicationAppliance { pub struct ReplicationApplianceProperties { #[doc = "Appliance specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationApplianceProperties { pub fn new() -> Self { @@ -15819,7 +16098,7 @@ pub struct ReplicationProtectedItemProperties { pub failover_recovery_point_id: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "The recovery container Id."] #[serde(rename = "recoveryContainerId", default, skip_serializing_if = "Option::is_none")] pub recovery_container_id: Option, @@ -15891,7 +16170,7 @@ pub struct ReplicationProtectionIntentProperties { pub creation_time_utc: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationProtectionIntentProperties { pub fn new() -> Self { @@ -15910,6 +16189,12 @@ impl ReplicationProtectionIntentProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProtectionIntentProviderSpecificSettingsUnion { + #[serde(rename = "A2A")] + A2a(A2aReplicationIntentDetails), +} #[doc = "Provider specific input for unpairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicationProviderContainerUnmappingInput { @@ -15934,6 +16219,15 @@ impl ReplicationProviderSpecificContainerCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerCreationInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerCreationInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationContainerCreationInput), + VMwareCbt(VMwareCbtContainerCreationInput), +} #[doc = "Provider specific input for pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificContainerMappingInput { @@ -15946,6 +16240,13 @@ impl ReplicationProviderSpecificContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerMappingInput), + VMwareCbt(VMwareCbtContainerMappingInput), +} #[doc = "Replication provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificSettings { @@ -15958,6 +16259,22 @@ impl ReplicationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificSettingsUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationReplicationDetails), + #[serde(rename = "A2A")] + A2a(A2aReplicationDetails), + HyperVReplicaAzure(HyperVReplicaAzureReplicationDetails), + HyperVReplicaBaseReplicationDetails(HyperVReplicaBaseReplicationDetails), + HyperVReplica2012R2(HyperVReplicaBlueReplicationDetails), + HyperVReplica2012(HyperVReplicaReplicationDetails), + InMageAzureV2(InMageAzureV2ReplicationDetails), + InMageRcmFailback(InMageRcmFailbackReplicationDetails), + InMageRcm(InMageRcmReplicationDetails), + InMage(InMageReplicationDetails), +} #[doc = "Provider specific input for update pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificUpdateContainerMappingInput { @@ -15970,6 +16287,13 @@ impl ReplicationProviderSpecificUpdateContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificUpdateContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateContainerMappingInput), + InMageRcm(InMageRcmUpdateContainerMappingInput), +} #[doc = "Reprotect agent details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReprotectAgentDetails { @@ -16196,10 +16520,10 @@ impl ResumeReplicationInput { pub struct ResumeReplicationInputProperties { #[doc = "Resume replication provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResumeReplicationProviderSpecificInput, + pub provider_specific_details: ResumeReplicationProviderSpecificInputUnion, } impl ResumeReplicationInputProperties { - pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16215,6 +16539,11 @@ impl ResumeReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResumeReplicationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResumeReplicationInput), +} #[doc = "Resync input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResyncInput { @@ -16231,10 +16560,10 @@ impl ResyncInput { pub struct ResyncInputProperties { #[doc = "Resync provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResyncProviderSpecificInput, + pub provider_specific_details: ResyncProviderSpecificInputUnion, } impl ResyncInputProperties { - pub fn new(provider_specific_details: ResyncProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResyncProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16250,6 +16579,11 @@ impl ResyncProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResyncProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResyncInput), +} #[doc = "The retention details of the MT."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionVolume { @@ -16291,7 +16625,7 @@ pub struct ReverseReplicationInputProperties { pub failover_direction: Option, #[doc = "Provider specific reverse replication input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReverseReplicationInputProperties { pub fn new() -> Self { @@ -16310,6 +16644,17 @@ impl ReverseReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReverseReplicationProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aReprotectInput), + HyperVReplicaAzure(HyperVReplicaAzureReprotectInput), + InMageAzureV2(InMageAzureV2ReprotectInput), + InMageRcmFailback(InMageRcmFailbackReprotectInput), + InMageRcm(InMageRcmReprotectInput), + InMage(InMageReprotectInput), +} #[doc = "Azure role assignment details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleAssignment { @@ -16414,6 +16759,11 @@ impl StorageAccountCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum StorageAccountCustomDetailsUnion { + Existing(ExistingStorageAccount), +} #[doc = "Storage object definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageClassification { @@ -16657,7 +17007,7 @@ pub struct SwitchProtectionInputProperties { pub replication_protected_item_name: Option, #[doc = "Provider specific switch protection input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProtectionInputProperties { pub fn new() -> Self { @@ -16693,6 +17043,12 @@ impl SwitchProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProtectionProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aSwitchProtectionInput), +} #[doc = "Input definition for switch provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SwitchProviderInput { @@ -16713,7 +17069,7 @@ pub struct SwitchProviderInputProperties { pub target_instance_type: Option, #[doc = "Provider specific switch provider input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProviderInputProperties { pub fn new() -> Self { @@ -16732,6 +17088,11 @@ impl SwitchProviderProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProviderProviderSpecificInputUnion { + InMageAzureV2(InMageAzureV2SwitchProviderProviderInput), +} #[doc = "Represents applicable recovery vm sizes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TargetComputeSize { @@ -16838,6 +17199,16 @@ impl TaskTypeDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TaskTypeDetailsUnion { + AutomationRunbookTaskDetails(AutomationRunbookTaskDetails), + ConsistencyCheckTaskDetails(ConsistencyCheckTaskDetails), + JobTaskDetails(JobTaskDetails), + ManualActionTaskDetails(ManualActionTaskDetails), + ScriptActionTaskDetails(ScriptActionTaskDetails), + VmNicUpdatesTaskDetails(VmNicUpdatesTaskDetails), +} #[doc = "Input definition for test failover cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestFailoverCleanupInput { @@ -16886,7 +17257,7 @@ pub struct TestFailoverInputProperties { pub network_id: Option, #[doc = "Provider specific test failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl TestFailoverInputProperties { pub fn new() -> Self { @@ -16947,6 +17318,16 @@ impl TestFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aTestFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureTestFailoverInput), + InMageAzureV2(InMageAzureV2TestFailoverInput), + InMageRcm(InMageRcmTestFailoverInput), + InMage(InMageTestFailoverInput), +} #[doc = "Input for test migrate cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestMigrateCleanupInput { @@ -16986,10 +17367,10 @@ impl TestMigrateInput { pub struct TestMigrateInputProperties { #[doc = "Test migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: TestMigrateProviderSpecificInput, + pub provider_specific_details: TestMigrateProviderSpecificInputUnion, } impl TestMigrateInputProperties { - pub fn new(provider_specific_details: TestMigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: TestMigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -17005,6 +17386,11 @@ impl TestMigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestMigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtTestMigrateInput), +} #[doc = "Input definition for unplanned failover."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UnplannedFailoverInput { @@ -17027,7 +17413,7 @@ pub struct UnplannedFailoverInputProperties { pub source_site_operations: Option, #[doc = "Provider specific unplanned failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UnplannedFailoverInputProperties { pub fn new() -> Self { @@ -17046,6 +17432,16 @@ impl UnplannedFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UnplannedFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUnplannedFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureUnplannedFailoverInput), + InMageAzureV2(InMageAzureV2UnplannedFailoverInput), + InMageRcm(InMageRcmUnplannedFailoverInput), + InMage(InMageUnplannedFailoverInput), +} #[doc = "Update appliance for replication protected item input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateApplianceForReplicationProtectedItemInput { @@ -17065,12 +17461,12 @@ pub struct UpdateApplianceForReplicationProtectedItemInputProperties { pub target_appliance_id: String, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, } impl UpdateApplianceForReplicationProtectedItemInputProperties { pub fn new( target_appliance_id: String, - provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, ) -> Self { Self { target_appliance_id, @@ -17090,6 +17486,11 @@ impl UpdateApplianceForReplicationProtectedItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion { + InMageRcm(InMageRcmUpdateApplianceForReplicationProtectedItemInput), +} #[doc = "Disk input for update."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateDiskInput { @@ -17125,10 +17526,10 @@ impl UpdateMigrationItemInput { pub struct UpdateMigrationItemInputProperties { #[doc = "Update migration item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateMigrationItemProviderSpecificInput, + pub provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion, } impl UpdateMigrationItemInputProperties { - pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -17144,6 +17545,11 @@ impl UpdateMigrationItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateMigrationItemProviderSpecificInputUnion { + VMwareCbt(VMwareCbtUpdateMigrationItemInput), +} #[doc = "Request to update the mobility service on a protected item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateMobilityServiceRequest { @@ -17191,7 +17597,7 @@ pub struct UpdateNetworkMappingInputProperties { pub recovery_network_id: Option, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl UpdateNetworkMappingInputProperties { pub fn new() -> Self { @@ -17215,7 +17621,7 @@ impl UpdatePolicyInput { pub struct UpdatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "replicationProviderSettings", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_settings: Option, + pub replication_provider_settings: Option, } impl UpdatePolicyInputProperties { pub fn new() -> Self { @@ -17239,7 +17645,7 @@ impl UpdateProtectionContainerMappingInput { pub struct UpdateProtectionContainerMappingInputProperties { #[doc = "Provider specific input for update pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl UpdateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -17323,7 +17729,7 @@ pub struct UpdateReplicationProtectedItemInputProperties { pub recovery_availability_set_id: Option, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UpdateReplicationProtectedItemInputProperties { pub fn new() -> Self { @@ -17384,6 +17790,15 @@ impl UpdateReplicationProtectedItemProviderInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateReplicationProtectedItemProviderInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateReplicationProtectedItemInput), + HyperVReplicaAzure(HyperVReplicaAzureUpdateReplicationProtectedItemInput), + InMageAzureV2(InMageAzureV2UpdateReplicationProtectedItemInput), + InMageRcm(InMageRcmUpdateReplicationProtectedItemInput), +} #[doc = "Input required to update vCenter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateVCenterRequest { diff --git a/services/mgmt/recoveryservicessiterecovery/src/package_2023_04/models.rs b/services/mgmt/recoveryservicessiterecovery/src/package_2023_04/models.rs index 58f677b50f..f9fc45460a 100644 --- a/services/mgmt/recoveryservicessiterecovery/src/package_2023_04/models.rs +++ b/services/mgmt/recoveryservicessiterecovery/src/package_2023_04/models.rs @@ -191,7 +191,7 @@ pub struct A2aCreateProtectionIntentInput { pub recovery_availability_type: a2a_create_protection_intent_input::RecoveryAvailabilityType, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfileCustomInput", default, skip_serializing_if = "Option::is_none")] - pub protection_profile_custom_input: Option, + pub protection_profile_custom_input: Option, #[doc = "The recovery resource group Id. Valid for V2 scenarios."] #[serde(rename = "recoveryResourceGroupId")] pub recovery_resource_group_id: String, @@ -201,20 +201,20 @@ pub struct A2aCreateProtectionIntentInput { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySetCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set_custom_input: Option, + pub recovery_availability_set_custom_input: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetworkCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network_custom_input: Option, + pub recovery_virtual_network_custom_input: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde( rename = "recoveryProximityPlacementGroupCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub recovery_proximity_placement_group_custom_input: Option, + pub recovery_proximity_placement_group_custom_input: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -242,7 +242,7 @@ pub struct A2aCreateProtectionIntentInput { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -1168,14 +1168,14 @@ pub struct A2aProtectionIntentDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub recovery_azure_storage_account_custom_input: Option, + pub recovery_azure_storage_account_custom_input: Option, #[doc = "Storage account custom input."] #[serde( rename = "primaryStagingStorageAccountCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, } impl A2aProtectionIntentDiskInputDetails { pub fn new(disk_uri: String) -> Self { @@ -1198,10 +1198,10 @@ pub struct A2aProtectionIntentManagedDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Resource Group custom input."] #[serde(rename = "recoveryResourceGroupCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_resource_group_custom_input: Option, + pub recovery_resource_group_custom_input: Option, #[doc = "The replica disk type. Its an optional value and will be same as source disk type if not user provided."] #[serde(rename = "recoveryReplicaDiskAccountType", default, skip_serializing_if = "Option::is_none")] pub recovery_replica_disk_account_type: Option, @@ -1729,19 +1729,19 @@ pub struct A2aReplicationIntentDetails { pub recovery_resource_group_id: Option, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfile", default, skip_serializing_if = "Option::is_none")] - pub protection_profile: Option, + pub protection_profile: Option, #[doc = "Storage account custom input."] #[serde(rename = "primaryStagingStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub primary_staging_storage_account: Option, + pub primary_staging_storage_account: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySet", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set: Option, + pub recovery_availability_set: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetwork", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network: Option, + pub recovery_virtual_network: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde(rename = "recoveryProximityPlacementGroup", default, skip_serializing_if = "Option::is_none")] - pub recovery_proximity_placement_group: Option, + pub recovery_proximity_placement_group: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -1753,7 +1753,7 @@ pub struct A2aReplicationIntentDetails { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -2444,10 +2444,10 @@ pub struct AsrTask { pub task_type: Option, #[doc = "Task details based on specific task type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "This class represents the group task details when parent child relationship exists in the drill down."] #[serde(rename = "groupTaskCustomDetails", default, skip_serializing_if = "Option::is_none")] - pub group_task_custom_details: Option, + pub group_task_custom_details: Option, #[doc = "The task error details."] #[serde( default, @@ -2478,10 +2478,10 @@ impl AddDisksInput { pub struct AddDisksInputProperties { #[doc = "Add Disks provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: AddDisksProviderSpecificInput, + pub provider_specific_details: AddDisksProviderSpecificInputUnion, } impl AddDisksInputProperties { - pub fn new(provider_specific_details: AddDisksProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: AddDisksProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -2497,6 +2497,12 @@ impl AddDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum AddDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aAddDisksInput), +} #[doc = "Input required to add a provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddRecoveryServicesProviderInput { @@ -2745,6 +2751,11 @@ impl ApplianceSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplianceSpecificDetailsUnion { + InMageRcm(InMageRcmApplianceSpecificDetails), +} #[doc = "Input to apply recovery point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplyRecoveryPointInput { @@ -2764,10 +2775,10 @@ pub struct ApplyRecoveryPointInputProperties { pub recovery_point_id: Option, #[doc = "Provider specific input for apply recovery point."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ApplyRecoveryPointProviderSpecificInput, + pub provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion, } impl ApplyRecoveryPointInputProperties { - pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion) -> Self { Self { recovery_point_id: None, provider_specific_details, @@ -2786,6 +2797,17 @@ impl ApplyRecoveryPointProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplyRecoveryPointProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aApplyRecoveryPointInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationApplyRecoveryPointInput), + HyperVReplicaAzure(HyperVReplicaAzureApplyRecoveryPointInput), + InMageAzureV2(InMageAzureV2ApplyRecoveryPointInput), + InMageRcm(InMageRcmApplyRecoveryPointInput), +} #[doc = "This class represents job details based on specific job type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AsrJobDetails { @@ -3056,6 +3078,13 @@ impl ConfigurationSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ConfigurationSettingsUnion { + HyperVVirtualMachine(HyperVVirtualMachineDetails), + ReplicationGroupDetails(ReplicationGroupDetails), + VMwareVirtualMachine(VMwareVirtualMachineDetails), +} #[doc = "Request to configure alerts for the system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConfigureAlertRequest { @@ -3135,7 +3164,7 @@ pub struct CreateNetworkMappingInputProperties { pub recovery_network_id: String, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl CreateNetworkMappingInputProperties { pub fn new(recovery_network_id: String) -> Self { @@ -3163,7 +3192,7 @@ impl CreatePolicyInput { pub struct CreatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreatePolicyInputProperties { pub fn new() -> Self { @@ -3192,7 +3221,7 @@ pub struct CreateProtectionContainerInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateProtectionContainerInputProperties { pub fn new() -> Self { @@ -3222,7 +3251,7 @@ pub struct CreateProtectionContainerMappingInputProperties { pub policy_id: Option, #[doc = "Provider specific input for pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -3246,7 +3275,7 @@ impl CreateProtectionIntentInput { pub struct CreateProtectionIntentProperties { #[doc = "Create protection intent provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl CreateProtectionIntentProperties { pub fn new() -> Self { @@ -3265,6 +3294,12 @@ impl CreateProtectionIntentProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum CreateProtectionIntentProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aCreateProtectionIntentInput), +} #[doc = "Create recovery plan input class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateRecoveryPlanInput { @@ -3297,7 +3332,7 @@ pub struct CreateRecoveryPlanInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateRecoveryPlanInputProperties { pub fn new(primary_fabric_id: String, recovery_fabric_id: String, groups: Vec) -> Self { @@ -3452,7 +3487,7 @@ pub struct DisableProtectionInputProperties { pub disable_protection_reason: Option, #[doc = "Disable protection provider specific input."] #[serde(rename = "replicationProviderInput", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_input: Option, + pub replication_provider_input: Option, } impl DisableProtectionInputProperties { pub fn new() -> Self { @@ -3511,6 +3546,11 @@ impl DisableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum DisableProtectionProviderSpecificInputUnion { + InMage(InMageDisableProtectionProviderSpecificInput), +} #[doc = "Request to add a physical machine as a protectable item in a container."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiscoverProtectableItemRequest { @@ -3732,10 +3772,10 @@ pub struct EnableMigrationInputProperties { pub policy_id: String, #[doc = "Enable migration provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: EnableMigrationProviderSpecificInput, + pub provider_specific_details: EnableMigrationProviderSpecificInputUnion, } impl EnableMigrationInputProperties { - pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInput) -> Self { + pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInputUnion) -> Self { Self { policy_id, provider_specific_details, @@ -3754,6 +3794,11 @@ impl EnableMigrationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableMigrationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtEnableMigrationInput), +} #[doc = "Enable protection input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnableProtectionInput { @@ -3777,7 +3822,7 @@ pub struct EnableProtectionInputProperties { pub protectable_item_id: Option, #[doc = "Enable protection provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl EnableProtectionInputProperties { pub fn new() -> Self { @@ -3796,6 +3841,18 @@ impl EnableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableProtectionProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationEnableProtectionInput), + #[serde(rename = "A2A")] + A2a(A2aEnableProtectionInput), + HyperVReplicaAzure(HyperVReplicaAzureEnableProtectionInput), + InMageAzureV2(InMageAzureV2EnableProtectionInput), + InMage(InMageEnableProtectionInput), + InMageRcm(InMageRcmEnableProtectionInput), +} #[doc = "Encryption details for the fabric."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EncryptionDetails { @@ -3882,10 +3939,10 @@ pub struct EventProperties { pub fabric_id: Option, #[doc = "Model class for provider specific details for an event."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Model class for event specific details for an event."] #[serde(rename = "eventSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub event_specific_details: Option, + pub event_specific_details: Option, #[doc = "The list of errors / warnings capturing details associated with the issue(s)."] #[serde( rename = "healthErrors", @@ -3912,6 +3969,20 @@ impl EventProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aEventDetails), + HyperVReplica2012(HyperVReplica2012EventDetails), + HyperVReplica2012R2(HyperVReplica2012R2EventDetails), + HyperVReplicaAzure(HyperVReplicaAzureEventDetails), + HyperVReplicaBaseEventDetails(HyperVReplicaBaseEventDetails), + InMageAzureV2(InMageAzureV2EventDetails), + InMageRcm(InMageRcmEventDetails), + InMageRcmFailback(InMageRcmFailbackEventDetails), + VMwareCbt(VMwareCbtEventDetails), +} #[doc = "Implements the event query parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventQueryParameter { @@ -3957,6 +4028,11 @@ impl EventSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventSpecificDetailsUnion { + JobStatus(JobStatusEventDetails), +} #[doc = "Existing storage account input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExistingProtectionProfile { @@ -4192,7 +4268,7 @@ impl FabricCreationInput { pub struct FabricCreationInputProperties { #[doc = "Fabric provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl FabricCreationInputProperties { pub fn new() -> Self { @@ -4219,7 +4295,7 @@ pub struct FabricProperties { pub bcdr_state: Option, #[doc = "Fabric specific details."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "Fabric health error details."] #[serde( rename = "healthErrorDetails", @@ -4303,6 +4379,13 @@ impl FabricSpecificCreateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureCreateNetworkMappingInput), + VmmToAzure(VmmToAzureCreateNetworkMappingInput), + VmmToVmm(VmmToVmmCreateNetworkMappingInput), +} #[doc = "Fabric provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificCreationInput { @@ -4315,6 +4398,13 @@ impl FabricSpecificCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreationInputUnion { + Azure(AzureFabricCreationInput), + InMageRcm(InMageRcmFabricCreationInput), + VMwareV2(VMwareV2FabricCreationInput), +} #[doc = "Fabric specific details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificDetails { @@ -4327,6 +4417,17 @@ impl FabricSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificDetailsUnion { + Azure(AzureFabricSpecificDetails), + HyperVSite(HyperVSiteDetails), + InMageRcm(InMageRcmFabricSpecificDetails), + VMware(VMwareDetails), + VMwareV2(VMwareV2FabricSpecificDetails), + #[serde(rename = "VMM")] + Vmm(VmmDetails), +} #[doc = "Input details specific to fabrics during Network Mapping."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificUpdateNetworkMappingInput { @@ -4339,6 +4440,13 @@ impl FabricSpecificUpdateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificUpdateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureUpdateNetworkMappingInput), + VmmToAzure(VmmToAzureUpdateNetworkMappingInput), + VmmToVmm(VmmToVmmUpdateNetworkMappingInput), +} #[doc = "This class represents the details for a failover job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FailoverJobDetails { @@ -4461,6 +4569,12 @@ impl GroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum GroupTaskDetailsUnion { + InlineWorkflowTaskDetails(InlineWorkflowTaskDetails), + RecoveryPlanGroupTaskDetails(RecoveryPlanGroupTaskDetails), +} #[doc = "Health Error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HealthError { @@ -6040,6 +6154,11 @@ impl HyperVReplicaPolicyInput { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVReplicaPolicyInputUnion { + HyperVReplica2012R2(HyperVReplicaBluePolicyInput), +} #[doc = "HyperV replica 2012 replication details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HyperVReplicaReplicationDetails { @@ -6283,6 +6402,11 @@ pub mod hyper_v_virtual_machine_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVVirtualMachineDetailsUnion { + VmmVirtualMachine(VmmVirtualMachineDetails), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IpConfigDetails { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -11165,6 +11289,15 @@ impl JobDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobDetailsUnion { + AsrJobDetails(AsrJobDetails), + ExportJobDetails(ExportJobDetails), + FailoverJobDetails(FailoverJobDetails), + SwitchProtectionJobDetails(SwitchProtectionJobDetails), + TestFailoverJobDetails(TestFailoverJobDetails), +} #[doc = "This class contains the minimal job details required to navigate to the desired drill down."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobEntity { @@ -11273,7 +11406,7 @@ pub struct JobProperties { pub target_instance_type: Option, #[doc = "Job details based on specific job type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl JobProperties { pub fn new() -> Self { @@ -11401,6 +11534,12 @@ impl JobTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobTaskDetailsUnion { + FabricReplicationGroupTaskDetails(FabricReplicationGroupTaskDetails), + VirtualMachineTaskDetails(VirtualMachineTaskDetails), +} #[doc = "Key Encryption Key (KEK) information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KeyEncryptionKeyInfo { @@ -11685,10 +11824,10 @@ impl MigrateInput { pub struct MigrateInputProperties { #[doc = "Migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: MigrateProviderSpecificInput, + pub provider_specific_details: MigrateProviderSpecificInputUnion, } impl MigrateInputProperties { - pub fn new(provider_specific_details: MigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: MigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -11704,6 +11843,11 @@ impl MigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtMigrateInput), +} #[doc = "Migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationItem { @@ -11820,7 +11964,7 @@ pub struct MigrationItemProperties { pub event_correlation_id: Option, #[doc = "Migration provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl MigrationItemProperties { pub fn new() -> Self { @@ -12025,6 +12169,11 @@ impl MigrationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrationProviderSpecificSettingsUnion { + VMwareCbt(VMwareCbtMigrationDetails), +} #[doc = "Recovery point for a migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationRecoveryPoint { @@ -12229,6 +12378,13 @@ impl NetworkMappingFabricSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum NetworkMappingFabricSpecificSettingsUnion { + AzureToAzure(AzureToAzureNetworkMappingSettings), + VmmToAzure(VmmToAzureNetworkMappingSettings), + VmmToVmm(VmmToVmmNetworkMappingSettings), +} #[doc = "Network Mapping Properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NetworkMappingProperties { @@ -12258,7 +12414,7 @@ pub struct NetworkMappingProperties { pub recovery_fabric_friendly_name: Option, #[doc = "Network Mapping fabric specific settings."] #[serde(rename = "fabricSpecificSettings", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_settings: Option, + pub fabric_specific_settings: Option, } impl NetworkMappingProperties { pub fn new() -> Self { @@ -12549,7 +12705,7 @@ pub struct PlannedFailoverInputProperties { pub failover_direction: Option, #[doc = "Provider specific failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PlannedFailoverInputProperties { pub fn new() -> Self { @@ -12568,6 +12724,13 @@ impl PlannedFailoverProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PlannedFailoverProviderSpecificFailoverInputUnion { + HyperVReplicaAzureFailback(HyperVReplicaAzureFailbackProviderInput), + HyperVReplicaAzure(HyperVReplicaAzurePlannedFailoverProviderInput), + InMageRcmFailback(InMageRcmFailbackPlannedFailoverProviderInput), +} #[doc = "Protection profile details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Policy { @@ -12615,7 +12778,7 @@ pub struct PolicyProperties { pub friendly_name: Option, #[doc = "Base class for Provider specific details for policies."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PolicyProperties { pub fn new() -> Self { @@ -12634,6 +12797,22 @@ impl PolicyProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aPolicyDetails), + HyperVReplicaAzure(HyperVReplicaAzurePolicyDetails), + HyperVReplicaBasePolicyDetails(HyperVReplicaBasePolicyDetails), + HyperVReplica2012R2(HyperVReplicaBluePolicyDetails), + HyperVReplica2012(HyperVReplicaPolicyDetails), + InMageAzureV2(InMageAzureV2PolicyDetails), + InMageBasePolicyDetails(InMageBasePolicyDetails), + InMage(InMagePolicyDetails), + InMageRcmFailback(InMageRcmFailbackPolicyDetails), + InMageRcm(InMageRcmPolicyDetails), + VMwareCbt(VmwareCbtPolicyDetails), +} #[doc = "Base class for provider specific input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyProviderSpecificInput { @@ -12646,6 +12825,21 @@ impl PolicyProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationPolicyCreationInput), + #[serde(rename = "A2A")] + A2a(A2aPolicyCreationInput), + HyperVReplicaAzure(HyperVReplicaAzurePolicyInput), + HyperVReplica2012(HyperVReplicaPolicyInput), + InMageAzureV2(InMageAzureV2PolicyInput), + InMage(InMagePolicyInput), + InMageRcmFailback(InMageRcmFailbackPolicyCreationInput), + InMageRcm(InMageRcmPolicyCreationInput), + VMwareCbt(VMwareCbtPolicyCreationInput), +} #[doc = "Details of the Process Server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessServer { @@ -13285,7 +13479,7 @@ pub struct ProtectableItemProperties { pub supported_replication_providers: Vec, #[doc = "Replication provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl ProtectableItemProperties { pub fn new() -> Self { @@ -13478,7 +13672,7 @@ pub struct ProtectionContainerMappingProperties { pub target_protection_container_friendly_name: Option, #[doc = "Container mapping provider specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Health of pairing."] #[serde(default, skip_serializing_if = "Option::is_none")] pub health: Option, @@ -13526,6 +13720,14 @@ impl ProtectionContainerMappingProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProtectionContainerMappingProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aProtectionContainerMappingDetails), + InMageRcm(InMageRcmProtectionContainerMappingDetails), + VMwareCbt(VMwareCbtProtectionContainerMappingDetails), +} #[doc = "Protection profile custom data details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionContainerProperties { @@ -13568,6 +13770,12 @@ impl ProtectionProfileCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ProtectionProfileCustomDetailsUnion { + Existing(ExistingProtectionProfile), + New(NewProtectionProfile), +} #[doc = "This class contains the error details per object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProviderError { @@ -13604,6 +13812,14 @@ impl ProviderSpecificRecoveryPointDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProviderSpecificRecoveryPointDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aRecoveryPointDetails), + InMageAzureV2(InMageAzureV2RecoveryPointDetails), + InMageRcm(InMageRcmRecoveryPointDetails), +} #[doc = "Push installer details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PushInstallerDetails { @@ -13789,6 +14005,11 @@ impl RecoveryAvailabilitySetCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryAvailabilitySetCustomDetailsUnion { + Existing(ExistingRecoveryAvailabilitySet), +} #[doc = "Recovery plan details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPlan { @@ -13988,14 +14209,14 @@ pub struct RecoveryPlanAction { pub failover_directions: Vec, #[doc = "Recovery plan action custom details."] #[serde(rename = "customDetails")] - pub custom_details: RecoveryPlanActionDetails, + pub custom_details: RecoveryPlanActionDetailsUnion, } impl RecoveryPlanAction { pub fn new( action_name: String, failover_types: Vec, failover_directions: Vec, - custom_details: RecoveryPlanActionDetails, + custom_details: RecoveryPlanActionDetailsUnion, ) -> Self { Self { action_name, @@ -14017,6 +14238,13 @@ impl RecoveryPlanActionDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanActionDetailsUnion { + AutomationRunbookActionDetails(RecoveryPlanAutomationRunbookActionDetails), + ManualActionDetails(RecoveryPlanManualActionDetails), + ScriptActionDetails(RecoveryPlanScriptActionDetails), +} #[doc = "Recovery plan Automation runbook action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanAutomationRunbookActionDetails { @@ -14218,6 +14446,11 @@ impl RecoveryPlanGroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanGroupTaskDetailsUnion { + RecoveryPlanShutdownGroupTaskDetails(RecoveryPlanShutdownGroupTaskDetails), +} #[doc = "Recovery plan HVR Azure failback input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanHyperVReplicaAzureFailbackInput { @@ -14696,7 +14929,7 @@ pub struct RecoveryPlanPlannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanPlannedFailoverInputProperties { pub fn new(failover_direction: recovery_plan_planned_failover_input_properties::FailoverDirection) -> Self { @@ -14815,7 +15048,7 @@ pub struct RecoveryPlanProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanProperties { pub fn new() -> Self { @@ -14849,6 +15082,12 @@ impl RecoveryPlanProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aDetails), +} #[doc = "Recovery plan provider specific failover input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificFailoverInput { @@ -14861,6 +15100,18 @@ impl RecoveryPlanProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificFailoverInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aFailoverInput), + HyperVReplicaAzureFailback(RecoveryPlanHyperVReplicaAzureFailbackInput), + HyperVReplicaAzure(RecoveryPlanHyperVReplicaAzureFailoverInput), + InMageAzureV2(RecoveryPlanInMageAzureV2FailoverInput), + InMage(RecoveryPlanInMageFailoverInput), + InMageRcmFailback(RecoveryPlanInMageRcmFailbackFailoverInput), + InMageRcm(RecoveryPlanInMageRcmFailoverInput), +} #[doc = "Recovery plan provider specific input base class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificInput { @@ -14873,6 +15124,12 @@ impl RecoveryPlanProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aInput), +} #[doc = "Recovery plan script action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanScriptActionDetails { @@ -15007,7 +15264,7 @@ pub struct RecoveryPlanTestFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanTestFailoverInputProperties { pub fn new(failover_direction: recovery_plan_test_failover_input_properties::FailoverDirection, network_type: String) -> Self { @@ -15086,7 +15343,7 @@ pub struct RecoveryPlanUnplannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanUnplannedFailoverInputProperties { pub fn new( @@ -15227,7 +15484,7 @@ pub struct RecoveryPointProperties { pub recovery_point_type: Option, #[doc = "Replication provider specific recovery point details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RecoveryPointProperties { pub fn new() -> Self { @@ -15246,6 +15503,11 @@ impl RecoveryProximityPlacementGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryProximityPlacementGroupCustomDetailsUnion { + Existing(ExistingRecoveryProximityPlacementGroup), +} #[doc = "Recovery Resource Group custom input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryResourceGroupCustomDetails { @@ -15258,6 +15520,11 @@ impl RecoveryResourceGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryResourceGroupCustomDetailsUnion { + Existing(ExistingRecoveryRecoveryResourceGroup), +} #[doc = "Provider details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryServicesProvider { @@ -15392,6 +15659,12 @@ impl RecoveryVirtualNetworkCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryVirtualNetworkCustomDetailsUnion { + Existing(ExistingRecoveryVirtualNetwork), + New(NewRecoveryVirtualNetwork), +} #[doc = "Input for remove disk(s) operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveDisksInput { @@ -15409,7 +15682,7 @@ impl RemoveDisksInput { pub struct RemoveDisksInputProperties { #[doc = "Remove Disk provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RemoveDisksInputProperties { pub fn new() -> Self { @@ -15428,6 +15701,12 @@ impl RemoveDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RemoveDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aRemoveDisksInput), +} #[doc = "Container unpairing input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveProtectionContainerMappingInput { @@ -15578,7 +15857,7 @@ impl ReplicationAppliance { pub struct ReplicationApplianceProperties { #[doc = "Appliance specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationApplianceProperties { pub fn new() -> Self { @@ -15819,7 +16098,7 @@ pub struct ReplicationProtectedItemProperties { pub failover_recovery_point_id: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "The recovery container Id."] #[serde(rename = "recoveryContainerId", default, skip_serializing_if = "Option::is_none")] pub recovery_container_id: Option, @@ -15891,7 +16170,7 @@ pub struct ReplicationProtectionIntentProperties { pub creation_time_utc: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationProtectionIntentProperties { pub fn new() -> Self { @@ -15910,6 +16189,12 @@ impl ReplicationProtectionIntentProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProtectionIntentProviderSpecificSettingsUnion { + #[serde(rename = "A2A")] + A2a(A2aReplicationIntentDetails), +} #[doc = "Provider specific input for unpairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicationProviderContainerUnmappingInput { @@ -15934,6 +16219,15 @@ impl ReplicationProviderSpecificContainerCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerCreationInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerCreationInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationContainerCreationInput), + VMwareCbt(VMwareCbtContainerCreationInput), +} #[doc = "Provider specific input for pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificContainerMappingInput { @@ -15946,6 +16240,13 @@ impl ReplicationProviderSpecificContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerMappingInput), + VMwareCbt(VMwareCbtContainerMappingInput), +} #[doc = "Replication provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificSettings { @@ -15958,6 +16259,22 @@ impl ReplicationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificSettingsUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationReplicationDetails), + #[serde(rename = "A2A")] + A2a(A2aReplicationDetails), + HyperVReplicaAzure(HyperVReplicaAzureReplicationDetails), + HyperVReplicaBaseReplicationDetails(HyperVReplicaBaseReplicationDetails), + HyperVReplica2012R2(HyperVReplicaBlueReplicationDetails), + HyperVReplica2012(HyperVReplicaReplicationDetails), + InMageAzureV2(InMageAzureV2ReplicationDetails), + InMageRcmFailback(InMageRcmFailbackReplicationDetails), + InMageRcm(InMageRcmReplicationDetails), + InMage(InMageReplicationDetails), +} #[doc = "Provider specific input for update pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificUpdateContainerMappingInput { @@ -15970,6 +16287,13 @@ impl ReplicationProviderSpecificUpdateContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificUpdateContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateContainerMappingInput), + InMageRcm(InMageRcmUpdateContainerMappingInput), +} #[doc = "Reprotect agent details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReprotectAgentDetails { @@ -16196,10 +16520,10 @@ impl ResumeReplicationInput { pub struct ResumeReplicationInputProperties { #[doc = "Resume replication provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResumeReplicationProviderSpecificInput, + pub provider_specific_details: ResumeReplicationProviderSpecificInputUnion, } impl ResumeReplicationInputProperties { - pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16215,6 +16539,11 @@ impl ResumeReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResumeReplicationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResumeReplicationInput), +} #[doc = "Resync input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResyncInput { @@ -16231,10 +16560,10 @@ impl ResyncInput { pub struct ResyncInputProperties { #[doc = "Resync provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResyncProviderSpecificInput, + pub provider_specific_details: ResyncProviderSpecificInputUnion, } impl ResyncInputProperties { - pub fn new(provider_specific_details: ResyncProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResyncProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16250,6 +16579,11 @@ impl ResyncProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResyncProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResyncInput), +} #[doc = "The retention details of the MT."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionVolume { @@ -16291,7 +16625,7 @@ pub struct ReverseReplicationInputProperties { pub failover_direction: Option, #[doc = "Provider specific reverse replication input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReverseReplicationInputProperties { pub fn new() -> Self { @@ -16310,6 +16644,17 @@ impl ReverseReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReverseReplicationProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aReprotectInput), + HyperVReplicaAzure(HyperVReplicaAzureReprotectInput), + InMageAzureV2(InMageAzureV2ReprotectInput), + InMageRcmFailback(InMageRcmFailbackReprotectInput), + InMageRcm(InMageRcmReprotectInput), + InMage(InMageReprotectInput), +} #[doc = "Azure role assignment details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleAssignment { @@ -16414,6 +16759,11 @@ impl StorageAccountCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum StorageAccountCustomDetailsUnion { + Existing(ExistingStorageAccount), +} #[doc = "Storage object definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageClassification { @@ -16657,7 +17007,7 @@ pub struct SwitchProtectionInputProperties { pub replication_protected_item_name: Option, #[doc = "Provider specific switch protection input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProtectionInputProperties { pub fn new() -> Self { @@ -16693,6 +17043,12 @@ impl SwitchProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProtectionProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aSwitchProtectionInput), +} #[doc = "Input definition for switch provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SwitchProviderInput { @@ -16713,7 +17069,7 @@ pub struct SwitchProviderInputProperties { pub target_instance_type: Option, #[doc = "Provider specific switch provider input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProviderInputProperties { pub fn new() -> Self { @@ -16732,6 +17088,11 @@ impl SwitchProviderProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProviderProviderSpecificInputUnion { + InMageAzureV2(InMageAzureV2SwitchProviderProviderInput), +} #[doc = "Represents applicable recovery vm sizes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TargetComputeSize { @@ -16838,6 +17199,16 @@ impl TaskTypeDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TaskTypeDetailsUnion { + AutomationRunbookTaskDetails(AutomationRunbookTaskDetails), + ConsistencyCheckTaskDetails(ConsistencyCheckTaskDetails), + JobTaskDetails(JobTaskDetails), + ManualActionTaskDetails(ManualActionTaskDetails), + ScriptActionTaskDetails(ScriptActionTaskDetails), + VmNicUpdatesTaskDetails(VmNicUpdatesTaskDetails), +} #[doc = "Input definition for test failover cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestFailoverCleanupInput { @@ -16886,7 +17257,7 @@ pub struct TestFailoverInputProperties { pub network_id: Option, #[doc = "Provider specific test failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl TestFailoverInputProperties { pub fn new() -> Self { @@ -16947,6 +17318,16 @@ impl TestFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aTestFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureTestFailoverInput), + InMageAzureV2(InMageAzureV2TestFailoverInput), + InMageRcm(InMageRcmTestFailoverInput), + InMage(InMageTestFailoverInput), +} #[doc = "Input for test migrate cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestMigrateCleanupInput { @@ -16986,10 +17367,10 @@ impl TestMigrateInput { pub struct TestMigrateInputProperties { #[doc = "Test migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: TestMigrateProviderSpecificInput, + pub provider_specific_details: TestMigrateProviderSpecificInputUnion, } impl TestMigrateInputProperties { - pub fn new(provider_specific_details: TestMigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: TestMigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -17005,6 +17386,11 @@ impl TestMigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestMigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtTestMigrateInput), +} #[doc = "Input definition for unplanned failover."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UnplannedFailoverInput { @@ -17027,7 +17413,7 @@ pub struct UnplannedFailoverInputProperties { pub source_site_operations: Option, #[doc = "Provider specific unplanned failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UnplannedFailoverInputProperties { pub fn new() -> Self { @@ -17046,6 +17432,16 @@ impl UnplannedFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UnplannedFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUnplannedFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureUnplannedFailoverInput), + InMageAzureV2(InMageAzureV2UnplannedFailoverInput), + InMageRcm(InMageRcmUnplannedFailoverInput), + InMage(InMageUnplannedFailoverInput), +} #[doc = "Update appliance for replication protected item input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateApplianceForReplicationProtectedItemInput { @@ -17065,12 +17461,12 @@ pub struct UpdateApplianceForReplicationProtectedItemInputProperties { pub target_appliance_id: String, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, } impl UpdateApplianceForReplicationProtectedItemInputProperties { pub fn new( target_appliance_id: String, - provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, ) -> Self { Self { target_appliance_id, @@ -17090,6 +17486,11 @@ impl UpdateApplianceForReplicationProtectedItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion { + InMageRcm(InMageRcmUpdateApplianceForReplicationProtectedItemInput), +} #[doc = "Disk input for update."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateDiskInput { @@ -17125,10 +17526,10 @@ impl UpdateMigrationItemInput { pub struct UpdateMigrationItemInputProperties { #[doc = "Update migration item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateMigrationItemProviderSpecificInput, + pub provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion, } impl UpdateMigrationItemInputProperties { - pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -17144,6 +17545,11 @@ impl UpdateMigrationItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateMigrationItemProviderSpecificInputUnion { + VMwareCbt(VMwareCbtUpdateMigrationItemInput), +} #[doc = "Request to update the mobility service on a protected item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateMobilityServiceRequest { @@ -17191,7 +17597,7 @@ pub struct UpdateNetworkMappingInputProperties { pub recovery_network_id: Option, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl UpdateNetworkMappingInputProperties { pub fn new() -> Self { @@ -17215,7 +17621,7 @@ impl UpdatePolicyInput { pub struct UpdatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "replicationProviderSettings", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_settings: Option, + pub replication_provider_settings: Option, } impl UpdatePolicyInputProperties { pub fn new() -> Self { @@ -17239,7 +17645,7 @@ impl UpdateProtectionContainerMappingInput { pub struct UpdateProtectionContainerMappingInputProperties { #[doc = "Provider specific input for update pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl UpdateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -17323,7 +17729,7 @@ pub struct UpdateReplicationProtectedItemInputProperties { pub recovery_availability_set_id: Option, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UpdateReplicationProtectedItemInputProperties { pub fn new() -> Self { @@ -17384,6 +17790,15 @@ impl UpdateReplicationProtectedItemProviderInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateReplicationProtectedItemProviderInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateReplicationProtectedItemInput), + HyperVReplicaAzure(HyperVReplicaAzureUpdateReplicationProtectedItemInput), + InMageAzureV2(InMageAzureV2UpdateReplicationProtectedItemInput), + InMageRcm(InMageRcmUpdateReplicationProtectedItemInput), +} #[doc = "Input required to update vCenter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateVCenterRequest { diff --git a/services/mgmt/recoveryservicessiterecovery/src/package_2023_06/models.rs b/services/mgmt/recoveryservicessiterecovery/src/package_2023_06/models.rs index ec281f83c7..eb232c30c6 100644 --- a/services/mgmt/recoveryservicessiterecovery/src/package_2023_06/models.rs +++ b/services/mgmt/recoveryservicessiterecovery/src/package_2023_06/models.rs @@ -191,7 +191,7 @@ pub struct A2aCreateProtectionIntentInput { pub recovery_availability_type: a2a_create_protection_intent_input::RecoveryAvailabilityType, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfileCustomInput", default, skip_serializing_if = "Option::is_none")] - pub protection_profile_custom_input: Option, + pub protection_profile_custom_input: Option, #[doc = "The recovery resource group Id. Valid for V2 scenarios."] #[serde(rename = "recoveryResourceGroupId")] pub recovery_resource_group_id: String, @@ -201,20 +201,20 @@ pub struct A2aCreateProtectionIntentInput { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySetCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set_custom_input: Option, + pub recovery_availability_set_custom_input: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetworkCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network_custom_input: Option, + pub recovery_virtual_network_custom_input: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde( rename = "recoveryProximityPlacementGroupCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub recovery_proximity_placement_group_custom_input: Option, + pub recovery_proximity_placement_group_custom_input: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -242,7 +242,7 @@ pub struct A2aCreateProtectionIntentInput { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -1168,14 +1168,14 @@ pub struct A2aProtectionIntentDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub recovery_azure_storage_account_custom_input: Option, + pub recovery_azure_storage_account_custom_input: Option, #[doc = "Storage account custom input."] #[serde( rename = "primaryStagingStorageAccountCustomInput", default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, } impl A2aProtectionIntentDiskInputDetails { pub fn new(disk_uri: String) -> Self { @@ -1198,10 +1198,10 @@ pub struct A2aProtectionIntentManagedDiskInputDetails { default, skip_serializing_if = "Option::is_none" )] - pub primary_staging_storage_account_custom_input: Option, + pub primary_staging_storage_account_custom_input: Option, #[doc = "Recovery Resource Group custom input."] #[serde(rename = "recoveryResourceGroupCustomInput", default, skip_serializing_if = "Option::is_none")] - pub recovery_resource_group_custom_input: Option, + pub recovery_resource_group_custom_input: Option, #[doc = "The replica disk type. Its an optional value and will be same as source disk type if not user provided."] #[serde(rename = "recoveryReplicaDiskAccountType", default, skip_serializing_if = "Option::is_none")] pub recovery_replica_disk_account_type: Option, @@ -1770,19 +1770,19 @@ pub struct A2aReplicationIntentDetails { pub recovery_resource_group_id: Option, #[doc = "Protection Profile custom input."] #[serde(rename = "protectionProfile", default, skip_serializing_if = "Option::is_none")] - pub protection_profile: Option, + pub protection_profile: Option, #[doc = "Storage account custom input."] #[serde(rename = "primaryStagingStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub primary_staging_storage_account: Option, + pub primary_staging_storage_account: Option, #[doc = "Recovery Availability Set custom input."] #[serde(rename = "recoveryAvailabilitySet", default, skip_serializing_if = "Option::is_none")] - pub recovery_availability_set: Option, + pub recovery_availability_set: Option, #[doc = "Recovery Virtual network custom input."] #[serde(rename = "recoveryVirtualNetwork", default, skip_serializing_if = "Option::is_none")] - pub recovery_virtual_network: Option, + pub recovery_virtual_network: Option, #[doc = "Recovery Proximity placement group custom input."] #[serde(rename = "recoveryProximityPlacementGroup", default, skip_serializing_if = "Option::is_none")] - pub recovery_proximity_placement_group: Option, + pub recovery_proximity_placement_group: Option, #[doc = "A value indicating whether the auto protection is enabled."] #[serde(rename = "autoProtectionOfDataDisk", default, skip_serializing_if = "Option::is_none")] pub auto_protection_of_data_disk: Option, @@ -1794,7 +1794,7 @@ pub struct A2aReplicationIntentDetails { pub multi_vm_group_id: Option, #[doc = "Storage account custom input."] #[serde(rename = "recoveryBootDiagStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub recovery_boot_diag_storage_account: Option, + pub recovery_boot_diag_storage_account: Option, #[doc = "Recovery disk encryption info (BEK and KEK)."] #[serde(rename = "diskEncryptionInfo", default, skip_serializing_if = "Option::is_none")] pub disk_encryption_info: Option, @@ -2485,10 +2485,10 @@ pub struct AsrTask { pub task_type: Option, #[doc = "Task details based on specific task type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "This class represents the group task details when parent child relationship exists in the drill down."] #[serde(rename = "groupTaskCustomDetails", default, skip_serializing_if = "Option::is_none")] - pub group_task_custom_details: Option, + pub group_task_custom_details: Option, #[doc = "The task error details."] #[serde( default, @@ -2519,10 +2519,10 @@ impl AddDisksInput { pub struct AddDisksInputProperties { #[doc = "Add Disks provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: AddDisksProviderSpecificInput, + pub provider_specific_details: AddDisksProviderSpecificInputUnion, } impl AddDisksInputProperties { - pub fn new(provider_specific_details: AddDisksProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: AddDisksProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -2538,6 +2538,12 @@ impl AddDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum AddDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aAddDisksInput), +} #[doc = "Input required to add a provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddRecoveryServicesProviderInput { @@ -2839,6 +2845,11 @@ impl ApplianceSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplianceSpecificDetailsUnion { + InMageRcm(InMageRcmApplianceSpecificDetails), +} #[doc = "Input to apply recovery point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplyRecoveryPointInput { @@ -2858,10 +2869,10 @@ pub struct ApplyRecoveryPointInputProperties { pub recovery_point_id: Option, #[doc = "Provider specific input for apply recovery point."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ApplyRecoveryPointProviderSpecificInput, + pub provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion, } impl ApplyRecoveryPointInputProperties { - pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ApplyRecoveryPointProviderSpecificInputUnion) -> Self { Self { recovery_point_id: None, provider_specific_details, @@ -2880,6 +2891,17 @@ impl ApplyRecoveryPointProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ApplyRecoveryPointProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aApplyRecoveryPointInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationApplyRecoveryPointInput), + HyperVReplicaAzure(HyperVReplicaAzureApplyRecoveryPointInput), + InMageAzureV2(InMageAzureV2ApplyRecoveryPointInput), + InMageRcm(InMageRcmApplyRecoveryPointInput), +} #[doc = "This class represents job details based on specific job type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AsrJobDetails { @@ -3150,6 +3172,13 @@ impl ConfigurationSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ConfigurationSettingsUnion { + HyperVVirtualMachine(HyperVVirtualMachineDetails), + ReplicationGroupDetails(ReplicationGroupDetails), + VMwareVirtualMachine(VMwareVirtualMachineDetails), +} #[doc = "Request to configure alerts for the system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConfigureAlertRequest { @@ -3229,7 +3258,7 @@ pub struct CreateNetworkMappingInputProperties { pub recovery_network_id: String, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl CreateNetworkMappingInputProperties { pub fn new(recovery_network_id: String) -> Self { @@ -3257,7 +3286,7 @@ impl CreatePolicyInput { pub struct CreatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreatePolicyInputProperties { pub fn new() -> Self { @@ -3286,7 +3315,7 @@ pub struct CreateProtectionContainerInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateProtectionContainerInputProperties { pub fn new() -> Self { @@ -3316,7 +3345,7 @@ pub struct CreateProtectionContainerMappingInputProperties { pub policy_id: Option, #[doc = "Provider specific input for pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl CreateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -3340,7 +3369,7 @@ impl CreateProtectionIntentInput { pub struct CreateProtectionIntentProperties { #[doc = "Create protection intent provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl CreateProtectionIntentProperties { pub fn new() -> Self { @@ -3359,6 +3388,12 @@ impl CreateProtectionIntentProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum CreateProtectionIntentProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aCreateProtectionIntentInput), +} #[doc = "Create recovery plan input class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateRecoveryPlanInput { @@ -3391,7 +3426,7 @@ pub struct CreateRecoveryPlanInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_input: Vec, + pub provider_specific_input: Vec, } impl CreateRecoveryPlanInputProperties { pub fn new(primary_fabric_id: String, recovery_fabric_id: String, groups: Vec) -> Self { @@ -3564,7 +3599,7 @@ pub struct DisableProtectionInputProperties { pub disable_protection_reason: Option, #[doc = "Disable protection provider specific input."] #[serde(rename = "replicationProviderInput", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_input: Option, + pub replication_provider_input: Option, } impl DisableProtectionInputProperties { pub fn new() -> Self { @@ -3623,6 +3658,11 @@ impl DisableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum DisableProtectionProviderSpecificInputUnion { + InMage(InMageDisableProtectionProviderSpecificInput), +} #[doc = "Request to add a physical machine as a protectable item in a container."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiscoverProtectableItemRequest { @@ -3844,10 +3884,10 @@ pub struct EnableMigrationInputProperties { pub policy_id: String, #[doc = "Enable migration provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: EnableMigrationProviderSpecificInput, + pub provider_specific_details: EnableMigrationProviderSpecificInputUnion, } impl EnableMigrationInputProperties { - pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInput) -> Self { + pub fn new(policy_id: String, provider_specific_details: EnableMigrationProviderSpecificInputUnion) -> Self { Self { policy_id, provider_specific_details, @@ -3866,6 +3906,11 @@ impl EnableMigrationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableMigrationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtEnableMigrationInput), +} #[doc = "Enable protection input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnableProtectionInput { @@ -3889,7 +3934,7 @@ pub struct EnableProtectionInputProperties { pub protectable_item_id: Option, #[doc = "Enable protection provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl EnableProtectionInputProperties { pub fn new() -> Self { @@ -3908,6 +3953,18 @@ impl EnableProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EnableProtectionProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationEnableProtectionInput), + #[serde(rename = "A2A")] + A2a(A2aEnableProtectionInput), + HyperVReplicaAzure(HyperVReplicaAzureEnableProtectionInput), + InMageAzureV2(InMageAzureV2EnableProtectionInput), + InMage(InMageEnableProtectionInput), + InMageRcm(InMageRcmEnableProtectionInput), +} #[doc = "Encryption details for the fabric."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EncryptionDetails { @@ -3994,10 +4051,10 @@ pub struct EventProperties { pub fabric_id: Option, #[doc = "Model class for provider specific details for an event."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Model class for event specific details for an event."] #[serde(rename = "eventSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub event_specific_details: Option, + pub event_specific_details: Option, #[doc = "The list of errors / warnings capturing details associated with the issue(s)."] #[serde( rename = "healthErrors", @@ -4024,6 +4081,20 @@ impl EventProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aEventDetails), + HyperVReplica2012(HyperVReplica2012EventDetails), + HyperVReplica2012R2(HyperVReplica2012R2EventDetails), + HyperVReplicaAzure(HyperVReplicaAzureEventDetails), + HyperVReplicaBaseEventDetails(HyperVReplicaBaseEventDetails), + InMageAzureV2(InMageAzureV2EventDetails), + InMageRcm(InMageRcmEventDetails), + InMageRcmFailback(InMageRcmFailbackEventDetails), + VMwareCbt(VMwareCbtEventDetails), +} #[doc = "Implements the event query parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventQueryParameter { @@ -4069,6 +4140,11 @@ impl EventSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum EventSpecificDetailsUnion { + JobStatus(JobStatusEventDetails), +} #[doc = "Existing storage account input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExistingProtectionProfile { @@ -4304,7 +4380,7 @@ impl FabricCreationInput { pub struct FabricCreationInputProperties { #[doc = "Fabric provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl FabricCreationInputProperties { pub fn new() -> Self { @@ -4331,7 +4407,7 @@ pub struct FabricProperties { pub bcdr_state: Option, #[doc = "Fabric specific details."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, #[doc = "Fabric health error details."] #[serde( rename = "healthErrorDetails", @@ -4415,6 +4491,13 @@ impl FabricSpecificCreateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureCreateNetworkMappingInput), + VmmToAzure(VmmToAzureCreateNetworkMappingInput), + VmmToVmm(VmmToVmmCreateNetworkMappingInput), +} #[doc = "Fabric provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificCreationInput { @@ -4427,6 +4510,13 @@ impl FabricSpecificCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificCreationInputUnion { + Azure(AzureFabricCreationInput), + InMageRcm(InMageRcmFabricCreationInput), + VMwareV2(VMwareV2FabricCreationInput), +} #[doc = "Fabric specific details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificDetails { @@ -4439,6 +4529,17 @@ impl FabricSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificDetailsUnion { + Azure(AzureFabricSpecificDetails), + HyperVSite(HyperVSiteDetails), + InMageRcm(InMageRcmFabricSpecificDetails), + VMware(VMwareDetails), + VMwareV2(VMwareV2FabricSpecificDetails), + #[serde(rename = "VMM")] + Vmm(VmmDetails), +} #[doc = "Input details specific to fabrics during Network Mapping."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FabricSpecificUpdateNetworkMappingInput { @@ -4451,6 +4552,13 @@ impl FabricSpecificUpdateNetworkMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum FabricSpecificUpdateNetworkMappingInputUnion { + AzureToAzure(AzureToAzureUpdateNetworkMappingInput), + VmmToAzure(VmmToAzureUpdateNetworkMappingInput), + VmmToVmm(VmmToVmmUpdateNetworkMappingInput), +} #[doc = "This class represents the details for a failover job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FailoverJobDetails { @@ -4611,6 +4719,12 @@ impl GroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum GroupTaskDetailsUnion { + InlineWorkflowTaskDetails(InlineWorkflowTaskDetails), + RecoveryPlanGroupTaskDetails(RecoveryPlanGroupTaskDetails), +} #[doc = "Health Error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HealthError { @@ -6207,6 +6321,11 @@ impl HyperVReplicaPolicyInput { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVReplicaPolicyInputUnion { + HyperVReplica2012R2(HyperVReplicaBluePolicyInput), +} #[doc = "HyperV replica 2012 replication details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HyperVReplicaReplicationDetails { @@ -6450,6 +6569,11 @@ pub mod hyper_v_virtual_machine_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum HyperVVirtualMachineDetailsUnion { + VmmVirtualMachine(VmmVirtualMachineDetails), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IpConfigDetails { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -11362,6 +11486,15 @@ impl JobDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobDetailsUnion { + AsrJobDetails(AsrJobDetails), + ExportJobDetails(ExportJobDetails), + FailoverJobDetails(FailoverJobDetails), + SwitchProtectionJobDetails(SwitchProtectionJobDetails), + TestFailoverJobDetails(TestFailoverJobDetails), +} #[doc = "This class contains the minimal job details required to navigate to the desired drill down."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobEntity { @@ -11470,7 +11603,7 @@ pub struct JobProperties { pub target_instance_type: Option, #[doc = "Job details based on specific job type."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl JobProperties { pub fn new() -> Self { @@ -11598,6 +11731,12 @@ impl JobTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum JobTaskDetailsUnion { + FabricReplicationGroupTaskDetails(FabricReplicationGroupTaskDetails), + VirtualMachineTaskDetails(VirtualMachineTaskDetails), +} #[doc = "Key Encryption Key (KEK) information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KeyEncryptionKeyInfo { @@ -11882,10 +12021,10 @@ impl MigrateInput { pub struct MigrateInputProperties { #[doc = "Migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: MigrateProviderSpecificInput, + pub provider_specific_details: MigrateProviderSpecificInputUnion, } impl MigrateInputProperties { - pub fn new(provider_specific_details: MigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: MigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -11901,6 +12040,11 @@ impl MigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtMigrateInput), +} #[doc = "Migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationItem { @@ -12017,7 +12161,7 @@ pub struct MigrationItemProperties { pub event_correlation_id: Option, #[doc = "Migration provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl MigrationItemProperties { pub fn new() -> Self { @@ -12222,6 +12366,11 @@ impl MigrationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum MigrationProviderSpecificSettingsUnion { + VMwareCbt(VMwareCbtMigrationDetails), +} #[doc = "Recovery point for a migration item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MigrationRecoveryPoint { @@ -12426,6 +12575,13 @@ impl NetworkMappingFabricSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum NetworkMappingFabricSpecificSettingsUnion { + AzureToAzure(AzureToAzureNetworkMappingSettings), + VmmToAzure(VmmToAzureNetworkMappingSettings), + VmmToVmm(VmmToVmmNetworkMappingSettings), +} #[doc = "Network Mapping Properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NetworkMappingProperties { @@ -12455,7 +12611,7 @@ pub struct NetworkMappingProperties { pub recovery_fabric_friendly_name: Option, #[doc = "Network Mapping fabric specific settings."] #[serde(rename = "fabricSpecificSettings", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_settings: Option, + pub fabric_specific_settings: Option, } impl NetworkMappingProperties { pub fn new() -> Self { @@ -12766,7 +12922,7 @@ pub struct PlannedFailoverInputProperties { pub failover_direction: Option, #[doc = "Provider specific failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PlannedFailoverInputProperties { pub fn new() -> Self { @@ -12785,6 +12941,13 @@ impl PlannedFailoverProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PlannedFailoverProviderSpecificFailoverInputUnion { + HyperVReplicaAzureFailback(HyperVReplicaAzureFailbackProviderInput), + HyperVReplicaAzure(HyperVReplicaAzurePlannedFailoverProviderInput), + InMageRcmFailback(InMageRcmFailbackPlannedFailoverProviderInput), +} #[doc = "Protection profile details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Policy { @@ -12832,7 +12995,7 @@ pub struct PolicyProperties { pub friendly_name: Option, #[doc = "Base class for Provider specific details for policies."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl PolicyProperties { pub fn new() -> Self { @@ -12851,6 +13014,22 @@ impl PolicyProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aPolicyDetails), + HyperVReplicaAzure(HyperVReplicaAzurePolicyDetails), + HyperVReplicaBasePolicyDetails(HyperVReplicaBasePolicyDetails), + HyperVReplica2012R2(HyperVReplicaBluePolicyDetails), + HyperVReplica2012(HyperVReplicaPolicyDetails), + InMageAzureV2(InMageAzureV2PolicyDetails), + InMageBasePolicyDetails(InMageBasePolicyDetails), + InMage(InMagePolicyDetails), + InMageRcmFailback(InMageRcmFailbackPolicyDetails), + InMageRcm(InMageRcmPolicyDetails), + VMwareCbt(VmwareCbtPolicyDetails), +} #[doc = "Base class for provider specific input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyProviderSpecificInput { @@ -12863,6 +13042,21 @@ impl PolicyProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum PolicyProviderSpecificInputUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationPolicyCreationInput), + #[serde(rename = "A2A")] + A2a(A2aPolicyCreationInput), + HyperVReplicaAzure(HyperVReplicaAzurePolicyInput), + HyperVReplica2012(HyperVReplicaPolicyInput), + InMageAzureV2(InMageAzureV2PolicyInput), + InMage(InMagePolicyInput), + InMageRcmFailback(InMageRcmFailbackPolicyCreationInput), + InMageRcm(InMageRcmPolicyCreationInput), + VMwareCbt(VMwareCbtPolicyCreationInput), +} #[doc = "Details of the Process Server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessServer { @@ -13502,7 +13696,7 @@ pub struct ProtectableItemProperties { pub supported_replication_providers: Vec, #[doc = "Replication provider specific settings."] #[serde(rename = "customDetails", default, skip_serializing_if = "Option::is_none")] - pub custom_details: Option, + pub custom_details: Option, } impl ProtectableItemProperties { pub fn new() -> Self { @@ -13695,7 +13889,7 @@ pub struct ProtectionContainerMappingProperties { pub target_protection_container_friendly_name: Option, #[doc = "Container mapping provider specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "Health of pairing."] #[serde(default, skip_serializing_if = "Option::is_none")] pub health: Option, @@ -13743,6 +13937,14 @@ impl ProtectionContainerMappingProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProtectionContainerMappingProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aProtectionContainerMappingDetails), + InMageRcm(InMageRcmProtectionContainerMappingDetails), + VMwareCbt(VMwareCbtProtectionContainerMappingDetails), +} #[doc = "Protection profile custom data details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtectionContainerProperties { @@ -13785,6 +13987,12 @@ impl ProtectionProfileCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ProtectionProfileCustomDetailsUnion { + Existing(ExistingProtectionProfile), + New(NewProtectionProfile), +} #[doc = "This class contains the error details per object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProviderError { @@ -13821,6 +14029,14 @@ impl ProviderSpecificRecoveryPointDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ProviderSpecificRecoveryPointDetailsUnion { + #[serde(rename = "A2A")] + A2a(A2aRecoveryPointDetails), + InMageAzureV2(InMageAzureV2RecoveryPointDetails), + InMageRcm(InMageRcmRecoveryPointDetails), +} #[doc = "Push installer details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PushInstallerDetails { @@ -14006,6 +14222,11 @@ impl RecoveryAvailabilitySetCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryAvailabilitySetCustomDetailsUnion { + Existing(ExistingRecoveryAvailabilitySet), +} #[doc = "Recovery plan details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryPlan { @@ -14205,14 +14426,14 @@ pub struct RecoveryPlanAction { pub failover_directions: Vec, #[doc = "Recovery plan action custom details."] #[serde(rename = "customDetails")] - pub custom_details: RecoveryPlanActionDetails, + pub custom_details: RecoveryPlanActionDetailsUnion, } impl RecoveryPlanAction { pub fn new( action_name: String, failover_types: Vec, failover_directions: Vec, - custom_details: RecoveryPlanActionDetails, + custom_details: RecoveryPlanActionDetailsUnion, ) -> Self { Self { action_name, @@ -14234,6 +14455,13 @@ impl RecoveryPlanActionDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanActionDetailsUnion { + AutomationRunbookActionDetails(RecoveryPlanAutomationRunbookActionDetails), + ManualActionDetails(RecoveryPlanManualActionDetails), + ScriptActionDetails(RecoveryPlanScriptActionDetails), +} #[doc = "Recovery plan Automation runbook action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanAutomationRunbookActionDetails { @@ -14435,6 +14663,11 @@ impl RecoveryPlanGroupTaskDetails { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanGroupTaskDetailsUnion { + RecoveryPlanShutdownGroupTaskDetails(RecoveryPlanShutdownGroupTaskDetails), +} #[doc = "Recovery plan HVR Azure failback input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanHyperVReplicaAzureFailbackInput { @@ -14913,7 +15146,7 @@ pub struct RecoveryPlanPlannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanPlannedFailoverInputProperties { pub fn new(failover_direction: recovery_plan_planned_failover_input_properties::FailoverDirection) -> Self { @@ -15032,7 +15265,7 @@ pub struct RecoveryPlanProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanProperties { pub fn new() -> Self { @@ -15066,6 +15299,12 @@ impl RecoveryPlanProviderSpecificDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificDetailsUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aDetails), +} #[doc = "Recovery plan provider specific failover input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificFailoverInput { @@ -15078,6 +15317,18 @@ impl RecoveryPlanProviderSpecificFailoverInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificFailoverInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aFailoverInput), + HyperVReplicaAzureFailback(RecoveryPlanHyperVReplicaAzureFailbackInput), + HyperVReplicaAzure(RecoveryPlanHyperVReplicaAzureFailoverInput), + InMageAzureV2(RecoveryPlanInMageAzureV2FailoverInput), + InMage(RecoveryPlanInMageFailoverInput), + InMageRcmFailback(RecoveryPlanInMageRcmFailbackFailoverInput), + InMageRcm(RecoveryPlanInMageRcmFailoverInput), +} #[doc = "Recovery plan provider specific input base class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanProviderSpecificInput { @@ -15090,6 +15341,12 @@ impl RecoveryPlanProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RecoveryPlanProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(RecoveryPlanA2aInput), +} #[doc = "Recovery plan script action details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryPlanScriptActionDetails { @@ -15224,7 +15481,7 @@ pub struct RecoveryPlanTestFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanTestFailoverInputProperties { pub fn new(failover_direction: recovery_plan_test_failover_input_properties::FailoverDirection, network_type: String) -> Self { @@ -15303,7 +15560,7 @@ pub struct RecoveryPlanUnplannedFailoverInputProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub provider_specific_details: Vec, + pub provider_specific_details: Vec, } impl RecoveryPlanUnplannedFailoverInputProperties { pub fn new( @@ -15444,7 +15701,7 @@ pub struct RecoveryPointProperties { pub recovery_point_type: Option, #[doc = "Replication provider specific recovery point details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RecoveryPointProperties { pub fn new() -> Self { @@ -15463,6 +15720,11 @@ impl RecoveryProximityPlacementGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryProximityPlacementGroupCustomDetailsUnion { + Existing(ExistingRecoveryProximityPlacementGroup), +} #[doc = "Recovery Resource Group custom input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RecoveryResourceGroupCustomDetails { @@ -15475,6 +15737,11 @@ impl RecoveryResourceGroupCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryResourceGroupCustomDetailsUnion { + Existing(ExistingRecoveryRecoveryResourceGroup), +} #[doc = "Provider details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecoveryServicesProvider { @@ -15609,6 +15876,12 @@ impl RecoveryVirtualNetworkCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum RecoveryVirtualNetworkCustomDetailsUnion { + Existing(ExistingRecoveryVirtualNetwork), + New(NewRecoveryVirtualNetwork), +} #[doc = "Input for remove disk(s) operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveDisksInput { @@ -15626,7 +15899,7 @@ impl RemoveDisksInput { pub struct RemoveDisksInputProperties { #[doc = "Remove Disk provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl RemoveDisksInputProperties { pub fn new() -> Self { @@ -15645,6 +15918,12 @@ impl RemoveDisksProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum RemoveDisksProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aRemoveDisksInput), +} #[doc = "Container unpairing input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RemoveProtectionContainerMappingInput { @@ -15795,7 +16074,7 @@ impl ReplicationAppliance { pub struct ReplicationApplianceProperties { #[doc = "Appliance specific details."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationApplianceProperties { pub fn new() -> Self { @@ -16036,7 +16315,7 @@ pub struct ReplicationProtectedItemProperties { pub failover_recovery_point_id: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, #[doc = "The recovery container Id."] #[serde(rename = "recoveryContainerId", default, skip_serializing_if = "Option::is_none")] pub recovery_container_id: Option, @@ -16108,7 +16387,7 @@ pub struct ReplicationProtectionIntentProperties { pub creation_time_utc: Option, #[doc = "Replication provider specific settings."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReplicationProtectionIntentProperties { pub fn new() -> Self { @@ -16127,6 +16406,12 @@ impl ReplicationProtectionIntentProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProtectionIntentProviderSpecificSettingsUnion { + #[serde(rename = "A2A")] + A2a(A2aReplicationIntentDetails), +} #[doc = "Provider specific input for unpairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicationProviderContainerUnmappingInput { @@ -16151,6 +16436,15 @@ impl ReplicationProviderSpecificContainerCreationInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerCreationInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerCreationInput), + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationContainerCreationInput), + VMwareCbt(VMwareCbtContainerCreationInput), +} #[doc = "Provider specific input for pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificContainerMappingInput { @@ -16163,6 +16457,13 @@ impl ReplicationProviderSpecificContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aContainerMappingInput), + VMwareCbt(VMwareCbtContainerMappingInput), +} #[doc = "Replication provider specific settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificSettings { @@ -16175,6 +16476,22 @@ impl ReplicationProviderSpecificSettings { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificSettingsUnion { + #[serde(rename = "A2ACrossClusterMigration")] + A2aCrossClusterMigration(A2aCrossClusterMigrationReplicationDetails), + #[serde(rename = "A2A")] + A2a(A2aReplicationDetails), + HyperVReplicaAzure(HyperVReplicaAzureReplicationDetails), + HyperVReplicaBaseReplicationDetails(HyperVReplicaBaseReplicationDetails), + HyperVReplica2012R2(HyperVReplicaBlueReplicationDetails), + HyperVReplica2012(HyperVReplicaReplicationDetails), + InMageAzureV2(InMageAzureV2ReplicationDetails), + InMageRcmFailback(InMageRcmFailbackReplicationDetails), + InMageRcm(InMageRcmReplicationDetails), + InMage(InMageReplicationDetails), +} #[doc = "Provider specific input for update pairing operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicationProviderSpecificUpdateContainerMappingInput { @@ -16187,6 +16504,13 @@ impl ReplicationProviderSpecificUpdateContainerMappingInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReplicationProviderSpecificUpdateContainerMappingInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateContainerMappingInput), + InMageRcm(InMageRcmUpdateContainerMappingInput), +} #[doc = "Reprotect agent details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReprotectAgentDetails { @@ -16413,10 +16737,10 @@ impl ResumeReplicationInput { pub struct ResumeReplicationInputProperties { #[doc = "Resume replication provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResumeReplicationProviderSpecificInput, + pub provider_specific_details: ResumeReplicationProviderSpecificInputUnion, } impl ResumeReplicationInputProperties { - pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResumeReplicationProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16432,6 +16756,11 @@ impl ResumeReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResumeReplicationProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResumeReplicationInput), +} #[doc = "Resync input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResyncInput { @@ -16448,10 +16777,10 @@ impl ResyncInput { pub struct ResyncInputProperties { #[doc = "Resync provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: ResyncProviderSpecificInput, + pub provider_specific_details: ResyncProviderSpecificInputUnion, } impl ResyncInputProperties { - pub fn new(provider_specific_details: ResyncProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: ResyncProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -16467,6 +16796,11 @@ impl ResyncProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ResyncProviderSpecificInputUnion { + VMwareCbt(VMwareCbtResyncInput), +} #[doc = "The retention details of the MT."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionVolume { @@ -16508,7 +16842,7 @@ pub struct ReverseReplicationInputProperties { pub failover_direction: Option, #[doc = "Provider specific reverse replication input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl ReverseReplicationInputProperties { pub fn new() -> Self { @@ -16527,6 +16861,17 @@ impl ReverseReplicationProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum ReverseReplicationProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aReprotectInput), + HyperVReplicaAzure(HyperVReplicaAzureReprotectInput), + InMageAzureV2(InMageAzureV2ReprotectInput), + InMageRcmFailback(InMageRcmFailbackReprotectInput), + InMageRcm(InMageRcmReprotectInput), + InMage(InMageReprotectInput), +} #[doc = "Azure role assignment details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleAssignment { @@ -16631,6 +16976,11 @@ impl StorageAccountCustomDetails { Self { resource_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum StorageAccountCustomDetailsUnion { + Existing(ExistingStorageAccount), +} #[doc = "Storage object definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StorageClassification { @@ -16874,7 +17224,7 @@ pub struct SwitchProtectionInputProperties { pub replication_protected_item_name: Option, #[doc = "Provider specific switch protection input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProtectionInputProperties { pub fn new() -> Self { @@ -16910,6 +17260,12 @@ impl SwitchProtectionProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProtectionProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aSwitchProtectionInput), +} #[doc = "Input definition for switch provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SwitchProviderInput { @@ -16930,7 +17286,7 @@ pub struct SwitchProviderInputProperties { pub target_instance_type: Option, #[doc = "Provider specific switch provider input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl SwitchProviderInputProperties { pub fn new() -> Self { @@ -16949,6 +17305,11 @@ impl SwitchProviderProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum SwitchProviderProviderSpecificInputUnion { + InMageAzureV2(InMageAzureV2SwitchProviderProviderInput), +} #[doc = "Represents applicable recovery vm sizes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TargetComputeSize { @@ -17055,6 +17416,16 @@ impl TaskTypeDetails { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TaskTypeDetailsUnion { + AutomationRunbookTaskDetails(AutomationRunbookTaskDetails), + ConsistencyCheckTaskDetails(ConsistencyCheckTaskDetails), + JobTaskDetails(JobTaskDetails), + ManualActionTaskDetails(ManualActionTaskDetails), + ScriptActionTaskDetails(ScriptActionTaskDetails), + VmNicUpdatesTaskDetails(VmNicUpdatesTaskDetails), +} #[doc = "Input definition for test failover cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestFailoverCleanupInput { @@ -17103,7 +17474,7 @@ pub struct TestFailoverInputProperties { pub network_id: Option, #[doc = "Provider specific test failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl TestFailoverInputProperties { pub fn new() -> Self { @@ -17164,6 +17535,16 @@ impl TestFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aTestFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureTestFailoverInput), + InMageAzureV2(InMageAzureV2TestFailoverInput), + InMageRcm(InMageRcmTestFailoverInput), + InMage(InMageTestFailoverInput), +} #[doc = "Input for test migrate cleanup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TestMigrateCleanupInput { @@ -17203,10 +17584,10 @@ impl TestMigrateInput { pub struct TestMigrateInputProperties { #[doc = "Test migrate provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: TestMigrateProviderSpecificInput, + pub provider_specific_details: TestMigrateProviderSpecificInputUnion, } impl TestMigrateInputProperties { - pub fn new(provider_specific_details: TestMigrateProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: TestMigrateProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -17222,6 +17603,11 @@ impl TestMigrateProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum TestMigrateProviderSpecificInputUnion { + VMwareCbt(VMwareCbtTestMigrateInput), +} #[doc = "Input definition for unplanned failover."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UnplannedFailoverInput { @@ -17244,7 +17630,7 @@ pub struct UnplannedFailoverInputProperties { pub source_site_operations: Option, #[doc = "Provider specific unplanned failover input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UnplannedFailoverInputProperties { pub fn new() -> Self { @@ -17263,6 +17649,16 @@ impl UnplannedFailoverProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UnplannedFailoverProviderSpecificInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUnplannedFailoverInput), + HyperVReplicaAzure(HyperVReplicaAzureUnplannedFailoverInput), + InMageAzureV2(InMageAzureV2UnplannedFailoverInput), + InMageRcm(InMageRcmUnplannedFailoverInput), + InMage(InMageUnplannedFailoverInput), +} #[doc = "Update appliance for replication protected item input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateApplianceForReplicationProtectedItemInput { @@ -17282,12 +17678,12 @@ pub struct UpdateApplianceForReplicationProtectedItemInputProperties { pub target_appliance_id: String, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + pub provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, } impl UpdateApplianceForReplicationProtectedItemInputProperties { pub fn new( target_appliance_id: String, - provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInput, + provider_specific_details: UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion, ) -> Self { Self { target_appliance_id, @@ -17307,6 +17703,11 @@ impl UpdateApplianceForReplicationProtectedItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateApplianceForReplicationProtectedItemProviderSpecificInputUnion { + InMageRcm(InMageRcmUpdateApplianceForReplicationProtectedItemInput), +} #[doc = "Disk input for update."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateDiskInput { @@ -17342,10 +17743,10 @@ impl UpdateMigrationItemInput { pub struct UpdateMigrationItemInputProperties { #[doc = "Update migration item provider specific input."] #[serde(rename = "providerSpecificDetails")] - pub provider_specific_details: UpdateMigrationItemProviderSpecificInput, + pub provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion, } impl UpdateMigrationItemInputProperties { - pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInput) -> Self { + pub fn new(provider_specific_details: UpdateMigrationItemProviderSpecificInputUnion) -> Self { Self { provider_specific_details } } } @@ -17361,6 +17762,11 @@ impl UpdateMigrationItemProviderSpecificInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateMigrationItemProviderSpecificInputUnion { + VMwareCbt(VMwareCbtUpdateMigrationItemInput), +} #[doc = "Request to update the mobility service on a protected item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateMobilityServiceRequest { @@ -17408,7 +17814,7 @@ pub struct UpdateNetworkMappingInputProperties { pub recovery_network_id: Option, #[doc = "Input details specific to fabrics during Network Mapping."] #[serde(rename = "fabricSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub fabric_specific_details: Option, + pub fabric_specific_details: Option, } impl UpdateNetworkMappingInputProperties { pub fn new() -> Self { @@ -17432,7 +17838,7 @@ impl UpdatePolicyInput { pub struct UpdatePolicyInputProperties { #[doc = "Base class for provider specific input."] #[serde(rename = "replicationProviderSettings", default, skip_serializing_if = "Option::is_none")] - pub replication_provider_settings: Option, + pub replication_provider_settings: Option, } impl UpdatePolicyInputProperties { pub fn new() -> Self { @@ -17456,7 +17862,7 @@ impl UpdateProtectionContainerMappingInput { pub struct UpdateProtectionContainerMappingInputProperties { #[doc = "Provider specific input for update pairing operations."] #[serde(rename = "providerSpecificInput", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_input: Option, + pub provider_specific_input: Option, } impl UpdateProtectionContainerMappingInputProperties { pub fn new() -> Self { @@ -17540,7 +17946,7 @@ pub struct UpdateReplicationProtectedItemInputProperties { pub recovery_availability_set_id: Option, #[doc = "Update replication protected item provider specific input."] #[serde(rename = "providerSpecificDetails", default, skip_serializing_if = "Option::is_none")] - pub provider_specific_details: Option, + pub provider_specific_details: Option, } impl UpdateReplicationProtectedItemInputProperties { pub fn new() -> Self { @@ -17601,6 +18007,15 @@ impl UpdateReplicationProtectedItemProviderInput { Self { instance_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "instanceType")] +pub enum UpdateReplicationProtectedItemProviderInputUnion { + #[serde(rename = "A2A")] + A2a(A2aUpdateReplicationProtectedItemInput), + HyperVReplicaAzure(HyperVReplicaAzureUpdateReplicationProtectedItemInput), + InMageAzureV2(InMageAzureV2UpdateReplicationProtectedItemInput), + InMageRcm(InMageRcmUpdateReplicationProtectedItemInput), +} #[doc = "Input required to update vCenter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateVCenterRequest { diff --git a/services/mgmt/resourcegraph/src/package_2022_10/models.rs b/services/mgmt/resourcegraph/src/package_2022_10/models.rs index 250825df77..b20fd04617 100644 --- a/services/mgmt/resourcegraph/src/package_2022_10/models.rs +++ b/services/mgmt/resourcegraph/src/package_2022_10/models.rs @@ -115,6 +115,12 @@ impl Facet { Self { expression, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum FacetUnion { + FacetError(FacetError), + FacetResult(FacetResult), +} #[doc = "A facet whose execution resulted in an error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FacetError { @@ -386,7 +392,7 @@ pub struct QueryResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub facets: Vec, + pub facets: Vec, } impl QueryResponse { pub fn new(total_records: i64, count: i64, result_truncated: query_response::ResultTruncated, data: serde_json::Value) -> Self { diff --git a/services/mgmt/resourcegraph/src/package_preview_2020_04/models.rs b/services/mgmt/resourcegraph/src/package_preview_2020_04/models.rs index 1916b53c09..c2d083512d 100644 --- a/services/mgmt/resourcegraph/src/package_preview_2020_04/models.rs +++ b/services/mgmt/resourcegraph/src/package_preview_2020_04/models.rs @@ -113,6 +113,12 @@ impl Facet { Self { expression, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum FacetUnion { + FacetError(FacetError), + FacetResult(FacetResult), +} #[doc = "A facet whose execution resulted in an error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FacetError { @@ -355,7 +361,7 @@ pub struct QueryResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub facets: Vec, + pub facets: Vec, } impl QueryResponse { pub fn new(total_records: i64, count: i64, result_truncated: query_response::ResultTruncated, data: serde_json::Value) -> Self { diff --git a/services/mgmt/resourcegraph/src/package_preview_2020_09/models.rs b/services/mgmt/resourcegraph/src/package_preview_2020_09/models.rs index 493915296a..5ecba871d8 100644 --- a/services/mgmt/resourcegraph/src/package_preview_2020_09/models.rs +++ b/services/mgmt/resourcegraph/src/package_preview_2020_09/models.rs @@ -113,6 +113,12 @@ impl Facet { Self { expression, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum FacetUnion { + FacetError(FacetError), + FacetResult(FacetResult), +} #[doc = "A facet whose execution resulted in an error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FacetError { @@ -355,7 +361,7 @@ pub struct QueryResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub facets: Vec, + pub facets: Vec, } impl QueryResponse { pub fn new(total_records: i64, count: i64, result_truncated: query_response::ResultTruncated, data: serde_json::Value) -> Self { diff --git a/services/mgmt/resourcegraph/src/package_preview_2021_03/models.rs b/services/mgmt/resourcegraph/src/package_preview_2021_03/models.rs index 3eb2dd2bb3..922ece7e92 100644 --- a/services/mgmt/resourcegraph/src/package_preview_2021_03/models.rs +++ b/services/mgmt/resourcegraph/src/package_preview_2021_03/models.rs @@ -113,6 +113,12 @@ impl Facet { Self { expression, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum FacetUnion { + FacetError(FacetError), + FacetResult(FacetResult), +} #[doc = "A facet whose execution resulted in an error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FacetError { @@ -368,7 +374,7 @@ pub struct QueryResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub facets: Vec, + pub facets: Vec, } impl QueryResponse { pub fn new(total_records: i64, count: i64, result_truncated: query_response::ResultTruncated, data: serde_json::Value) -> Self { diff --git a/services/mgmt/resourcegraph/src/package_preview_2021_06/models.rs b/services/mgmt/resourcegraph/src/package_preview_2021_06/models.rs index 0c3df706d1..f7cb2b9e61 100644 --- a/services/mgmt/resourcegraph/src/package_preview_2021_06/models.rs +++ b/services/mgmt/resourcegraph/src/package_preview_2021_06/models.rs @@ -115,6 +115,12 @@ impl Facet { Self { expression, result_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resultType")] +pub enum FacetUnion { + FacetError(FacetError), + FacetResult(FacetResult), +} #[doc = "A facet whose execution resulted in an error."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FacetError { @@ -386,7 +392,7 @@ pub struct QueryResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub facets: Vec, + pub facets: Vec, } impl QueryResponse { pub fn new(total_records: i64, count: i64, result_truncated: query_response::ResultTruncated, data: serde_json::Value) -> Self { diff --git a/services/mgmt/resourcemover/src/package_2019_10_01_preview/models.rs b/services/mgmt/resourcemover/src/package_2019_10_01_preview/models.rs index ea8b9e2a79..8fe96b7662 100644 --- a/services/mgmt/resourcemover/src/package_2019_10_01_preview/models.rs +++ b/services/mgmt/resourcemover/src/package_2019_10_01_preview/models.rs @@ -749,10 +749,10 @@ pub struct MoveResourceProperties { pub existing_target_id: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "resourceSettings", default, skip_serializing_if = "Option::is_none")] - pub resource_settings: Option, + pub resource_settings: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "sourceResourceSettings", default, skip_serializing_if = "Option::is_none")] - pub source_resource_settings: Option, + pub source_resource_settings: Option, #[doc = "Defines the move resource status."] #[serde(rename = "moveStatus", default, skip_serializing_if = "Option::is_none")] pub move_status: Option, @@ -1420,6 +1420,36 @@ impl ResourceSettings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ResourceSettingsUnion { + #[serde(rename = "Microsoft.Compute/availabilitySets")] + MicrosoftComputeAvailabilitySets(AvailabilitySetResourceSettings), + #[serde(rename = "Microsoft.Compute/diskEncryptionSets")] + MicrosoftComputeDiskEncryptionSets(DiskEncryptionSetResourceSettings), + #[serde(rename = "Microsoft.KeyVault/vaults")] + MicrosoftKeyVaultVaults(KeyVaultResourceSettings), + #[serde(rename = "Microsoft.Network/loadBalancers")] + MicrosoftNetworkLoadBalancers(LoadBalancerResourceSettings), + #[serde(rename = "Microsoft.Network/networkInterfaces")] + MicrosoftNetworkNetworkInterfaces(NetworkInterfaceResourceSettings), + #[serde(rename = "Microsoft.Network/networkSecurityGroups")] + MicrosoftNetworkNetworkSecurityGroups(NetworkSecurityGroupResourceSettings), + #[serde(rename = "Microsoft.Network/publicIPAddresses")] + MicrosoftNetworkPublicIpAddresses(PublicIpAddressResourceSettings), + #[serde(rename = "resourceGroups")] + ResourceGroups(ResourceGroupResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(SqlDatabaseResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/elasticPools")] + MicrosoftSqlServersElasticPools(SqlElasticPoolResourceSettings), + #[serde(rename = "Microsoft.Sql/servers")] + MicrosoftSqlServers(SqlServerResourceSettings), + #[serde(rename = "Microsoft.Compute/virtualMachines")] + MicrosoftComputeVirtualMachines(VirtualMachineResourceSettings), + #[serde(rename = "Microsoft.Network/virtualNetworks")] + MicrosoftNetworkVirtualNetworks(VirtualNetworkResourceSettings), +} #[doc = "Defines the Sql Database resource settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SqlDatabaseResourceSettings { diff --git a/services/mgmt/resourcemover/src/package_2021_01_01/models.rs b/services/mgmt/resourcemover/src/package_2021_01_01/models.rs index ea8b9e2a79..8fe96b7662 100644 --- a/services/mgmt/resourcemover/src/package_2021_01_01/models.rs +++ b/services/mgmt/resourcemover/src/package_2021_01_01/models.rs @@ -749,10 +749,10 @@ pub struct MoveResourceProperties { pub existing_target_id: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "resourceSettings", default, skip_serializing_if = "Option::is_none")] - pub resource_settings: Option, + pub resource_settings: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "sourceResourceSettings", default, skip_serializing_if = "Option::is_none")] - pub source_resource_settings: Option, + pub source_resource_settings: Option, #[doc = "Defines the move resource status."] #[serde(rename = "moveStatus", default, skip_serializing_if = "Option::is_none")] pub move_status: Option, @@ -1420,6 +1420,36 @@ impl ResourceSettings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ResourceSettingsUnion { + #[serde(rename = "Microsoft.Compute/availabilitySets")] + MicrosoftComputeAvailabilitySets(AvailabilitySetResourceSettings), + #[serde(rename = "Microsoft.Compute/diskEncryptionSets")] + MicrosoftComputeDiskEncryptionSets(DiskEncryptionSetResourceSettings), + #[serde(rename = "Microsoft.KeyVault/vaults")] + MicrosoftKeyVaultVaults(KeyVaultResourceSettings), + #[serde(rename = "Microsoft.Network/loadBalancers")] + MicrosoftNetworkLoadBalancers(LoadBalancerResourceSettings), + #[serde(rename = "Microsoft.Network/networkInterfaces")] + MicrosoftNetworkNetworkInterfaces(NetworkInterfaceResourceSettings), + #[serde(rename = "Microsoft.Network/networkSecurityGroups")] + MicrosoftNetworkNetworkSecurityGroups(NetworkSecurityGroupResourceSettings), + #[serde(rename = "Microsoft.Network/publicIPAddresses")] + MicrosoftNetworkPublicIpAddresses(PublicIpAddressResourceSettings), + #[serde(rename = "resourceGroups")] + ResourceGroups(ResourceGroupResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(SqlDatabaseResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/elasticPools")] + MicrosoftSqlServersElasticPools(SqlElasticPoolResourceSettings), + #[serde(rename = "Microsoft.Sql/servers")] + MicrosoftSqlServers(SqlServerResourceSettings), + #[serde(rename = "Microsoft.Compute/virtualMachines")] + MicrosoftComputeVirtualMachines(VirtualMachineResourceSettings), + #[serde(rename = "Microsoft.Network/virtualNetworks")] + MicrosoftNetworkVirtualNetworks(VirtualNetworkResourceSettings), +} #[doc = "Defines the Sql Database resource settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SqlDatabaseResourceSettings { diff --git a/services/mgmt/resourcemover/src/package_2021_08_01/models.rs b/services/mgmt/resourcemover/src/package_2021_08_01/models.rs index 5ea73285ea..49786753d0 100644 --- a/services/mgmt/resourcemover/src/package_2021_08_01/models.rs +++ b/services/mgmt/resourcemover/src/package_2021_08_01/models.rs @@ -763,10 +763,10 @@ pub struct MoveResourceProperties { pub existing_target_id: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "resourceSettings", default, skip_serializing_if = "Option::is_none")] - pub resource_settings: Option, + pub resource_settings: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "sourceResourceSettings", default, skip_serializing_if = "Option::is_none")] - pub source_resource_settings: Option, + pub source_resource_settings: Option, #[doc = "Defines the move resource status."] #[serde(rename = "moveStatus", default, skip_serializing_if = "Option::is_none")] pub move_status: Option, @@ -1446,6 +1446,36 @@ impl ResourceSettings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ResourceSettingsUnion { + #[serde(rename = "Microsoft.Compute/availabilitySets")] + MicrosoftComputeAvailabilitySets(AvailabilitySetResourceSettings), + #[serde(rename = "Microsoft.Compute/diskEncryptionSets")] + MicrosoftComputeDiskEncryptionSets(DiskEncryptionSetResourceSettings), + #[serde(rename = "Microsoft.KeyVault/vaults")] + MicrosoftKeyVaultVaults(KeyVaultResourceSettings), + #[serde(rename = "Microsoft.Network/loadBalancers")] + MicrosoftNetworkLoadBalancers(LoadBalancerResourceSettings), + #[serde(rename = "Microsoft.Network/networkInterfaces")] + MicrosoftNetworkNetworkInterfaces(NetworkInterfaceResourceSettings), + #[serde(rename = "Microsoft.Network/networkSecurityGroups")] + MicrosoftNetworkNetworkSecurityGroups(NetworkSecurityGroupResourceSettings), + #[serde(rename = "Microsoft.Network/publicIPAddresses")] + MicrosoftNetworkPublicIpAddresses(PublicIpAddressResourceSettings), + #[serde(rename = "resourceGroups")] + ResourceGroups(ResourceGroupResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(SqlDatabaseResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/elasticPools")] + MicrosoftSqlServersElasticPools(SqlElasticPoolResourceSettings), + #[serde(rename = "Microsoft.Sql/servers")] + MicrosoftSqlServers(SqlServerResourceSettings), + #[serde(rename = "Microsoft.Compute/virtualMachines")] + MicrosoftComputeVirtualMachines(VirtualMachineResourceSettings), + #[serde(rename = "Microsoft.Network/virtualNetworks")] + MicrosoftNetworkVirtualNetworks(VirtualNetworkResourceSettings), +} #[doc = "Defines the Sql Database resource settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SqlDatabaseResourceSettings { diff --git a/services/mgmt/resourcemover/src/package_2022_08_01/models.rs b/services/mgmt/resourcemover/src/package_2022_08_01/models.rs index fef97f236d..220a0449b3 100644 --- a/services/mgmt/resourcemover/src/package_2022_08_01/models.rs +++ b/services/mgmt/resourcemover/src/package_2022_08_01/models.rs @@ -767,10 +767,10 @@ pub struct MoveResourceProperties { pub existing_target_id: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "resourceSettings", default, skip_serializing_if = "Option::is_none")] - pub resource_settings: Option, + pub resource_settings: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "sourceResourceSettings", default, skip_serializing_if = "Option::is_none")] - pub source_resource_settings: Option, + pub source_resource_settings: Option, #[doc = "Defines the move resource status."] #[serde(rename = "moveStatus", default, skip_serializing_if = "Option::is_none")] pub move_status: Option, @@ -1454,6 +1454,36 @@ impl ResourceSettings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ResourceSettingsUnion { + #[serde(rename = "Microsoft.Compute/availabilitySets")] + MicrosoftComputeAvailabilitySets(AvailabilitySetResourceSettings), + #[serde(rename = "Microsoft.Compute/diskEncryptionSets")] + MicrosoftComputeDiskEncryptionSets(DiskEncryptionSetResourceSettings), + #[serde(rename = "Microsoft.KeyVault/vaults")] + MicrosoftKeyVaultVaults(KeyVaultResourceSettings), + #[serde(rename = "Microsoft.Network/loadBalancers")] + MicrosoftNetworkLoadBalancers(LoadBalancerResourceSettings), + #[serde(rename = "Microsoft.Network/networkInterfaces")] + MicrosoftNetworkNetworkInterfaces(NetworkInterfaceResourceSettings), + #[serde(rename = "Microsoft.Network/networkSecurityGroups")] + MicrosoftNetworkNetworkSecurityGroups(NetworkSecurityGroupResourceSettings), + #[serde(rename = "Microsoft.Network/publicIPAddresses")] + MicrosoftNetworkPublicIpAddresses(PublicIpAddressResourceSettings), + #[serde(rename = "resourceGroups")] + ResourceGroups(ResourceGroupResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(SqlDatabaseResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/elasticPools")] + MicrosoftSqlServersElasticPools(SqlElasticPoolResourceSettings), + #[serde(rename = "Microsoft.Sql/servers")] + MicrosoftSqlServers(SqlServerResourceSettings), + #[serde(rename = "Microsoft.Compute/virtualMachines")] + MicrosoftComputeVirtualMachines(VirtualMachineResourceSettings), + #[serde(rename = "Microsoft.Network/virtualNetworks")] + MicrosoftNetworkVirtualNetworks(VirtualNetworkResourceSettings), +} #[doc = "Defines the Sql Database resource settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SqlDatabaseResourceSettings { diff --git a/services/mgmt/resourcemover/src/package_2023_08_01/models.rs b/services/mgmt/resourcemover/src/package_2023_08_01/models.rs index 5f1b024a56..6866f2aeb8 100644 --- a/services/mgmt/resourcemover/src/package_2023_08_01/models.rs +++ b/services/mgmt/resourcemover/src/package_2023_08_01/models.rs @@ -767,10 +767,10 @@ pub struct MoveResourceProperties { pub existing_target_id: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "resourceSettings", default, skip_serializing_if = "Option::is_none")] - pub resource_settings: Option, + pub resource_settings: Option, #[doc = "Gets or sets the resource settings."] #[serde(rename = "sourceResourceSettings", default, skip_serializing_if = "Option::is_none")] - pub source_resource_settings: Option, + pub source_resource_settings: Option, #[doc = "Defines the move resource status."] #[serde(rename = "moveStatus", default, skip_serializing_if = "Option::is_none")] pub move_status: Option, @@ -1491,6 +1491,36 @@ impl ResourceSettings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "resourceType")] +pub enum ResourceSettingsUnion { + #[serde(rename = "Microsoft.Compute/availabilitySets")] + MicrosoftComputeAvailabilitySets(AvailabilitySetResourceSettings), + #[serde(rename = "Microsoft.Compute/diskEncryptionSets")] + MicrosoftComputeDiskEncryptionSets(DiskEncryptionSetResourceSettings), + #[serde(rename = "Microsoft.KeyVault/vaults")] + MicrosoftKeyVaultVaults(KeyVaultResourceSettings), + #[serde(rename = "Microsoft.Network/loadBalancers")] + MicrosoftNetworkLoadBalancers(LoadBalancerResourceSettings), + #[serde(rename = "Microsoft.Network/networkInterfaces")] + MicrosoftNetworkNetworkInterfaces(NetworkInterfaceResourceSettings), + #[serde(rename = "Microsoft.Network/networkSecurityGroups")] + MicrosoftNetworkNetworkSecurityGroups(NetworkSecurityGroupResourceSettings), + #[serde(rename = "Microsoft.Network/publicIPAddresses")] + MicrosoftNetworkPublicIpAddresses(PublicIpAddressResourceSettings), + #[serde(rename = "resourceGroups")] + ResourceGroups(ResourceGroupResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/databases")] + MicrosoftSqlServersDatabases(SqlDatabaseResourceSettings), + #[serde(rename = "Microsoft.Sql/servers/elasticPools")] + MicrosoftSqlServersElasticPools(SqlElasticPoolResourceSettings), + #[serde(rename = "Microsoft.Sql/servers")] + MicrosoftSqlServers(SqlServerResourceSettings), + #[serde(rename = "Microsoft.Compute/virtualMachines")] + MicrosoftComputeVirtualMachines(VirtualMachineResourceSettings), + #[serde(rename = "Microsoft.Network/virtualNetworks")] + MicrosoftNetworkVirtualNetworks(VirtualNetworkResourceSettings), +} #[doc = "Defines the Sql Database resource settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SqlDatabaseResourceSettings { diff --git a/services/mgmt/scheduler/src/package_2016_03/models.rs b/services/mgmt/scheduler/src/package_2016_03/models.rs index 8d104d5b5e..4d6e3cdc37 100644 --- a/services/mgmt/scheduler/src/package_2016_03/models.rs +++ b/services/mgmt/scheduler/src/package_2016_03/models.rs @@ -77,10 +77,17 @@ pub mod http_authentication { Basic, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum HttpAuthenticationUnion { + Basic(BasicAuthentication), + ClientCertificate(ClientCertAuthentication), + ActiveDirectoryOAuth(OAuthAuthentication), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HttpRequest { #[serde(default, skip_serializing_if = "Option::is_none")] - pub authentication: Option, + pub authentication: Option, #[doc = "Gets or sets the URI of the request."] #[serde(default, skip_serializing_if = "Option::is_none")] pub uri: Option, diff --git a/services/mgmt/scvmm/src/package_2020_06_05_preview/models.rs b/services/mgmt/scvmm/src/package_2020_06_05_preview/models.rs index def54e4090..6268b53800 100644 --- a/services/mgmt/scvmm/src/package_2020_06_05_preview/models.rs +++ b/services/mgmt/scvmm/src/package_2020_06_05_preview/models.rs @@ -547,7 +547,7 @@ pub struct InventoryItem { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "Defines the resource properties."] - pub properties: InventoryItemProperties, + pub properties: InventoryItemPropertiesUnion, #[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, @@ -556,7 +556,7 @@ pub struct InventoryItem { pub kind: Option, } impl InventoryItem { - pub fn new(properties: InventoryItemProperties) -> Self { + pub fn new(properties: InventoryItemPropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -610,6 +610,14 @@ impl InventoryItemProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inventoryType")] +pub enum InventoryItemPropertiesUnion { + Cloud(CloudInventoryItem), + VirtualMachine(VirtualMachineInventoryItem), + VirtualMachineTemplate(VirtualMachineTemplateInventoryItem), + VirtualNetwork(VirtualNetworkInventoryItem), +} #[doc = "List of InventoryItems."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InventoryItemsList { diff --git a/services/mgmt/scvmm/src/package_2022_05_21_preview/models.rs b/services/mgmt/scvmm/src/package_2022_05_21_preview/models.rs index 7fc86f4d8d..13da43c0f1 100644 --- a/services/mgmt/scvmm/src/package_2022_05_21_preview/models.rs +++ b/services/mgmt/scvmm/src/package_2022_05_21_preview/models.rs @@ -881,13 +881,13 @@ pub struct InventoryItem { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "Defines the resource properties."] - pub properties: InventoryItemProperties, + pub properties: InventoryItemPropertiesUnion, #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value."] #[serde(default, skip_serializing_if = "Option::is_none")] pub kind: Option, } impl InventoryItem { - pub fn new(properties: InventoryItemProperties) -> Self { + pub fn new(properties: InventoryItemPropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -940,6 +940,14 @@ impl InventoryItemProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inventoryType")] +pub enum InventoryItemPropertiesUnion { + Cloud(CloudInventoryItem), + VirtualMachine(VirtualMachineInventoryItem), + VirtualMachineTemplate(VirtualMachineTemplateInventoryItem), + VirtualNetwork(VirtualNetworkInventoryItem), +} #[doc = "List of InventoryItems."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InventoryItemsList { diff --git a/services/mgmt/scvmm/src/package_preview_2023_04/models.rs b/services/mgmt/scvmm/src/package_preview_2023_04/models.rs index 2f7b96ec67..7ee91f7f23 100644 --- a/services/mgmt/scvmm/src/package_preview_2023_04/models.rs +++ b/services/mgmt/scvmm/src/package_preview_2023_04/models.rs @@ -937,13 +937,13 @@ pub struct InventoryItem { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "Defines the resource properties."] - pub properties: InventoryItemProperties, + pub properties: InventoryItemPropertiesUnion, #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value."] #[serde(default, skip_serializing_if = "Option::is_none")] pub kind: Option, } impl InventoryItem { - pub fn new(properties: InventoryItemProperties) -> Self { + pub fn new(properties: InventoryItemPropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -996,6 +996,14 @@ impl InventoryItemProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "inventoryType")] +pub enum InventoryItemPropertiesUnion { + Cloud(CloudInventoryItem), + VirtualMachine(VirtualMachineInventoryItem), + VirtualMachineTemplate(VirtualMachineTemplateInventoryItem), + VirtualNetwork(VirtualNetworkInventoryItem), +} #[doc = "List of InventoryItems."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InventoryItemsList { diff --git a/services/mgmt/security/src/package_2023_05/mod.rs b/services/mgmt/security/src/package_2023_05/mod.rs index 368adb0f71..55f342e671 100644 --- a/services/mgmt/security/src/package_2023_05/mod.rs +++ b/services/mgmt/security/src/package_2023_05/mod.rs @@ -147,7 +147,7 @@ pub mod server_vulnerability_assessments_settings { &self, subscription_id: impl Into, setting_kind: impl Into, - server_vulnerability_assessments_setting: impl Into, + server_vulnerability_assessments_setting: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -300,9 +300,9 @@ pub mod server_vulnerability_assessments_settings { #[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::ServerVulnerabilityAssessmentsSetting = serde_json::from_slice(&bytes)?; + let body: models::ServerVulnerabilityAssessmentsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -385,8 +385,8 @@ pub mod server_vulnerability_assessments_settings { } } 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`."] @@ -406,9 +406,9 @@ pub mod server_vulnerability_assessments_settings { #[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::ServerVulnerabilityAssessmentsSetting = serde_json::from_slice(&bytes)?; + let body: models::ServerVulnerabilityAssessmentsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -451,7 +451,7 @@ pub mod server_vulnerability_assessments_settings { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) setting_kind: String, - pub(crate) server_vulnerability_assessments_setting: models::ServerVulnerabilityAssessmentsSetting, + pub(crate) server_vulnerability_assessments_setting: models::ServerVulnerabilityAssessmentsSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -493,8 +493,8 @@ pub mod server_vulnerability_assessments_settings { } } 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`."] diff --git a/services/mgmt/security/src/package_2023_05/models.rs b/services/mgmt/security/src/package_2023_05/models.rs index 4be6f40925..2c2f7bf7b4 100644 --- a/services/mgmt/security/src/package_2023_05/models.rs +++ b/services/mgmt/security/src/package_2023_05/models.rs @@ -173,6 +173,11 @@ impl ServerVulnerabilityAssessmentsSetting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ServerVulnerabilityAssessmentsSettingUnion { + AzureServersSetting(AzureServersSetting), +} #[doc = "The kind of the server vulnerability assessments setting"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServerVulnerabilityAssessmentsSettingKind")] @@ -219,7 +224,7 @@ pub struct ServerVulnerabilityAssessmentsSettingsList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URI to fetch the next page"] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/security/src/package_composite_v1/mod.rs b/services/mgmt/security/src/package_composite_v1/mod.rs index a03059cce8..fab13f4062 100644 --- a/services/mgmt/security/src/package_composite_v1/mod.rs +++ b/services/mgmt/security/src/package_composite_v1/mod.rs @@ -10832,7 +10832,7 @@ pub mod settings { &self, subscription_id: impl Into, setting_name: impl Into, - setting: impl Into, + setting: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -10973,9 +10973,9 @@ pub mod settings { #[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::Setting = serde_json::from_slice(&bytes)?; + let body: models::SettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11058,8 +11058,8 @@ pub mod settings { } } 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`."] @@ -11079,9 +11079,9 @@ pub mod settings { #[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::Setting = serde_json::from_slice(&bytes)?; + let body: models::SettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11124,7 +11124,7 @@ pub mod settings { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) setting_name: String, - pub(crate) setting: models::Setting, + pub(crate) setting: models::SettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11166,8 +11166,8 @@ pub mod settings { } } 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`."] @@ -16642,9 +16642,9 @@ pub mod external_security_solutions { #[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::ExternalSecuritySolution = serde_json::from_slice(&bytes)?; + let body: models::ExternalSecuritySolutionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16731,8 +16731,8 @@ pub mod external_security_solutions { } } 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`."] diff --git a/services/mgmt/security/src/package_composite_v1/models.rs b/services/mgmt/security/src/package_composite_v1/models.rs index f2c18b5961..7525b9c47f 100644 --- a/services/mgmt/security/src/package_composite_v1/models.rs +++ b/services/mgmt/security/src/package_composite_v1/models.rs @@ -231,6 +231,13 @@ pub mod additional_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "assessedResourceType")] +pub enum AdditionalDataUnion { + ContainerRegistryVulnerability(ContainerRegistryVulnerabilityProperties), + ServerVulnerabilityAssessment(ServerVulnerabilityProperties), + SqlServerVulnerability(SqlServerVulnerabilityProperties), +} #[doc = "The Advanced Threat Protection settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AdvancedThreatProtectionProperties { @@ -948,6 +955,16 @@ pub mod authentication_details_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authenticationType")] +pub enum AuthenticationDetailsPropertiesUnion { + #[serde(rename = "awsAssumeRole")] + AwsAssumeRole(AwAssumeRoleAuthenticationDetailsProperties), + #[serde(rename = "awsCreds")] + AwsCreds(AwsCredsAuthenticationDetailsProperties), + #[serde(rename = "gcpCredentials")] + GcpCredentials(GcpCredentialsDetailsProperties), +} #[doc = "Auto provisioning setting"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AutoProvisioningSetting { @@ -1107,6 +1124,13 @@ pub mod automation_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum AutomationActionUnion { + EventHub(AutomationActionEventHub), + LogicApp(AutomationActionLogicApp), + Workspace(AutomationActionWorkspace), +} #[doc = "The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationActionEventHub { @@ -1219,7 +1243,7 @@ pub struct AutomationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, } impl AutomationProperties { pub fn new() -> Self { @@ -1534,7 +1558,7 @@ pub struct AwsEnvironmentData { pub environment_data: EnvironmentData, #[doc = "The awsOrganization data "] #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, + pub organizational_data: Option, } impl AwsEnvironmentData { pub fn new(environment_data: EnvironmentData) -> Self { @@ -1598,6 +1622,12 @@ pub mod aws_organizational_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "organizationMembershipType")] +pub enum AwsOrganizationalDataUnion { + Organization(AwsOrganizationalDataMaster), + Member(AwsOrganizationalDataMember), +} #[doc = "The awsOrganization data for the master account"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AwsOrganizationalDataMaster { @@ -2064,7 +2094,7 @@ pub struct ConnectorSettingProperties { pub hybrid_compute_settings: Option, #[doc = "Settings for cloud authentication management"] #[serde(rename = "authenticationDetails", default, skip_serializing_if = "Option::is_none")] - pub authentication_details: Option, + pub authentication_details: Option, } impl ConnectorSettingProperties { pub fn new() -> Self { @@ -2150,6 +2180,9 @@ impl CustomAlertRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum CustomAlertRuleUnion {} #[doc = "Custom entity store assignment"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomEntityStoreAssignment { @@ -2579,6 +2612,14 @@ pub mod environment_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "environmentType")] +pub enum EnvironmentDataUnion { + AwsAccount(AwsEnvironmentData), + AzureDevOpsScope(AzureDevOpsScopeEnvironmentData), + GcpProject(GcpProjectEnvironmentData), + GithubScope(GithubScopeEnvironmentData), +} #[doc = "The resource management error additional info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ErrorAdditionalInfo { @@ -2609,6 +2650,16 @@ impl ExternalSecuritySolution { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ExternalSecuritySolutionUnion { + #[serde(rename = "AAD")] + Aad(AadExternalSecuritySolution), + #[serde(rename = "ATA")] + Ata(AtaExternalSecuritySolution), + #[serde(rename = "CEF")] + Cef(CefExternalSecuritySolution), +} #[doc = "Describes an Azure resource with kind"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalSecuritySolutionKind { @@ -2673,7 +2724,7 @@ pub struct ExternalSecuritySolutionList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URI to fetch the next page."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -2864,6 +2915,12 @@ pub mod gcp_organizational_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "organizationMembershipType")] +pub enum GcpOrganizationalDataUnion { + Member(GcpOrganizationalDataMember), + Organization(GcpOrganizationalDataOrganization), +} #[doc = "The gcpOrganization data for the member account"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GcpOrganizationalDataMember { @@ -2940,7 +2997,7 @@ pub struct GcpProjectEnvironmentData { pub environment_data: EnvironmentData, #[doc = "The gcpOrganization data"] #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, + pub organizational_data: Option, #[doc = "The details about the project represented by the security connector"] #[serde(rename = "projectDetails", default, skip_serializing_if = "Option::is_none")] pub project_details: Option, @@ -4646,6 +4703,9 @@ pub mod resource_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "source")] +pub enum ResourceDetailsUnion {} #[doc = "Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote addresses are recommended to be blocked"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Rule { @@ -5444,10 +5504,10 @@ pub struct SecurityConnectorProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub offerings: Vec, + pub offerings: Vec, #[doc = "The security connector environment data."] #[serde(rename = "environmentData", default, skip_serializing_if = "Option::is_none")] - pub environment_data: Option, + pub environment_data: Option, } impl SecurityConnectorProperties { pub fn new() -> Self { @@ -5846,10 +5906,10 @@ pub struct SecuritySubAssessmentProperties { pub time_generated: Option, #[doc = "Details of the resource that was assessed"] #[serde(rename = "resourceDetails", default, skip_serializing_if = "Option::is_none")] - pub resource_details: Option, + pub resource_details: Option, #[doc = "Details of the sub-assessment"] #[serde(rename = "additionalData", default, skip_serializing_if = "Option::is_none")] - pub additional_data: Option, + pub additional_data: Option, } impl SecuritySubAssessmentProperties { pub fn new() -> Self { @@ -6086,6 +6146,11 @@ pub mod setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SettingUnion { + DataExportSetting(DataExportSetting), +} #[doc = "Subscription settings list."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SettingsList { @@ -6095,7 +6160,7 @@ pub struct SettingsList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URI to fetch the next page."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -6829,6 +6894,25 @@ pub mod cloud_offering { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "offeringType")] +pub enum CloudOfferingUnion { + CspmMonitorAws(CspmMonitorAwsOffering), + CspmMonitorAzureDevOps(CspmMonitorAzureDevOpsOffering), + CspmMonitorGcp(CspmMonitorGcpOffering), + CspmMonitorGithub(CspmMonitorGithubOffering), + DefenderCspmAws(DefenderCspmAwsOffering), + DefenderCspmGcp(DefenderCspmGcpOffering), + DefenderForDatabasesAws(DefenderFoDatabasesAwsOffering), + DefenderForContainersAws(DefenderForContainersAwsOffering), + DefenderForContainersGcp(DefenderForContainersGcpOffering), + DefenderForDatabasesGcp(DefenderForDatabasesGcpOffering), + DefenderForDevOpsAzureDevOps(DefenderForDevOpsAzureDevOpsOffering), + DefenderForDevOpsGithub(DefenderForDevOpsGithubOffering), + DefenderForServersAws(DefenderForServersAwsOffering), + DefenderForServersGcp(DefenderForServersGcpOffering), + InformationProtectionAws(InformationProtectionAwsOffering), +} #[doc = "The CSPM monitoring for AWS offering"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CspmMonitorAwsOffering { diff --git a/services/mgmt/security/src/package_composite_v2/mod.rs b/services/mgmt/security/src/package_composite_v2/mod.rs index 1028481272..0bd24972bd 100644 --- a/services/mgmt/security/src/package_composite_v2/mod.rs +++ b/services/mgmt/security/src/package_composite_v2/mod.rs @@ -10437,7 +10437,7 @@ pub mod settings { &self, subscription_id: impl Into, setting_name: impl Into, - setting: impl Into, + setting: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -10578,9 +10578,9 @@ pub mod settings { #[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::Setting = serde_json::from_slice(&bytes)?; + let body: models::SettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10663,8 +10663,8 @@ pub mod settings { } } 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`."] @@ -10684,9 +10684,9 @@ pub mod settings { #[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::Setting = serde_json::from_slice(&bytes)?; + let body: models::SettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10729,7 +10729,7 @@ pub mod settings { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) setting_name: String, - pub(crate) setting: models::Setting, + pub(crate) setting: models::SettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10771,8 +10771,8 @@ pub mod settings { } } 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`."] @@ -18075,9 +18075,9 @@ pub mod external_security_solutions { #[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::ExternalSecuritySolution = serde_json::from_slice(&bytes)?; + let body: models::ExternalSecuritySolutionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18164,8 +18164,8 @@ pub mod external_security_solutions { } } 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`."] diff --git a/services/mgmt/security/src/package_composite_v2/models.rs b/services/mgmt/security/src/package_composite_v2/models.rs index 38a11216e1..07e477fe57 100644 --- a/services/mgmt/security/src/package_composite_v2/models.rs +++ b/services/mgmt/security/src/package_composite_v2/models.rs @@ -231,6 +231,13 @@ pub mod additional_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "assessedResourceType")] +pub enum AdditionalDataUnion { + ContainerRegistryVulnerability(ContainerRegistryVulnerabilityProperties), + ServerVulnerabilityAssessment(ServerVulnerabilityProperties), + SqlServerVulnerability(SqlServerVulnerabilityProperties), +} #[doc = "The Advanced Threat Protection settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AdvancedThreatProtectionProperties { @@ -948,6 +955,16 @@ pub mod authentication_details_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authenticationType")] +pub enum AuthenticationDetailsPropertiesUnion { + #[serde(rename = "awsAssumeRole")] + AwsAssumeRole(AwAssumeRoleAuthenticationDetailsProperties), + #[serde(rename = "awsCreds")] + AwsCreds(AwsCredsAuthenticationDetailsProperties), + #[serde(rename = "gcpCredentials")] + GcpCredentials(GcpCredentialsDetailsProperties), +} #[doc = "Auto provisioning setting"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AutoProvisioningSetting { @@ -1107,6 +1124,13 @@ pub mod automation_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum AutomationActionUnion { + EventHub(AutomationActionEventHub), + LogicApp(AutomationActionLogicApp), + Workspace(AutomationActionWorkspace), +} #[doc = "The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationActionEventHub { @@ -1219,7 +1243,7 @@ pub struct AutomationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, } impl AutomationProperties { pub fn new() -> Self { @@ -1534,7 +1558,7 @@ pub struct AwsEnvironmentData { pub environment_data: EnvironmentData, #[doc = "The awsOrganization data "] #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, + pub organizational_data: Option, } impl AwsEnvironmentData { pub fn new(environment_data: EnvironmentData) -> Self { @@ -1598,6 +1622,12 @@ pub mod aws_organizational_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "organizationMembershipType")] +pub enum AwsOrganizationalDataUnion { + Organization(AwsOrganizationalDataMaster), + Member(AwsOrganizationalDataMember), +} #[doc = "The awsOrganization data for the master account"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AwsOrganizationalDataMaster { @@ -2064,7 +2094,7 @@ pub struct ConnectorSettingProperties { pub hybrid_compute_settings: Option, #[doc = "Settings for cloud authentication management"] #[serde(rename = "authenticationDetails", default, skip_serializing_if = "Option::is_none")] - pub authentication_details: Option, + pub authentication_details: Option, } impl ConnectorSettingProperties { pub fn new() -> Self { @@ -2150,6 +2180,9 @@ impl CustomAlertRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum CustomAlertRuleUnion {} #[doc = "Custom entity store assignment"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomEntityStoreAssignment { @@ -2579,6 +2612,14 @@ pub mod environment_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "environmentType")] +pub enum EnvironmentDataUnion { + AwsAccount(AwsEnvironmentData), + AzureDevOpsScope(AzureDevOpsScopeEnvironmentData), + GcpProject(GcpProjectEnvironmentData), + GithubScope(GithubScopeEnvironmentData), +} #[doc = "The resource management error additional info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ErrorAdditionalInfo { @@ -2609,6 +2650,16 @@ impl ExternalSecuritySolution { Self::default() } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ExternalSecuritySolutionUnion { + #[serde(rename = "AAD")] + Aad(AadExternalSecuritySolution), + #[serde(rename = "ATA")] + Ata(AtaExternalSecuritySolution), + #[serde(rename = "CEF")] + Cef(CefExternalSecuritySolution), +} #[doc = "Describes an Azure resource with kind"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalSecuritySolutionKind { @@ -2673,7 +2724,7 @@ pub struct ExternalSecuritySolutionList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URI to fetch the next page."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -2864,6 +2915,12 @@ pub mod gcp_organizational_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "organizationMembershipType")] +pub enum GcpOrganizationalDataUnion { + Member(GcpOrganizationalDataMember), + Organization(GcpOrganizationalDataOrganization), +} #[doc = "The gcpOrganization data for the member account"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GcpOrganizationalDataMember { @@ -2940,7 +2997,7 @@ pub struct GcpProjectEnvironmentData { pub environment_data: EnvironmentData, #[doc = "The gcpOrganization data"] #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, + pub organizational_data: Option, #[doc = "The details about the project represented by the security connector"] #[serde(rename = "projectDetails", default, skip_serializing_if = "Option::is_none")] pub project_details: Option, @@ -5455,6 +5512,9 @@ pub mod resource_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "source")] +pub enum ResourceDetailsUnion {} #[doc = "Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote addresses are recommended to be blocked"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Rule { @@ -6253,10 +6313,10 @@ pub struct SecurityConnectorProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub offerings: Vec, + pub offerings: Vec, #[doc = "The security connector environment data."] #[serde(rename = "environmentData", default, skip_serializing_if = "Option::is_none")] - pub environment_data: Option, + pub environment_data: Option, } impl SecurityConnectorProperties { pub fn new() -> Self { @@ -6655,10 +6715,10 @@ pub struct SecuritySubAssessmentProperties { pub time_generated: Option, #[doc = "Details of the resource that was assessed"] #[serde(rename = "resourceDetails", default, skip_serializing_if = "Option::is_none")] - pub resource_details: Option, + pub resource_details: Option, #[doc = "Details of the sub-assessment"] #[serde(rename = "additionalData", default, skip_serializing_if = "Option::is_none")] - pub additional_data: Option, + pub additional_data: Option, } impl SecuritySubAssessmentProperties { pub fn new() -> Self { @@ -6895,6 +6955,11 @@ pub mod setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SettingUnion { + DataExportSetting(DataExportSetting), +} #[doc = "Subscription settings list."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SettingsList { @@ -6904,7 +6969,7 @@ pub struct SettingsList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URI to fetch the next page."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -7683,6 +7748,25 @@ pub mod cloud_offering { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "offeringType")] +pub enum CloudOfferingUnion { + CspmMonitorAws(CspmMonitorAwsOffering), + CspmMonitorAzureDevOps(CspmMonitorAzureDevOpsOffering), + CspmMonitorGcp(CspmMonitorGcpOffering), + CspmMonitorGithub(CspmMonitorGithubOffering), + DefenderCspmAws(DefenderCspmAwsOffering), + DefenderCspmGcp(DefenderCspmGcpOffering), + DefenderForDatabasesAws(DefenderFoDatabasesAwsOffering), + DefenderForContainersAws(DefenderForContainersAwsOffering), + DefenderForContainersGcp(DefenderForContainersGcpOffering), + DefenderForDatabasesGcp(DefenderForDatabasesGcpOffering), + DefenderForDevOpsAzureDevOps(DefenderForDevOpsAzureDevOpsOffering), + DefenderForDevOpsGithub(DefenderForDevOpsGithubOffering), + DefenderForServersAws(DefenderForServersAwsOffering), + DefenderForServersGcp(DefenderForServersGcpOffering), + InformationProtectionAws(InformationProtectionAwsOffering), +} #[doc = "The CSPM monitoring for AWS offering"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CspmMonitorAwsOffering { diff --git a/services/mgmt/security/src/package_dotnet_sdk/mod.rs b/services/mgmt/security/src/package_dotnet_sdk/mod.rs index 948af435ae..25e81b359f 100644 --- a/services/mgmt/security/src/package_dotnet_sdk/mod.rs +++ b/services/mgmt/security/src/package_dotnet_sdk/mod.rs @@ -16556,9 +16556,9 @@ pub mod external_security_solutions { #[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::ExternalSecuritySolution = serde_json::from_slice(&bytes)?; + let body: models::ExternalSecuritySolutionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16645,8 +16645,8 @@ pub mod external_security_solutions { } } 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`."] @@ -20134,7 +20134,7 @@ pub mod settings { &self, subscription_id: impl Into, setting_name: impl Into, - setting: impl Into, + setting: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -20275,9 +20275,9 @@ pub mod settings { #[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::Setting = serde_json::from_slice(&bytes)?; + let body: models::SettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20360,8 +20360,8 @@ pub mod settings { } } 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`."] @@ -20381,9 +20381,9 @@ pub mod settings { #[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::Setting = serde_json::from_slice(&bytes)?; + let body: models::SettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20426,7 +20426,7 @@ pub mod settings { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) setting_name: String, - pub(crate) setting: models::Setting, + pub(crate) setting: models::SettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -20468,8 +20468,8 @@ pub mod settings { } } 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`."] diff --git a/services/mgmt/security/src/package_dotnet_sdk/models.rs b/services/mgmt/security/src/package_dotnet_sdk/models.rs index 76dcf43cf3..0f744c61dc 100644 --- a/services/mgmt/security/src/package_dotnet_sdk/models.rs +++ b/services/mgmt/security/src/package_dotnet_sdk/models.rs @@ -323,6 +323,13 @@ pub mod additional_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "assessedResourceType")] +pub enum AdditionalDataUnion { + ContainerRegistryVulnerability(ContainerRegistryVulnerabilityProperties), + ServerVulnerabilityAssessment(ServerVulnerabilityProperties), + SqlServerVulnerability(SqlServerVulnerabilityProperties), +} #[doc = "Properties of the additional workspaces."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AdditionalWorkspacesProperties { @@ -522,7 +529,7 @@ pub struct AlertProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub resource_identifiers: Vec, + pub resource_identifiers: Vec, #[doc = "Manual action items to take to remediate the alert."] #[serde( rename = "remediationSteps", @@ -788,7 +795,7 @@ impl AlertSimulatorBundlesRequestProperties { pub struct AlertSimulatorRequestBody { #[doc = "Describes properties of an alert simulation request"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AlertSimulatorRequestBody { pub fn new() -> Self { @@ -844,6 +851,11 @@ pub mod alert_simulator_request_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertSimulatorRequestPropertiesUnion { + Bundles(AlertSimulatorBundlesRequestProperties), +} #[doc = "The alert sync setting properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AlertSyncSettingProperties { @@ -1518,6 +1530,16 @@ pub mod authentication_details_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authenticationType")] +pub enum AuthenticationDetailsPropertiesUnion { + #[serde(rename = "awsAssumeRole")] + AwsAssumeRole(AwAssumeRoleAuthenticationDetailsProperties), + #[serde(rename = "awsCreds")] + AwsCreds(AwsCredsAuthenticationDetailsProperties), + #[serde(rename = "gcpCredentials")] + GcpCredentials(GcpCredentialsDetailsProperties), +} #[doc = "Auto provisioning setting"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AutoProvisioningSetting { @@ -1677,6 +1699,13 @@ pub mod automation_action { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum AutomationActionUnion { + EventHub(AutomationActionEventHub), + LogicApp(AutomationActionLogicApp), + Workspace(AutomationActionWorkspace), +} #[doc = "The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationActionEventHub { @@ -1789,7 +1818,7 @@ pub struct AutomationProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub actions: Vec, + pub actions: Vec, } impl AutomationProperties { pub fn new() -> Self { @@ -2104,7 +2133,7 @@ pub struct AwsEnvironmentData { pub environment_data: EnvironmentData, #[doc = "The awsOrganization data "] #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, + pub organizational_data: Option, } impl AwsEnvironmentData { pub fn new(environment_data: EnvironmentData) -> Self { @@ -2168,6 +2197,12 @@ pub mod aws_organizational_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "organizationMembershipType")] +pub enum AwsOrganizationalDataUnion { + Organization(AwsOrganizationalDataMaster), + Member(AwsOrganizationalDataMember), +} #[doc = "The awsOrganization data for the master account"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AwsOrganizationalDataMaster { @@ -2868,7 +2903,7 @@ pub struct ConnectorSettingProperties { pub hybrid_compute_settings: Option, #[doc = "Settings for cloud authentication management"] #[serde(rename = "authenticationDetails", default, skip_serializing_if = "Option::is_none")] - pub authentication_details: Option, + pub authentication_details: Option, } impl ConnectorSettingProperties { pub fn new() -> Self { @@ -2954,6 +2989,9 @@ impl CustomAlertRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ruleType")] +pub enum CustomAlertRuleUnion {} #[doc = "Custom entity store assignment"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomEntityStoreAssignment { @@ -3383,6 +3421,14 @@ pub mod environment_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "environmentType")] +pub enum EnvironmentDataUnion { + AwsAccount(AwsEnvironmentData), + AzureDevOpsScope(AzureDevOpsScopeEnvironmentData), + GcpProject(GcpProjectEnvironmentData), + GithubScope(GithubScopeEnvironmentData), +} #[doc = "The resource management error additional info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ErrorAdditionalInfo { @@ -3494,6 +3540,16 @@ impl ExternalSecuritySolution { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ExternalSecuritySolutionUnion { + #[serde(rename = "AAD")] + Aad(AadExternalSecuritySolution), + #[serde(rename = "ATA")] + Ata(AtaExternalSecuritySolution), + #[serde(rename = "CEF")] + Cef(CefExternalSecuritySolution), +} #[doc = "Describes an Azure resource with kind"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalSecuritySolutionKind { @@ -3558,7 +3614,7 @@ pub struct ExternalSecuritySolutionList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URI to fetch the next page."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -3749,6 +3805,12 @@ pub mod gcp_organizational_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "organizationMembershipType")] +pub enum GcpOrganizationalDataUnion { + Member(GcpOrganizationalDataMember), + Organization(GcpOrganizationalDataOrganization), +} #[doc = "The gcpOrganization data for the member account"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GcpOrganizationalDataMember { @@ -3825,7 +3887,7 @@ pub struct GcpProjectEnvironmentData { pub environment_data: EnvironmentData, #[doc = "The gcpOrganization data"] #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, + pub organizational_data: Option, #[doc = "The details about the project represented by the security connector"] #[serde(rename = "projectDetails", default, skip_serializing_if = "Option::is_none")] pub project_details: Option, @@ -6950,6 +7012,9 @@ pub mod resource_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "source")] +pub enum ResourceDetailsUnion {} #[doc = "A resource identifier for an alert which can be used to direct the alert to the right product exposure group (tenant, workspace, subscription etc.)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResourceIdentifier { @@ -7002,6 +7067,12 @@ pub mod resource_identifier { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ResourceIdentifierUnion { + AzureResource(AzureResourceIdentifier), + LogAnalytics(LogAnalyticsIdentifier), +} #[doc = "Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote addresses are recommended to be blocked"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Rule { @@ -8190,7 +8261,7 @@ impl SecurityAssessmentProperties { pub struct SecurityAssessmentPropertiesBase { #[doc = "Details of the resource that was assessed"] #[serde(rename = "resourceDetails")] - pub resource_details: ResourceDetails, + pub resource_details: ResourceDetailsUnion, #[doc = "User friendly display name of the assessment"] #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] pub display_name: Option, @@ -8208,7 +8279,7 @@ pub struct SecurityAssessmentPropertiesBase { pub partners_data: Option, } impl SecurityAssessmentPropertiesBase { - pub fn new(resource_details: ResourceDetails) -> Self { + pub fn new(resource_details: ResourceDetailsUnion) -> Self { Self { resource_details, display_name: None, @@ -8284,10 +8355,10 @@ pub struct SecurityConnectorProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub offerings: Vec, + pub offerings: Vec, #[doc = "The security connector environment data."] #[serde(rename = "environmentData", default, skip_serializing_if = "Option::is_none")] - pub environment_data: Option, + pub environment_data: Option, } impl SecurityConnectorProperties { pub fn new() -> Self { @@ -8835,10 +8906,10 @@ pub struct SecuritySubAssessmentProperties { pub time_generated: Option, #[doc = "Details of the resource that was assessed"] #[serde(rename = "resourceDetails", default, skip_serializing_if = "Option::is_none")] - pub resource_details: Option, + pub resource_details: Option, #[doc = "Details of the sub-assessment"] #[serde(rename = "additionalData", default, skip_serializing_if = "Option::is_none")] - pub additional_data: Option, + pub additional_data: Option, } impl SecuritySubAssessmentProperties { pub fn new() -> Self { @@ -9130,6 +9201,12 @@ pub mod setting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SettingUnion { + AlertSyncSettings(AlertSyncSettings), + DataExportSettings(DataExportSettings), +} #[doc = "Subscription settings list."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SettingsList { @@ -9139,7 +9216,7 @@ pub struct SettingsList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URI to fetch the next page."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -9930,6 +10007,25 @@ pub mod cloud_offering { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "offeringType")] +pub enum CloudOfferingUnion { + CspmMonitorAws(CspmMonitorAwsOffering), + CspmMonitorAzureDevOps(CspmMonitorAzureDevOpsOffering), + CspmMonitorGcp(CspmMonitorGcpOffering), + CspmMonitorGithub(CspmMonitorGithubOffering), + DefenderCspmAws(DefenderCspmAwsOffering), + DefenderCspmGcp(DefenderCspmGcpOffering), + DefenderForDatabasesAws(DefenderFoDatabasesAwsOffering), + DefenderForContainersAws(DefenderForContainersAwsOffering), + DefenderForContainersGcp(DefenderForContainersGcpOffering), + DefenderForDatabasesGcp(DefenderForDatabasesGcpOffering), + DefenderForDevOpsAzureDevOps(DefenderForDevOpsAzureDevOpsOffering), + DefenderForDevOpsGithub(DefenderForDevOpsGithubOffering), + DefenderForServersAws(DefenderForServersAwsOffering), + DefenderForServersGcp(DefenderForServersGcpOffering), + InformationProtectionAws(InformationProtectionAwsOffering), +} #[doc = "The CSPM monitoring for AWS offering"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CspmMonitorAwsOffering { diff --git a/services/mgmt/securityinsights/src/package_preview_2023_04/mod.rs b/services/mgmt/securityinsights/src/package_preview_2023_04/mod.rs index d0727668c6..d26dc896b3 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_04/mod.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_04/mod.rs @@ -338,7 +338,7 @@ pub mod alert_rules { resource_group_name: impl Into, workspace_name: impl Into, rule_id: impl Into, - alert_rule: impl Into, + alert_rule: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -501,9 +501,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -583,8 +583,8 @@ pub mod alert_rules { } } 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`."] @@ -604,9 +604,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -651,7 +651,7 @@ pub mod alert_rules { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) rule_id: String, - pub(crate) alert_rule: models::AlertRule, + pub(crate) alert_rule: models::AlertRuleUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -688,8 +688,8 @@ pub mod alert_rules { } } 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`."] @@ -1494,9 +1494,9 @@ pub mod alert_rule_templates { #[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::AlertRuleTemplate = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1576,8 +1576,8 @@ pub mod alert_rule_templates { } } 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`."] @@ -2499,9 +2499,9 @@ pub mod entities { #[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::Entity = serde_json::from_slice(&bytes)?; + let body: models::EntityUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2581,8 +2581,8 @@ pub mod entities { } } 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`."] @@ -7909,7 +7909,7 @@ pub mod entity_queries { resource_group_name: impl Into, workspace_name: impl Into, entity_query_id: impl Into, - entity_query: impl Into, + entity_query: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -8081,9 +8081,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8163,8 +8163,8 @@ pub mod entity_queries { } } 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`."] @@ -8184,9 +8184,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8231,7 +8231,7 @@ pub mod entity_queries { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) entity_query_id: String, - pub(crate) entity_query: models::CustomEntityQuery, + pub(crate) entity_query: models::CustomEntityQueryUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8268,8 +8268,8 @@ pub mod entity_queries { } } 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`."] @@ -8556,9 +8556,9 @@ pub mod entity_query_templates { #[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::EntityQueryTemplate = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8638,8 +8638,8 @@ pub mod entity_query_templates { } } 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`."] @@ -14698,7 +14698,7 @@ pub mod security_ml_analytics_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_resource_name: impl Into, - security_ml_analytics_setting: impl Into, + security_ml_analytics_setting: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -14861,9 +14861,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14943,8 +14943,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -14964,9 +14964,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15011,7 +15011,7 @@ pub mod security_ml_analytics_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_resource_name: String, - pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSetting, + pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15048,8 +15048,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -15210,7 +15210,7 @@ pub mod product_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_name: impl Into, - settings: impl Into, + settings: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -15355,9 +15355,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15437,8 +15437,8 @@ pub mod product_settings { } } 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`."] @@ -15458,9 +15458,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15505,7 +15505,7 @@ pub mod product_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_name: String, - pub(crate) settings: models::Settings, + pub(crate) settings: models::SettingsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15542,8 +15542,8 @@ pub mod product_settings { } } 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`."] @@ -16488,9 +16488,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16571,8 +16571,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16592,9 +16592,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16674,8 +16674,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16695,9 +16695,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16779,8 +16779,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -17096,9 +17096,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17180,8 +17180,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -21791,7 +21791,7 @@ pub mod data_connectors { resource_group_name: impl Into, workspace_name: impl Into, data_connector_id: impl Into, - data_connector: impl Into, + data_connector: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -22001,9 +22001,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22083,8 +22083,8 @@ pub mod data_connectors { } } 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`."] @@ -22104,9 +22104,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22151,7 +22151,7 @@ pub mod data_connectors { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) data_connector_id: String, - pub(crate) data_connector: models::DataConnector, + pub(crate) data_connector: models::DataConnectorUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22188,8 +22188,8 @@ pub mod data_connectors { } } 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`."] @@ -22482,7 +22482,7 @@ pub mod data_connectors_check_requirements { subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - data_connectors_check_requirements: impl Into, + data_connectors_check_requirements: impl Into, ) -> post::RequestBuilder { post::RequestBuilder { client: self.0.clone(), @@ -22548,7 +22548,7 @@ pub mod data_connectors_check_requirements { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirements, + pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirementsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/securityinsights/src/package_preview_2023_04/models.rs b/services/mgmt/securityinsights/src/package_preview_2023_04/models.rs index 1b57fb63a2..56fbe3900c 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_04/models.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_04/models.rs @@ -703,6 +703,18 @@ impl AlertRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleUnion { + Fusion(FusionAlertRule), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRule), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRule), + #[serde(rename = "NRT")] + Nrt(NrtAlertRule), + Scheduled(ScheduledAlertRule), + ThreatIntelligence(ThreatIntelligenceAlertRule), +} #[doc = "The kind of the alert rule"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AlertRuleKindEnum")] @@ -768,6 +780,18 @@ impl AlertRuleTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleTemplateUnion { + Fusion(FusionAlertRuleTemplate), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRuleTemplate), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRuleTemplate), + #[serde(rename = "NRT")] + Nrt(NrtAlertRuleTemplate), + Scheduled(ScheduledAlertRuleTemplate), + ThreatIntelligence(ThreatIntelligenceAlertRuleTemplate), +} #[doc = "alert rule template data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AlertRuleTemplateDataSource { @@ -894,7 +918,7 @@ pub struct AlertRuleTemplatesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rule templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRuleTemplatesList { type Continuation = String; @@ -903,7 +927,7 @@ impl azure_core::Continuable for AlertRuleTemplatesList { } } impl AlertRuleTemplatesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -922,7 +946,7 @@ pub struct AlertRulesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rules."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRulesList { type Continuation = String; @@ -931,7 +955,7 @@ impl azure_core::Continuable for AlertRulesList { } } impl AlertRulesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -1359,6 +1383,13 @@ impl AutomationRuleAction { Self { order, action_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum AutomationRuleActionUnion { + AddIncidentTask(AutomationRuleAddIncidentTaskAction), + ModifyProperties(AutomationRuleModifyPropertiesAction), + RunPlaybook(AutomationRuleRunPlaybookAction), +} #[doc = "Describes an automation rule action to add a task to an incident"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleAddIncidentTaskAction { @@ -1385,7 +1416,7 @@ pub struct AutomationRuleBooleanCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inner_conditions: Vec, + pub inner_conditions: Vec, } impl AutomationRuleBooleanCondition { pub fn new() -> Self { @@ -1439,6 +1470,15 @@ impl AutomationRuleCondition { Self { condition_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "conditionType")] +pub enum AutomationRuleConditionUnion { + Boolean(BooleanConditionProperties), + PropertyArrayChanged(PropertyArrayChangedConditionProperties), + PropertyArray(PropertyArrayConditionProperties), + PropertyChanged(PropertyChangedConditionProperties), + Property(PropertyConditionProperties), +} #[doc = "Describes an automation rule action to modify an object's properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleModifyPropertiesAction { @@ -1467,7 +1507,7 @@ pub struct AutomationRuleProperties { #[serde(rename = "triggeringLogic")] pub triggering_logic: AutomationRuleTriggeringLogic, #[doc = "The actions to execute when the automation rule is triggered."] - pub actions: Vec, + pub actions: Vec, #[doc = "The last time the automation rule was updated."] #[serde(rename = "lastModifiedTimeUtc", default, with = "azure_core::date::rfc3339::option")] pub last_modified_time_utc: Option, @@ -1486,7 +1526,7 @@ impl AutomationRuleProperties { display_name: String, order: i32, triggering_logic: AutomationRuleTriggeringLogic, - actions: Vec, + actions: Vec, ) -> Self { Self { display_name, @@ -1684,7 +1724,7 @@ pub struct AutomationRulePropertyArrayValuesCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub item_conditions: Vec, + pub item_conditions: Vec, } impl AutomationRulePropertyArrayValuesCondition { pub fn new() -> Self { @@ -2178,7 +2218,7 @@ pub struct AutomationRuleTriggeringLogic { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, } impl AutomationRuleTriggeringLogic { pub fn new(is_enabled: bool, triggers_on: TriggersOn, triggers_when: TriggersWhen) -> Self { @@ -2467,7 +2507,7 @@ pub mod bookmark_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of expansion result connected entities"] #[serde( default, @@ -3294,6 +3334,11 @@ impl CustomEntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum CustomEntityQueryUnion { + Activity(ActivityCustomEntityQuery), +} #[doc = "The kind of the entity query that supports put request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "CustomEntityQueryKind")] @@ -3371,6 +3416,37 @@ impl DataConnector { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorUnion { + AzureActiveDirectory(AadDataConnector), + AzureAdvancedThreatProtection(AatpDataConnector), + AzureSecurityCenter(AscDataConnector), + AmazonWebServicesCloudTrail(AwsCloudTrailDataConnector), + AmazonWebServicesS3(AwsS3DataConnector), + #[serde(rename = "APIPolling")] + ApiPolling(CodelessApiPollingDataConnector), + #[serde(rename = "GenericUI")] + GenericUi(CodelessUiDataConnector), + Dynamics365(Dynamics365DataConnector), + #[serde(rename = "IOT")] + Iot(IoTDataConnector), + MicrosoftCloudAppSecurity(McasDataConnector), + MicrosoftDefenderAdvancedThreatProtection(MdatpDataConnector), + MicrosoftThreatIntelligence(MstiDataConnector), + MicrosoftThreatProtection(MtpDataConnector), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionDataConnector), + Office365Project(Office365ProjectDataConnector), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpDataConnector), + Office365(OfficeDataConnector), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmDataConnector), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiDataConnector), + ThreatIntelligence(TiDataConnector), + ThreatIntelligenceTaxii(TiTaxiiDataConnector), +} #[doc = "Describes the state of user's authorization for a connector kind."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DataConnectorAuthorizationState")] @@ -3686,7 +3762,7 @@ pub struct DataConnectorList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of data connectors."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataConnectorList { type Continuation = String; @@ -3695,7 +3771,7 @@ impl azure_core::Continuable for DataConnectorList { } } impl DataConnectorList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -3749,6 +3825,32 @@ impl DataConnectorsCheckRequirements { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorsCheckRequirementsUnion { + AzureActiveDirectory(AadCheckRequirements), + AzureAdvancedThreatProtection(AatpCheckRequirements), + AzureSecurityCenter(AscCheckRequirements), + AmazonWebServicesCloudTrail(AwsCloudTrailCheckRequirements), + AmazonWebServicesS3(AwsS3CheckRequirements), + Dynamics365(Dynamics365CheckRequirements), + #[serde(rename = "IOT")] + Iot(IoTCheckRequirements), + MicrosoftCloudAppSecurity(McasCheckRequirements), + MicrosoftDefenderAdvancedThreatProtection(MdatpCheckRequirements), + MicrosoftThreatIntelligence(MstiCheckRequirements), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionCheckRequirements), + MicrosoftThreatProtection(MtpCheckRequirements), + Office365Project(Office365ProjectCheckRequirements), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpCheckRequirements), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmCheckRequirements), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiCheckRequirements), + ThreatIntelligence(TiCheckRequirements), + ThreatIntelligenceTaxii(TiTaxiiCheckRequirements), +} #[doc = "The data type definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTypeDefinitions { @@ -4223,6 +4325,12 @@ impl Entity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityUnion { + Bookmark(HuntingBookmark), + SecurityAlert(SecurityAlert), +} #[doc = "Settings with single toggle."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityAnalytics { @@ -4331,7 +4439,7 @@ pub mod entity_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of edges that connects the entity to the list of entities."] #[serde( default, @@ -4619,7 +4727,7 @@ pub struct EntityList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entities."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityList { type Continuation = String; @@ -4628,7 +4736,7 @@ impl azure_core::Continuable for EntityList { } } impl EntityList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4801,6 +4909,12 @@ impl EntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryUnion { + Activity(ActivityEntityQuery), + Expansion(ExpansionEntityQuery), +} #[doc = "An abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityQueryItem { @@ -4826,6 +4940,11 @@ impl EntityQueryItem { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryItemUnion { + Insight(InsightQueryItem), +} #[doc = "An properties abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EntityQueryItemProperties { @@ -4903,7 +5022,7 @@ pub struct EntityQueryList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity queries."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryList { type Continuation = String; @@ -4912,7 +5031,7 @@ impl azure_core::Continuable for EntityQueryList { } } impl EntityQueryList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4932,6 +5051,11 @@ impl EntityQueryTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryTemplateUnion { + Activity(ActivityEntityQueryTemplate), +} #[doc = "The kind of the entity query template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityQueryTemplateKind")] @@ -4974,7 +5098,7 @@ pub struct EntityQueryTemplateList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity query templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryTemplateList { type Continuation = String; @@ -4983,7 +5107,7 @@ impl azure_core::Continuable for EntityQueryTemplateList { } } impl EntityQueryTemplateList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4998,6 +5122,14 @@ impl EntityTimelineItem { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityTimelineItemUnion { + Activity(ActivityTimelineItem), + Anomaly(AnomalyTimelineItem), + Bookmark(BookmarkTimelineItem), + SecurityAlert(SecurityAlertTimelineItem), +} #[doc = "The entity query kind"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityTimelineKind")] @@ -5081,7 +5213,7 @@ pub struct EntityTimelineResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EntityTimelineResponse { pub fn new() -> Self { @@ -6107,7 +6239,7 @@ pub struct GetQueriesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl GetQueriesResponse { pub fn new() -> Self { @@ -6920,7 +7052,7 @@ pub struct IncidentEntitiesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "The metadata from the incident related entities results."] #[serde( rename = "metaData", @@ -10726,6 +10858,11 @@ impl SecurityMlAnalyticsSetting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecurityMlAnalyticsSettingUnion { + Anomaly(AnomalySecurityMlAnalyticsSettings), +} #[doc = "security ml analytics settings data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityMlAnalyticsSettingsDataSource { @@ -10788,7 +10925,7 @@ pub struct SecurityMlAnalyticsSettingsList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of SecurityMLAnalyticsSettings"] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { type Continuation = String; @@ -10797,7 +10934,7 @@ impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { } } impl SecurityMlAnalyticsSettingsList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -10855,10 +10992,10 @@ impl SentinelOnboardingStatesList { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SettingList { #[doc = "Array of settings."] - pub value: Vec, + pub value: Vec, } impl SettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value } } } @@ -10922,6 +11059,14 @@ pub mod settings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SettingsUnion { + Anomalies(Anomalies), + EntityAnalytics(EntityAnalytics), + EyesOn(EyesOn), + Ueba(Ueba), +} #[doc = "Represents a SourceControl in Azure Security Insights."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceControl { @@ -11550,6 +11695,12 @@ impl ThreatIntelligenceInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ThreatIntelligenceInformationUnion { + #[serde(rename = "indicator")] + Indicator(ThreatIntelligenceIndicatorModel), +} #[doc = "List of all the threat intelligence information objects."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ThreatIntelligenceInformationList { @@ -11557,7 +11708,7 @@ pub struct ThreatIntelligenceInformationList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of threat intelligence information objects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for ThreatIntelligenceInformationList { type Continuation = String; @@ -11566,7 +11717,7 @@ impl azure_core::Continuable for ThreatIntelligenceInformationList { } } impl ThreatIntelligenceInformationList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/securityinsights/src/package_preview_2023_05/mod.rs b/services/mgmt/securityinsights/src/package_preview_2023_05/mod.rs index 4734580da0..4983d53ce2 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_05/mod.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_05/mod.rs @@ -341,7 +341,7 @@ pub mod alert_rules { resource_group_name: impl Into, workspace_name: impl Into, rule_id: impl Into, - alert_rule: impl Into, + alert_rule: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -504,9 +504,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -586,8 +586,8 @@ pub mod alert_rules { } } 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`."] @@ -607,9 +607,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -654,7 +654,7 @@ pub mod alert_rules { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) rule_id: String, - pub(crate) alert_rule: models::AlertRule, + pub(crate) alert_rule: models::AlertRuleUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -691,8 +691,8 @@ pub mod alert_rules { } } 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`."] @@ -1497,9 +1497,9 @@ pub mod alert_rule_templates { #[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::AlertRuleTemplate = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1579,8 +1579,8 @@ pub mod alert_rule_templates { } } 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`."] @@ -2502,9 +2502,9 @@ pub mod entities { #[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::Entity = serde_json::from_slice(&bytes)?; + let body: models::EntityUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2584,8 +2584,8 @@ pub mod entities { } } 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`."] @@ -4287,9 +4287,9 @@ pub mod billing_statistics { #[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::BillingStatistic = serde_json::from_slice(&bytes)?; + let body: models::BillingStatisticUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4369,8 +4369,8 @@ pub mod billing_statistics { } } 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`."] @@ -8186,7 +8186,7 @@ pub mod entity_queries { resource_group_name: impl Into, workspace_name: impl Into, entity_query_id: impl Into, - entity_query: impl Into, + entity_query: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -8358,9 +8358,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8440,8 +8440,8 @@ pub mod entity_queries { } } 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`."] @@ -8461,9 +8461,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8508,7 +8508,7 @@ pub mod entity_queries { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) entity_query_id: String, - pub(crate) entity_query: models::CustomEntityQuery, + pub(crate) entity_query: models::CustomEntityQueryUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8545,8 +8545,8 @@ pub mod entity_queries { } } 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`."] @@ -8833,9 +8833,9 @@ pub mod entity_query_templates { #[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::EntityQueryTemplate = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8915,8 +8915,8 @@ pub mod entity_query_templates { } } 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`."] @@ -14975,7 +14975,7 @@ pub mod security_ml_analytics_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_resource_name: impl Into, - security_ml_analytics_setting: impl Into, + security_ml_analytics_setting: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -15138,9 +15138,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15220,8 +15220,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -15241,9 +15241,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15288,7 +15288,7 @@ pub mod security_ml_analytics_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_resource_name: String, - pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSetting, + pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15325,8 +15325,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -15487,7 +15487,7 @@ pub mod product_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_name: impl Into, - settings: impl Into, + settings: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -15632,9 +15632,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15714,8 +15714,8 @@ pub mod product_settings { } } 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`."] @@ -15735,9 +15735,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15782,7 +15782,7 @@ pub mod product_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_name: String, - pub(crate) settings: models::Settings, + pub(crate) settings: models::SettingsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15819,8 +15819,8 @@ pub mod product_settings { } } 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`."] @@ -16765,9 +16765,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16848,8 +16848,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16869,9 +16869,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16951,8 +16951,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16972,9 +16972,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17056,8 +17056,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -17373,9 +17373,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17457,8 +17457,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -22068,7 +22068,7 @@ pub mod data_connectors { resource_group_name: impl Into, workspace_name: impl Into, data_connector_id: impl Into, - data_connector: impl Into, + data_connector: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -22278,9 +22278,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22360,8 +22360,8 @@ pub mod data_connectors { } } 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`."] @@ -22381,9 +22381,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22428,7 +22428,7 @@ pub mod data_connectors { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) data_connector_id: String, - pub(crate) data_connector: models::DataConnector, + pub(crate) data_connector: models::DataConnectorUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22465,8 +22465,8 @@ pub mod data_connectors { } } 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`."] @@ -22759,7 +22759,7 @@ pub mod data_connectors_check_requirements { subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - data_connectors_check_requirements: impl Into, + data_connectors_check_requirements: impl Into, ) -> post::RequestBuilder { post::RequestBuilder { client: self.0.clone(), @@ -22825,7 +22825,7 @@ pub mod data_connectors_check_requirements { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirements, + pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirementsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/securityinsights/src/package_preview_2023_05/models.rs b/services/mgmt/securityinsights/src/package_preview_2023_05/models.rs index a345d70606..ffc8a40051 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_05/models.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_05/models.rs @@ -703,6 +703,18 @@ impl AlertRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleUnion { + Fusion(FusionAlertRule), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRule), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRule), + #[serde(rename = "NRT")] + Nrt(NrtAlertRule), + Scheduled(ScheduledAlertRule), + ThreatIntelligence(ThreatIntelligenceAlertRule), +} #[doc = "The kind of the alert rule"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AlertRuleKindEnum")] @@ -768,6 +780,18 @@ impl AlertRuleTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleTemplateUnion { + Fusion(FusionAlertRuleTemplate), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRuleTemplate), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRuleTemplate), + #[serde(rename = "NRT")] + Nrt(NrtAlertRuleTemplate), + Scheduled(ScheduledAlertRuleTemplate), + ThreatIntelligence(ThreatIntelligenceAlertRuleTemplate), +} #[doc = "alert rule template data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AlertRuleTemplateDataSource { @@ -894,7 +918,7 @@ pub struct AlertRuleTemplatesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rule templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRuleTemplatesList { type Continuation = String; @@ -903,7 +927,7 @@ impl azure_core::Continuable for AlertRuleTemplatesList { } } impl AlertRuleTemplatesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -922,7 +946,7 @@ pub struct AlertRulesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rules."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRulesList { type Continuation = String; @@ -931,7 +955,7 @@ impl azure_core::Continuable for AlertRulesList { } } impl AlertRulesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -1359,6 +1383,13 @@ impl AutomationRuleAction { Self { order, action_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum AutomationRuleActionUnion { + AddIncidentTask(AutomationRuleAddIncidentTaskAction), + ModifyProperties(AutomationRuleModifyPropertiesAction), + RunPlaybook(AutomationRuleRunPlaybookAction), +} #[doc = "Describes an automation rule action to add a task to an incident"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleAddIncidentTaskAction { @@ -1385,7 +1416,7 @@ pub struct AutomationRuleBooleanCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inner_conditions: Vec, + pub inner_conditions: Vec, } impl AutomationRuleBooleanCondition { pub fn new() -> Self { @@ -1439,6 +1470,15 @@ impl AutomationRuleCondition { Self { condition_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "conditionType")] +pub enum AutomationRuleConditionUnion { + Boolean(BooleanConditionProperties), + PropertyArrayChanged(PropertyArrayChangedConditionProperties), + PropertyArray(PropertyArrayConditionProperties), + PropertyChanged(PropertyChangedConditionProperties), + Property(PropertyConditionProperties), +} #[doc = "Describes an automation rule action to modify an object's properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleModifyPropertiesAction { @@ -1467,7 +1507,7 @@ pub struct AutomationRuleProperties { #[serde(rename = "triggeringLogic")] pub triggering_logic: AutomationRuleTriggeringLogic, #[doc = "The actions to execute when the automation rule is triggered."] - pub actions: Vec, + pub actions: Vec, #[doc = "The last time the automation rule was updated."] #[serde(rename = "lastModifiedTimeUtc", default, with = "azure_core::date::rfc3339::option")] pub last_modified_time_utc: Option, @@ -1486,7 +1526,7 @@ impl AutomationRuleProperties { display_name: String, order: i32, triggering_logic: AutomationRuleTriggeringLogic, - actions: Vec, + actions: Vec, ) -> Self { Self { display_name, @@ -1684,7 +1724,7 @@ pub struct AutomationRulePropertyArrayValuesCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub item_conditions: Vec, + pub item_conditions: Vec, } impl AutomationRulePropertyArrayValuesCondition { pub fn new() -> Self { @@ -2178,7 +2218,7 @@ pub struct AutomationRuleTriggeringLogic { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, } impl AutomationRuleTriggeringLogic { pub fn new(is_enabled: bool, triggers_on: TriggersOn, triggers_when: TriggersWhen) -> Self { @@ -2405,6 +2445,11 @@ impl BillingStatistic { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum BillingStatisticUnion { + SapSolutionUsage(SapSolutionUsageStatistic), +} #[doc = "The kind of the billing statistic"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BillingStatisticKindEnum")] @@ -2447,7 +2492,7 @@ pub struct BillingStatisticList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of billing statistics."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for BillingStatisticList { type Continuation = String; @@ -2456,7 +2501,7 @@ impl azure_core::Continuable for BillingStatisticList { } } impl BillingStatisticList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -2538,7 +2583,7 @@ pub mod bookmark_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of expansion result connected entities"] #[serde( default, @@ -3365,6 +3410,11 @@ impl CustomEntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum CustomEntityQueryUnion { + Activity(ActivityCustomEntityQuery), +} #[doc = "The kind of the entity query that supports put request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "CustomEntityQueryKind")] @@ -3464,6 +3514,39 @@ impl DataConnector { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorUnion { + AzureActiveDirectory(AadDataConnector), + AzureAdvancedThreatProtection(AatpDataConnector), + AzureSecurityCenter(AscDataConnector), + AmazonWebServicesCloudTrail(AwsCloudTrailDataConnector), + AmazonWebServicesS3(AwsS3DataConnector), + #[serde(rename = "APIPolling")] + ApiPolling(CodelessApiPollingDataConnector), + #[serde(rename = "GenericUI")] + GenericUi(CodelessUiDataConnector), + Dynamics365(Dynamics365DataConnector), + #[serde(rename = "GCP")] + Gcp(GcpDataConnector), + #[serde(rename = "IOT")] + Iot(IoTDataConnector), + MicrosoftCloudAppSecurity(McasDataConnector), + MicrosoftDefenderAdvancedThreatProtection(MdatpDataConnector), + MicrosoftThreatIntelligence(MstiDataConnector), + MicrosoftThreatProtection(MtpDataConnector), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionDataConnector), + Office365Project(Office365ProjectDataConnector), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpDataConnector), + Office365(OfficeDataConnector), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmDataConnector), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiDataConnector), + ThreatIntelligence(TiDataConnector), + ThreatIntelligenceTaxii(TiTaxiiDataConnector), +} #[doc = "Describes the state of user's authorization for a connector kind."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DataConnectorAuthorizationState")] @@ -3782,7 +3865,7 @@ pub struct DataConnectorList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of data connectors."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataConnectorList { type Continuation = String; @@ -3791,7 +3874,7 @@ impl azure_core::Continuable for DataConnectorList { } } impl DataConnectorList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -3845,6 +3928,32 @@ impl DataConnectorsCheckRequirements { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorsCheckRequirementsUnion { + AzureActiveDirectory(AadCheckRequirements), + AzureAdvancedThreatProtection(AatpCheckRequirements), + AzureSecurityCenter(AscCheckRequirements), + AmazonWebServicesCloudTrail(AwsCloudTrailCheckRequirements), + AmazonWebServicesS3(AwsS3CheckRequirements), + Dynamics365(Dynamics365CheckRequirements), + #[serde(rename = "IOT")] + Iot(IoTCheckRequirements), + MicrosoftCloudAppSecurity(McasCheckRequirements), + MicrosoftDefenderAdvancedThreatProtection(MdatpCheckRequirements), + MicrosoftThreatIntelligence(MstiCheckRequirements), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionCheckRequirements), + MicrosoftThreatProtection(MtpCheckRequirements), + Office365Project(Office365ProjectCheckRequirements), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpCheckRequirements), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmCheckRequirements), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiCheckRequirements), + ThreatIntelligence(TiCheckRequirements), + ThreatIntelligenceTaxii(TiTaxiiCheckRequirements), +} #[doc = "The data type definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTypeDefinitions { @@ -4319,6 +4428,12 @@ impl Entity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityUnion { + Bookmark(HuntingBookmark), + SecurityAlert(SecurityAlert), +} #[doc = "Settings with single toggle."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityAnalytics { @@ -4427,7 +4542,7 @@ pub mod entity_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of edges that connects the entity to the list of entities."] #[serde( default, @@ -4715,7 +4830,7 @@ pub struct EntityList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entities."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityList { type Continuation = String; @@ -4724,7 +4839,7 @@ impl azure_core::Continuable for EntityList { } } impl EntityList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4897,6 +5012,12 @@ impl EntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryUnion { + Activity(ActivityEntityQuery), + Expansion(ExpansionEntityQuery), +} #[doc = "An abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityQueryItem { @@ -4922,6 +5043,11 @@ impl EntityQueryItem { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryItemUnion { + Insight(InsightQueryItem), +} #[doc = "An properties abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EntityQueryItemProperties { @@ -4999,7 +5125,7 @@ pub struct EntityQueryList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity queries."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryList { type Continuation = String; @@ -5008,7 +5134,7 @@ impl azure_core::Continuable for EntityQueryList { } } impl EntityQueryList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5028,6 +5154,11 @@ impl EntityQueryTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryTemplateUnion { + Activity(ActivityEntityQueryTemplate), +} #[doc = "The kind of the entity query template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityQueryTemplateKind")] @@ -5070,7 +5201,7 @@ pub struct EntityQueryTemplateList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity query templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryTemplateList { type Continuation = String; @@ -5079,7 +5210,7 @@ impl azure_core::Continuable for EntityQueryTemplateList { } } impl EntityQueryTemplateList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5094,6 +5225,14 @@ impl EntityTimelineItem { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityTimelineItemUnion { + Activity(ActivityTimelineItem), + Anomaly(AnomalyTimelineItem), + Bookmark(BookmarkTimelineItem), + SecurityAlert(SecurityAlertTimelineItem), +} #[doc = "The entity query kind"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityTimelineKind")] @@ -5177,7 +5316,7 @@ pub struct EntityTimelineResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EntityTimelineResponse { pub fn new() -> Self { @@ -6284,7 +6423,7 @@ pub struct GetQueriesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl GetQueriesResponse { pub fn new() -> Self { @@ -7097,7 +7236,7 @@ pub struct IncidentEntitiesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "The metadata from the incident related entities results."] #[serde( rename = "metaData", @@ -10932,6 +11071,11 @@ impl SecurityMlAnalyticsSetting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecurityMlAnalyticsSettingUnion { + Anomaly(AnomalySecurityMlAnalyticsSettings), +} #[doc = "security ml analytics settings data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityMlAnalyticsSettingsDataSource { @@ -10994,7 +11138,7 @@ pub struct SecurityMlAnalyticsSettingsList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of SecurityMLAnalyticsSettings"] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { type Continuation = String; @@ -11003,7 +11147,7 @@ impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { } } impl SecurityMlAnalyticsSettingsList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -11061,10 +11205,10 @@ impl SentinelOnboardingStatesList { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SettingList { #[doc = "Array of settings."] - pub value: Vec, + pub value: Vec, } impl SettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value } } } @@ -11128,6 +11272,14 @@ pub mod settings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SettingsUnion { + Anomalies(Anomalies), + EntityAnalytics(EntityAnalytics), + EyesOn(EyesOn), + Ueba(Ueba), +} #[doc = "Represents a SourceControl in Azure Security Insights."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceControl { @@ -11756,6 +11908,12 @@ impl ThreatIntelligenceInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ThreatIntelligenceInformationUnion { + #[serde(rename = "indicator")] + Indicator(ThreatIntelligenceIndicatorModel), +} #[doc = "List of all the threat intelligence information objects."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ThreatIntelligenceInformationList { @@ -11763,7 +11921,7 @@ pub struct ThreatIntelligenceInformationList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of threat intelligence information objects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for ThreatIntelligenceInformationList { type Continuation = String; @@ -11772,7 +11930,7 @@ impl azure_core::Continuable for ThreatIntelligenceInformationList { } } impl ThreatIntelligenceInformationList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/securityinsights/src/package_preview_2023_06/mod.rs b/services/mgmt/securityinsights/src/package_preview_2023_06/mod.rs index d9af3d0f3a..666311a7a5 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_06/mod.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_06/mod.rs @@ -341,7 +341,7 @@ pub mod alert_rules { resource_group_name: impl Into, workspace_name: impl Into, rule_id: impl Into, - alert_rule: impl Into, + alert_rule: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -504,9 +504,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -586,8 +586,8 @@ pub mod alert_rules { } } 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`."] @@ -607,9 +607,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -654,7 +654,7 @@ pub mod alert_rules { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) rule_id: String, - pub(crate) alert_rule: models::AlertRule, + pub(crate) alert_rule: models::AlertRuleUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -691,8 +691,8 @@ pub mod alert_rules { } } 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`."] @@ -1497,9 +1497,9 @@ pub mod alert_rule_templates { #[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::AlertRuleTemplate = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1579,8 +1579,8 @@ pub mod alert_rule_templates { } } 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`."] @@ -2502,9 +2502,9 @@ pub mod entities { #[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::Entity = serde_json::from_slice(&bytes)?; + let body: models::EntityUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2584,8 +2584,8 @@ pub mod entities { } } 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`."] @@ -4287,9 +4287,9 @@ pub mod billing_statistics { #[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::BillingStatistic = serde_json::from_slice(&bytes)?; + let body: models::BillingStatisticUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4369,8 +4369,8 @@ pub mod billing_statistics { } } 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`."] @@ -8186,7 +8186,7 @@ pub mod entity_queries { resource_group_name: impl Into, workspace_name: impl Into, entity_query_id: impl Into, - entity_query: impl Into, + entity_query: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -8358,9 +8358,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8440,8 +8440,8 @@ pub mod entity_queries { } } 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`."] @@ -8461,9 +8461,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8508,7 +8508,7 @@ pub mod entity_queries { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) entity_query_id: String, - pub(crate) entity_query: models::CustomEntityQuery, + pub(crate) entity_query: models::CustomEntityQueryUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8545,8 +8545,8 @@ pub mod entity_queries { } } 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`."] @@ -8833,9 +8833,9 @@ pub mod entity_query_templates { #[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::EntityQueryTemplate = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8915,8 +8915,8 @@ pub mod entity_query_templates { } } 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`."] @@ -14975,7 +14975,7 @@ pub mod security_ml_analytics_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_resource_name: impl Into, - security_ml_analytics_setting: impl Into, + security_ml_analytics_setting: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -15138,9 +15138,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15220,8 +15220,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -15241,9 +15241,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15288,7 +15288,7 @@ pub mod security_ml_analytics_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_resource_name: String, - pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSetting, + pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15325,8 +15325,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -15487,7 +15487,7 @@ pub mod product_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_name: impl Into, - settings: impl Into, + settings: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -15632,9 +15632,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15714,8 +15714,8 @@ pub mod product_settings { } } 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`."] @@ -15735,9 +15735,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15782,7 +15782,7 @@ pub mod product_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_name: String, - pub(crate) settings: models::Settings, + pub(crate) settings: models::SettingsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15819,8 +15819,8 @@ pub mod product_settings { } } 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`."] @@ -16787,9 +16787,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16870,8 +16870,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16891,9 +16891,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16973,8 +16973,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16994,9 +16994,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17078,8 +17078,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -17395,9 +17395,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17479,8 +17479,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -22090,7 +22090,7 @@ pub mod data_connectors { resource_group_name: impl Into, workspace_name: impl Into, data_connector_id: impl Into, - data_connector: impl Into, + data_connector: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -22300,9 +22300,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22382,8 +22382,8 @@ pub mod data_connectors { } } 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`."] @@ -22403,9 +22403,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22450,7 +22450,7 @@ pub mod data_connectors { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) data_connector_id: String, - pub(crate) data_connector: models::DataConnector, + pub(crate) data_connector: models::DataConnectorUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22487,8 +22487,8 @@ pub mod data_connectors { } } 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`."] @@ -22781,7 +22781,7 @@ pub mod data_connectors_check_requirements { subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - data_connectors_check_requirements: impl Into, + data_connectors_check_requirements: impl Into, ) -> post::RequestBuilder { post::RequestBuilder { client: self.0.clone(), @@ -22847,7 +22847,7 @@ pub mod data_connectors_check_requirements { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirements, + pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirementsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/securityinsights/src/package_preview_2023_06/models.rs b/services/mgmt/securityinsights/src/package_preview_2023_06/models.rs index 3016596907..290f18bb88 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_06/models.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_06/models.rs @@ -703,6 +703,18 @@ impl AlertRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleUnion { + Fusion(FusionAlertRule), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRule), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRule), + #[serde(rename = "NRT")] + Nrt(NrtAlertRule), + Scheduled(ScheduledAlertRule), + ThreatIntelligence(ThreatIntelligenceAlertRule), +} #[doc = "The kind of the alert rule"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AlertRuleKindEnum")] @@ -768,6 +780,18 @@ impl AlertRuleTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleTemplateUnion { + Fusion(FusionAlertRuleTemplate), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRuleTemplate), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRuleTemplate), + #[serde(rename = "NRT")] + Nrt(NrtAlertRuleTemplate), + Scheduled(ScheduledAlertRuleTemplate), + ThreatIntelligence(ThreatIntelligenceAlertRuleTemplate), +} #[doc = "alert rule template data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AlertRuleTemplateDataSource { @@ -894,7 +918,7 @@ pub struct AlertRuleTemplatesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rule templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRuleTemplatesList { type Continuation = String; @@ -903,7 +927,7 @@ impl azure_core::Continuable for AlertRuleTemplatesList { } } impl AlertRuleTemplatesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -922,7 +946,7 @@ pub struct AlertRulesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rules."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRulesList { type Continuation = String; @@ -931,7 +955,7 @@ impl azure_core::Continuable for AlertRulesList { } } impl AlertRulesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -1359,6 +1383,13 @@ impl AutomationRuleAction { Self { order, action_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum AutomationRuleActionUnion { + AddIncidentTask(AutomationRuleAddIncidentTaskAction), + ModifyProperties(AutomationRuleModifyPropertiesAction), + RunPlaybook(AutomationRuleRunPlaybookAction), +} #[doc = "Describes an automation rule action to add a task to an incident"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleAddIncidentTaskAction { @@ -1385,7 +1416,7 @@ pub struct AutomationRuleBooleanCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inner_conditions: Vec, + pub inner_conditions: Vec, } impl AutomationRuleBooleanCondition { pub fn new() -> Self { @@ -1439,6 +1470,15 @@ impl AutomationRuleCondition { Self { condition_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "conditionType")] +pub enum AutomationRuleConditionUnion { + Boolean(BooleanConditionProperties), + PropertyArrayChanged(PropertyArrayChangedConditionProperties), + PropertyArray(PropertyArrayConditionProperties), + PropertyChanged(PropertyChangedConditionProperties), + Property(PropertyConditionProperties), +} #[doc = "Describes an automation rule action to modify an object's properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleModifyPropertiesAction { @@ -1467,7 +1507,7 @@ pub struct AutomationRuleProperties { #[serde(rename = "triggeringLogic")] pub triggering_logic: AutomationRuleTriggeringLogic, #[doc = "The actions to execute when the automation rule is triggered."] - pub actions: Vec, + pub actions: Vec, #[doc = "The last time the automation rule was updated."] #[serde(rename = "lastModifiedTimeUtc", default, with = "azure_core::date::rfc3339::option")] pub last_modified_time_utc: Option, @@ -1486,7 +1526,7 @@ impl AutomationRuleProperties { display_name: String, order: i32, triggering_logic: AutomationRuleTriggeringLogic, - actions: Vec, + actions: Vec, ) -> Self { Self { display_name, @@ -1684,7 +1724,7 @@ pub struct AutomationRulePropertyArrayValuesCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub item_conditions: Vec, + pub item_conditions: Vec, } impl AutomationRulePropertyArrayValuesCondition { pub fn new() -> Self { @@ -2178,7 +2218,7 @@ pub struct AutomationRuleTriggeringLogic { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, } impl AutomationRuleTriggeringLogic { pub fn new(is_enabled: bool, triggers_on: TriggersOn, triggers_when: TriggersWhen) -> Self { @@ -2405,6 +2445,11 @@ impl BillingStatistic { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum BillingStatisticUnion { + SapSolutionUsage(SapSolutionUsageStatistic), +} #[doc = "The kind of the billing statistic"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BillingStatisticKindEnum")] @@ -2447,7 +2492,7 @@ pub struct BillingStatisticList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of billing statistics."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for BillingStatisticList { type Continuation = String; @@ -2456,7 +2501,7 @@ impl azure_core::Continuable for BillingStatisticList { } } impl BillingStatisticList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -2538,7 +2583,7 @@ pub mod bookmark_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of expansion result connected entities"] #[serde( default, @@ -3358,6 +3403,11 @@ impl CustomEntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum CustomEntityQueryUnion { + Activity(ActivityCustomEntityQuery), +} #[doc = "The kind of the entity query that supports put request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "CustomEntityQueryKind")] @@ -3457,6 +3507,39 @@ impl DataConnector { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorUnion { + AzureActiveDirectory(AadDataConnector), + AzureAdvancedThreatProtection(AatpDataConnector), + AzureSecurityCenter(AscDataConnector), + AmazonWebServicesCloudTrail(AwsCloudTrailDataConnector), + AmazonWebServicesS3(AwsS3DataConnector), + #[serde(rename = "APIPolling")] + ApiPolling(CodelessApiPollingDataConnector), + #[serde(rename = "GenericUI")] + GenericUi(CodelessUiDataConnector), + Dynamics365(Dynamics365DataConnector), + #[serde(rename = "GCP")] + Gcp(GcpDataConnector), + #[serde(rename = "IOT")] + Iot(IoTDataConnector), + MicrosoftCloudAppSecurity(McasDataConnector), + MicrosoftDefenderAdvancedThreatProtection(MdatpDataConnector), + MicrosoftThreatIntelligence(MstiDataConnector), + MicrosoftThreatProtection(MtpDataConnector), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionDataConnector), + Office365Project(Office365ProjectDataConnector), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpDataConnector), + Office365(OfficeDataConnector), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmDataConnector), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiDataConnector), + ThreatIntelligence(TiDataConnector), + ThreatIntelligenceTaxii(TiTaxiiDataConnector), +} #[doc = "Describes the state of user's authorization for a connector kind."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DataConnectorAuthorizationState")] @@ -3775,7 +3858,7 @@ pub struct DataConnectorList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of data connectors."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataConnectorList { type Continuation = String; @@ -3784,7 +3867,7 @@ impl azure_core::Continuable for DataConnectorList { } } impl DataConnectorList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -3838,6 +3921,32 @@ impl DataConnectorsCheckRequirements { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorsCheckRequirementsUnion { + AzureActiveDirectory(AadCheckRequirements), + AzureAdvancedThreatProtection(AatpCheckRequirements), + AzureSecurityCenter(AscCheckRequirements), + AmazonWebServicesCloudTrail(AwsCloudTrailCheckRequirements), + AmazonWebServicesS3(AwsS3CheckRequirements), + Dynamics365(Dynamics365CheckRequirements), + #[serde(rename = "IOT")] + Iot(IoTCheckRequirements), + MicrosoftCloudAppSecurity(McasCheckRequirements), + MicrosoftDefenderAdvancedThreatProtection(MdatpCheckRequirements), + MicrosoftThreatIntelligence(MstiCheckRequirements), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionCheckRequirements), + MicrosoftThreatProtection(MtpCheckRequirements), + Office365Project(Office365ProjectCheckRequirements), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpCheckRequirements), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmCheckRequirements), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiCheckRequirements), + ThreatIntelligence(TiCheckRequirements), + ThreatIntelligenceTaxii(TiTaxiiCheckRequirements), +} #[doc = "The data type definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTypeDefinitions { @@ -4312,6 +4421,12 @@ impl Entity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityUnion { + Bookmark(HuntingBookmark), + SecurityAlert(SecurityAlert), +} #[doc = "Settings with single toggle."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityAnalytics { @@ -4420,7 +4535,7 @@ pub mod entity_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of edges that connects the entity to the list of entities."] #[serde( default, @@ -4708,7 +4823,7 @@ pub struct EntityList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entities."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityList { type Continuation = String; @@ -4717,7 +4832,7 @@ impl azure_core::Continuable for EntityList { } } impl EntityList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4890,6 +5005,12 @@ impl EntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryUnion { + Activity(ActivityEntityQuery), + Expansion(ExpansionEntityQuery), +} #[doc = "An abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityQueryItem { @@ -4915,6 +5036,11 @@ impl EntityQueryItem { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryItemUnion { + Insight(InsightQueryItem), +} #[doc = "An properties abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EntityQueryItemProperties { @@ -4992,7 +5118,7 @@ pub struct EntityQueryList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity queries."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryList { type Continuation = String; @@ -5001,7 +5127,7 @@ impl azure_core::Continuable for EntityQueryList { } } impl EntityQueryList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5021,6 +5147,11 @@ impl EntityQueryTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryTemplateUnion { + Activity(ActivityEntityQueryTemplate), +} #[doc = "The kind of the entity query template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityQueryTemplateKind")] @@ -5063,7 +5194,7 @@ pub struct EntityQueryTemplateList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity query templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryTemplateList { type Continuation = String; @@ -5072,7 +5203,7 @@ impl azure_core::Continuable for EntityQueryTemplateList { } } impl EntityQueryTemplateList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5087,6 +5218,14 @@ impl EntityTimelineItem { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityTimelineItemUnion { + Activity(ActivityTimelineItem), + Anomaly(AnomalyTimelineItem), + Bookmark(BookmarkTimelineItem), + SecurityAlert(SecurityAlertTimelineItem), +} #[doc = "The entity query kind"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityTimelineKind")] @@ -5170,7 +5309,7 @@ pub struct EntityTimelineResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EntityTimelineResponse { pub fn new() -> Self { @@ -6277,7 +6416,7 @@ pub struct GetQueriesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl GetQueriesResponse { pub fn new() -> Self { @@ -7090,7 +7229,7 @@ pub struct IncidentEntitiesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "The metadata from the incident related entities results."] #[serde( rename = "metaData", @@ -11045,6 +11184,11 @@ impl SecurityMlAnalyticsSetting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecurityMlAnalyticsSettingUnion { + Anomaly(AnomalySecurityMlAnalyticsSettings), +} #[doc = "security ml analytics settings data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityMlAnalyticsSettingsDataSource { @@ -11107,7 +11251,7 @@ pub struct SecurityMlAnalyticsSettingsList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of SecurityMLAnalyticsSettings"] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { type Continuation = String; @@ -11116,7 +11260,7 @@ impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { } } impl SecurityMlAnalyticsSettingsList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -11192,10 +11336,10 @@ impl ServicePrincipal { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SettingList { #[doc = "Array of settings."] - pub value: Vec, + pub value: Vec, } impl SettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value } } } @@ -11259,6 +11403,14 @@ pub mod settings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SettingsUnion { + Anomalies(Anomalies), + EntityAnalytics(EntityAnalytics), + EyesOn(EyesOn), + Ueba(Ueba), +} #[doc = "Represents a SourceControl in Azure Security Insights."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceControl { @@ -11899,6 +12051,12 @@ impl ThreatIntelligenceInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ThreatIntelligenceInformationUnion { + #[serde(rename = "indicator")] + Indicator(ThreatIntelligenceIndicatorModel), +} #[doc = "List of all the threat intelligence information objects."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ThreatIntelligenceInformationList { @@ -11906,7 +12064,7 @@ pub struct ThreatIntelligenceInformationList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of threat intelligence information objects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for ThreatIntelligenceInformationList { type Continuation = String; @@ -11915,7 +12073,7 @@ impl azure_core::Continuable for ThreatIntelligenceInformationList { } } impl ThreatIntelligenceInformationList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/securityinsights/src/package_preview_2023_07/mod.rs b/services/mgmt/securityinsights/src/package_preview_2023_07/mod.rs index 9ea621de37..d0bb2ff1bd 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_07/mod.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_07/mod.rs @@ -344,7 +344,7 @@ pub mod alert_rules { resource_group_name: impl Into, workspace_name: impl Into, rule_id: impl Into, - alert_rule: impl Into, + alert_rule: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -507,9 +507,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -589,8 +589,8 @@ pub mod alert_rules { } } 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`."] @@ -610,9 +610,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -657,7 +657,7 @@ pub mod alert_rules { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) rule_id: String, - pub(crate) alert_rule: models::AlertRule, + pub(crate) alert_rule: models::AlertRuleUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -694,8 +694,8 @@ pub mod alert_rules { } } 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`."] @@ -1500,9 +1500,9 @@ pub mod alert_rule_templates { #[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::AlertRuleTemplate = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1582,8 +1582,8 @@ pub mod alert_rule_templates { } } 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`."] @@ -2505,9 +2505,9 @@ pub mod entities { #[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::Entity = serde_json::from_slice(&bytes)?; + let body: models::EntityUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2587,8 +2587,8 @@ pub mod entities { } } 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`."] @@ -4290,9 +4290,9 @@ pub mod billing_statistics { #[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::BillingStatistic = serde_json::from_slice(&bytes)?; + let body: models::BillingStatisticUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4372,8 +4372,8 @@ pub mod billing_statistics { } } 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`."] @@ -8189,7 +8189,7 @@ pub mod entity_queries { resource_group_name: impl Into, workspace_name: impl Into, entity_query_id: impl Into, - entity_query: impl Into, + entity_query: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -8361,9 +8361,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8443,8 +8443,8 @@ pub mod entity_queries { } } 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`."] @@ -8464,9 +8464,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8511,7 +8511,7 @@ pub mod entity_queries { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) entity_query_id: String, - pub(crate) entity_query: models::CustomEntityQuery, + pub(crate) entity_query: models::CustomEntityQueryUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8548,8 +8548,8 @@ pub mod entity_queries { } } 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`."] @@ -8836,9 +8836,9 @@ pub mod entity_query_templates { #[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::EntityQueryTemplate = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8918,8 +8918,8 @@ pub mod entity_query_templates { } } 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,7 +14978,7 @@ pub mod security_ml_analytics_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_resource_name: impl Into, - security_ml_analytics_setting: impl Into, + security_ml_analytics_setting: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -15141,9 +15141,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15223,8 +15223,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -15244,9 +15244,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15291,7 +15291,7 @@ pub mod security_ml_analytics_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_resource_name: String, - pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSetting, + pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15328,8 +15328,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -15490,7 +15490,7 @@ pub mod product_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_name: impl Into, - settings: impl Into, + settings: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -15635,9 +15635,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15717,8 +15717,8 @@ pub mod product_settings { } } 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`."] @@ -15738,9 +15738,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15785,7 +15785,7 @@ pub mod product_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_name: String, - pub(crate) settings: models::Settings, + pub(crate) settings: models::SettingsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15822,8 +15822,8 @@ pub mod product_settings { } } 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`."] @@ -16790,9 +16790,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16873,8 +16873,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16894,9 +16894,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16976,8 +16976,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16997,9 +16997,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17081,8 +17081,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -17398,9 +17398,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17482,8 +17482,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -22093,7 +22093,7 @@ pub mod data_connectors { resource_group_name: impl Into, workspace_name: impl Into, data_connector_id: impl Into, - data_connector: impl Into, + data_connector: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -22303,9 +22303,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22385,8 +22385,8 @@ pub mod data_connectors { } } 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`."] @@ -22406,9 +22406,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22453,7 +22453,7 @@ pub mod data_connectors { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) data_connector_id: String, - pub(crate) data_connector: models::DataConnector, + pub(crate) data_connector: models::DataConnectorUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22490,8 +22490,8 @@ pub mod data_connectors { } } 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`."] @@ -22784,7 +22784,7 @@ pub mod data_connectors_check_requirements { subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - data_connectors_check_requirements: impl Into, + data_connectors_check_requirements: impl Into, ) -> post::RequestBuilder { post::RequestBuilder { client: self.0.clone(), @@ -22850,7 +22850,7 @@ pub mod data_connectors_check_requirements { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirements, + pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirementsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22963,7 +22963,7 @@ pub mod data_connector_definitions { resource_group_name: impl Into, workspace_name: impl Into, data_connector_definition_name: impl Into, - connector_definition_input: impl Into, + connector_definition_input: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -23128,9 +23128,9 @@ pub mod data_connector_definitions { #[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::DataConnectorDefinition = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorDefinitionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23210,8 +23210,8 @@ pub mod data_connector_definitions { } } 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`."] @@ -23231,9 +23231,9 @@ pub mod data_connector_definitions { #[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::DataConnectorDefinition = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorDefinitionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23278,7 +23278,7 @@ pub mod data_connector_definitions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) data_connector_definition_name: String, - pub(crate) connector_definition_input: models::DataConnectorDefinition, + pub(crate) connector_definition_input: models::DataConnectorDefinitionUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -23315,8 +23315,8 @@ pub mod data_connector_definitions { } } 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`."] diff --git a/services/mgmt/securityinsights/src/package_preview_2023_07/models.rs b/services/mgmt/securityinsights/src/package_preview_2023_07/models.rs index 907f18f2ff..7f5701b0c4 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_07/models.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_07/models.rs @@ -703,6 +703,18 @@ impl AlertRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleUnion { + Fusion(FusionAlertRule), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRule), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRule), + #[serde(rename = "NRT")] + Nrt(NrtAlertRule), + Scheduled(ScheduledAlertRule), + ThreatIntelligence(ThreatIntelligenceAlertRule), +} #[doc = "The kind of the alert rule"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AlertRuleKindEnum")] @@ -768,6 +780,18 @@ impl AlertRuleTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleTemplateUnion { + Fusion(FusionAlertRuleTemplate), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRuleTemplate), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRuleTemplate), + #[serde(rename = "NRT")] + Nrt(NrtAlertRuleTemplate), + Scheduled(ScheduledAlertRuleTemplate), + ThreatIntelligence(ThreatIntelligenceAlertRuleTemplate), +} #[doc = "alert rule template data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AlertRuleTemplateDataSource { @@ -894,7 +918,7 @@ pub struct AlertRuleTemplatesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rule templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRuleTemplatesList { type Continuation = String; @@ -903,7 +927,7 @@ impl azure_core::Continuable for AlertRuleTemplatesList { } } impl AlertRuleTemplatesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -922,7 +946,7 @@ pub struct AlertRulesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rules."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRulesList { type Continuation = String; @@ -931,7 +955,7 @@ impl azure_core::Continuable for AlertRulesList { } } impl AlertRulesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -1359,6 +1383,13 @@ impl AutomationRuleAction { Self { order, action_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum AutomationRuleActionUnion { + AddIncidentTask(AutomationRuleAddIncidentTaskAction), + ModifyProperties(AutomationRuleModifyPropertiesAction), + RunPlaybook(AutomationRuleRunPlaybookAction), +} #[doc = "Describes an automation rule action to add a task to an incident"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleAddIncidentTaskAction { @@ -1385,7 +1416,7 @@ pub struct AutomationRuleBooleanCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inner_conditions: Vec, + pub inner_conditions: Vec, } impl AutomationRuleBooleanCondition { pub fn new() -> Self { @@ -1439,6 +1470,15 @@ impl AutomationRuleCondition { Self { condition_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "conditionType")] +pub enum AutomationRuleConditionUnion { + Boolean(BooleanConditionProperties), + PropertyArrayChanged(PropertyArrayChangedConditionProperties), + PropertyArray(PropertyArrayConditionProperties), + PropertyChanged(PropertyChangedConditionProperties), + Property(PropertyConditionProperties), +} #[doc = "Describes an automation rule action to modify an object's properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleModifyPropertiesAction { @@ -1467,7 +1507,7 @@ pub struct AutomationRuleProperties { #[serde(rename = "triggeringLogic")] pub triggering_logic: AutomationRuleTriggeringLogic, #[doc = "The actions to execute when the automation rule is triggered."] - pub actions: Vec, + pub actions: Vec, #[doc = "The last time the automation rule was updated."] #[serde(rename = "lastModifiedTimeUtc", default, with = "azure_core::date::rfc3339::option")] pub last_modified_time_utc: Option, @@ -1486,7 +1526,7 @@ impl AutomationRuleProperties { display_name: String, order: i32, triggering_logic: AutomationRuleTriggeringLogic, - actions: Vec, + actions: Vec, ) -> Self { Self { display_name, @@ -1684,7 +1724,7 @@ pub struct AutomationRulePropertyArrayValuesCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub item_conditions: Vec, + pub item_conditions: Vec, } impl AutomationRulePropertyArrayValuesCondition { pub fn new() -> Self { @@ -2178,7 +2218,7 @@ pub struct AutomationRuleTriggeringLogic { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, } impl AutomationRuleTriggeringLogic { pub fn new(is_enabled: bool, triggers_on: TriggersOn, triggers_when: TriggersWhen) -> Self { @@ -2406,6 +2446,11 @@ impl BillingStatistic { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum BillingStatisticUnion { + SapSolutionUsage(SapSolutionUsageStatistic), +} #[doc = "The kind of the billing statistic"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BillingStatisticKindEnum")] @@ -2448,7 +2493,7 @@ pub struct BillingStatisticList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of billing statistics."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for BillingStatisticList { type Continuation = String; @@ -2457,7 +2502,7 @@ impl azure_core::Continuable for BillingStatisticList { } } impl BillingStatisticList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -2539,7 +2584,7 @@ pub mod bookmark_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of expansion result connected entities"] #[serde( default, @@ -3482,6 +3527,11 @@ impl CustomEntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum CustomEntityQueryUnion { + Activity(ActivityCustomEntityQuery), +} #[doc = "The kind of the entity query that supports put request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "CustomEntityQueryKind")] @@ -3728,6 +3778,39 @@ impl DataConnector { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorUnion { + AzureActiveDirectory(AadDataConnector), + AzureAdvancedThreatProtection(AatpDataConnector), + AzureSecurityCenter(AscDataConnector), + AmazonWebServicesCloudTrail(AwsCloudTrailDataConnector), + AmazonWebServicesS3(AwsS3DataConnector), + #[serde(rename = "APIPolling")] + ApiPolling(CodelessApiPollingDataConnector), + #[serde(rename = "GenericUI")] + GenericUi(CodelessUiDataConnector), + Dynamics365(Dynamics365DataConnector), + #[serde(rename = "GCP")] + Gcp(GcpDataConnector), + #[serde(rename = "IOT")] + Iot(IoTDataConnector), + MicrosoftCloudAppSecurity(McasDataConnector), + MicrosoftDefenderAdvancedThreatProtection(MdatpDataConnector), + MicrosoftThreatIntelligence(MstiDataConnector), + MicrosoftThreatProtection(MtpDataConnector), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionDataConnector), + Office365Project(Office365ProjectDataConnector), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpDataConnector), + Office365(OfficeDataConnector), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmDataConnector), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiDataConnector), + ThreatIntelligence(TiDataConnector), + ThreatIntelligenceTaxii(TiTaxiiDataConnector), +} #[doc = "Describes the state of user's authorization for a connector kind."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DataConnectorAuthorizationState")] @@ -3922,6 +4005,11 @@ impl DataConnectorDefinition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorDefinitionUnion { + Customizable(CustomizableConnectorDefinition), +} #[doc = "Encapsulate the data connector definition object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataConnectorDefinitionArmCollectionWrapper { @@ -3930,7 +4018,7 @@ pub struct DataConnectorDefinitionArmCollectionWrapper { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, } @@ -4120,7 +4208,7 @@ pub struct DataConnectorList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of data connectors."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataConnectorList { type Continuation = String; @@ -4129,7 +4217,7 @@ impl azure_core::Continuable for DataConnectorList { } } impl DataConnectorList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4183,6 +4271,32 @@ impl DataConnectorsCheckRequirements { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorsCheckRequirementsUnion { + AzureActiveDirectory(AadCheckRequirements), + AzureAdvancedThreatProtection(AatpCheckRequirements), + AzureSecurityCenter(AscCheckRequirements), + AmazonWebServicesCloudTrail(AwsCloudTrailCheckRequirements), + AmazonWebServicesS3(AwsS3CheckRequirements), + Dynamics365(Dynamics365CheckRequirements), + #[serde(rename = "IOT")] + Iot(IoTCheckRequirements), + MicrosoftCloudAppSecurity(McasCheckRequirements), + MicrosoftDefenderAdvancedThreatProtection(MdatpCheckRequirements), + MicrosoftThreatIntelligence(MstiCheckRequirements), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionCheckRequirements), + MicrosoftThreatProtection(MtpCheckRequirements), + Office365Project(Office365ProjectCheckRequirements), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpCheckRequirements), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmCheckRequirements), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiCheckRequirements), + ThreatIntelligence(TiCheckRequirements), + ThreatIntelligenceTaxii(TiTaxiiCheckRequirements), +} #[doc = "The data type definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTypeDefinitions { @@ -4657,6 +4771,12 @@ impl Entity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityUnion { + Bookmark(HuntingBookmark), + SecurityAlert(SecurityAlert), +} #[doc = "Settings with single toggle."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityAnalytics { @@ -4765,7 +4885,7 @@ pub mod entity_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of edges that connects the entity to the list of entities."] #[serde( default, @@ -5053,7 +5173,7 @@ pub struct EntityList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entities."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityList { type Continuation = String; @@ -5062,7 +5182,7 @@ impl azure_core::Continuable for EntityList { } } impl EntityList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5235,6 +5355,12 @@ impl EntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryUnion { + Activity(ActivityEntityQuery), + Expansion(ExpansionEntityQuery), +} #[doc = "An abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityQueryItem { @@ -5260,6 +5386,11 @@ impl EntityQueryItem { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryItemUnion { + Insight(InsightQueryItem), +} #[doc = "An properties abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EntityQueryItemProperties { @@ -5337,7 +5468,7 @@ pub struct EntityQueryList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity queries."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryList { type Continuation = String; @@ -5346,7 +5477,7 @@ impl azure_core::Continuable for EntityQueryList { } } impl EntityQueryList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5366,6 +5497,11 @@ impl EntityQueryTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryTemplateUnion { + Activity(ActivityEntityQueryTemplate), +} #[doc = "The kind of the entity query template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityQueryTemplateKind")] @@ -5408,7 +5544,7 @@ pub struct EntityQueryTemplateList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity query templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryTemplateList { type Continuation = String; @@ -5417,7 +5553,7 @@ impl azure_core::Continuable for EntityQueryTemplateList { } } impl EntityQueryTemplateList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5432,6 +5568,14 @@ impl EntityTimelineItem { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityTimelineItemUnion { + Activity(ActivityTimelineItem), + Anomaly(AnomalyTimelineItem), + Bookmark(BookmarkTimelineItem), + SecurityAlert(SecurityAlertTimelineItem), +} #[doc = "The entity query kind"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityTimelineKind")] @@ -5515,7 +5659,7 @@ pub struct EntityTimelineResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EntityTimelineResponse { pub fn new() -> Self { @@ -6622,7 +6766,7 @@ pub struct GetQueriesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl GetQueriesResponse { pub fn new() -> Self { @@ -7460,7 +7604,7 @@ pub struct IncidentEntitiesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "The metadata from the incident related entities results."] #[serde( rename = "metaData", @@ -11532,6 +11676,11 @@ impl SecurityMlAnalyticsSetting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecurityMlAnalyticsSettingUnion { + Anomaly(AnomalySecurityMlAnalyticsSettings), +} #[doc = "security ml analytics settings data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityMlAnalyticsSettingsDataSource { @@ -11594,7 +11743,7 @@ pub struct SecurityMlAnalyticsSettingsList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of SecurityMLAnalyticsSettings"] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { type Continuation = String; @@ -11603,7 +11752,7 @@ impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { } } impl SecurityMlAnalyticsSettingsList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -11679,10 +11828,10 @@ impl ServicePrincipal { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SettingList { #[doc = "Array of settings."] - pub value: Vec, + pub value: Vec, } impl SettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value } } } @@ -11746,6 +11895,14 @@ pub mod settings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SettingsUnion { + Anomalies(Anomalies), + EntityAnalytics(EntityAnalytics), + EyesOn(EyesOn), + Ueba(Ueba), +} #[doc = "Represents a SourceControl in Azure Security Insights."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceControl { @@ -12386,6 +12543,12 @@ impl ThreatIntelligenceInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ThreatIntelligenceInformationUnion { + #[serde(rename = "indicator")] + Indicator(ThreatIntelligenceIndicatorModel), +} #[doc = "List of all the threat intelligence information objects."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ThreatIntelligenceInformationList { @@ -12393,7 +12556,7 @@ pub struct ThreatIntelligenceInformationList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of threat intelligence information objects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for ThreatIntelligenceInformationList { type Continuation = String; @@ -12402,7 +12565,7 @@ impl azure_core::Continuable for ThreatIntelligenceInformationList { } } impl ThreatIntelligenceInformationList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/securityinsights/src/package_preview_2023_08/mod.rs b/services/mgmt/securityinsights/src/package_preview_2023_08/mod.rs index 9837338b9a..90171e524c 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_08/mod.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_08/mod.rs @@ -344,7 +344,7 @@ pub mod alert_rules { resource_group_name: impl Into, workspace_name: impl Into, rule_id: impl Into, - alert_rule: impl Into, + alert_rule: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -507,9 +507,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -589,8 +589,8 @@ pub mod alert_rules { } } 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`."] @@ -610,9 +610,9 @@ pub mod alert_rules { #[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::AlertRule = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -657,7 +657,7 @@ pub mod alert_rules { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) rule_id: String, - pub(crate) alert_rule: models::AlertRule, + pub(crate) alert_rule: models::AlertRuleUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -694,8 +694,8 @@ pub mod alert_rules { } } 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`."] @@ -1500,9 +1500,9 @@ pub mod alert_rule_templates { #[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::AlertRuleTemplate = serde_json::from_slice(&bytes)?; + let body: models::AlertRuleTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1582,8 +1582,8 @@ pub mod alert_rule_templates { } } 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`."] @@ -2505,9 +2505,9 @@ pub mod entities { #[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::Entity = serde_json::from_slice(&bytes)?; + let body: models::EntityUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2587,8 +2587,8 @@ pub mod entities { } } 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`."] @@ -4290,9 +4290,9 @@ pub mod billing_statistics { #[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::BillingStatistic = serde_json::from_slice(&bytes)?; + let body: models::BillingStatisticUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4372,8 +4372,8 @@ pub mod billing_statistics { } } 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`."] @@ -8189,7 +8189,7 @@ pub mod entity_queries { resource_group_name: impl Into, workspace_name: impl Into, entity_query_id: impl Into, - entity_query: impl Into, + entity_query: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -8361,9 +8361,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8443,8 +8443,8 @@ pub mod entity_queries { } } 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`."] @@ -8464,9 +8464,9 @@ pub mod entity_queries { #[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::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8511,7 +8511,7 @@ pub mod entity_queries { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) entity_query_id: String, - pub(crate) entity_query: models::CustomEntityQuery, + pub(crate) entity_query: models::CustomEntityQueryUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8548,8 +8548,8 @@ pub mod entity_queries { } } 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`."] @@ -8836,9 +8836,9 @@ pub mod entity_query_templates { #[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::EntityQueryTemplate = serde_json::from_slice(&bytes)?; + let body: models::EntityQueryTemplateUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8918,8 +8918,8 @@ pub mod entity_query_templates { } } 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,7 +14978,7 @@ pub mod security_ml_analytics_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_resource_name: impl Into, - security_ml_analytics_setting: impl Into, + security_ml_analytics_setting: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -15141,9 +15141,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15223,8 +15223,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -15244,9 +15244,9 @@ pub mod security_ml_analytics_settings { #[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::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15291,7 +15291,7 @@ pub mod security_ml_analytics_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_resource_name: String, - pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSetting, + pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSettingUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15328,8 +15328,8 @@ pub mod security_ml_analytics_settings { } } 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`."] @@ -15490,7 +15490,7 @@ pub mod product_settings { resource_group_name: impl Into, workspace_name: impl Into, settings_name: impl Into, - settings: impl Into, + settings: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -15635,9 +15635,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15717,8 +15717,8 @@ pub mod product_settings { } } 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`."] @@ -15738,9 +15738,9 @@ pub mod product_settings { #[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::Settings = serde_json::from_slice(&bytes)?; + let body: models::SettingsUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15785,7 +15785,7 @@ pub mod product_settings { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) settings_name: String, - pub(crate) settings: models::Settings, + pub(crate) settings: models::SettingsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15822,8 +15822,8 @@ pub mod product_settings { } } 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`."] @@ -16790,9 +16790,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16873,8 +16873,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16894,9 +16894,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16976,8 +16976,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -16997,9 +16997,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17081,8 +17081,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -17398,9 +17398,9 @@ pub mod threat_intelligence_indicator { #[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::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17482,8 +17482,8 @@ pub mod threat_intelligence_indicator { } } 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`."] @@ -22093,7 +22093,7 @@ pub mod data_connector_definitions { resource_group_name: impl Into, workspace_name: impl Into, data_connector_definition_name: impl Into, - connector_definition_input: impl Into, + connector_definition_input: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -22258,9 +22258,9 @@ pub mod data_connector_definitions { #[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::DataConnectorDefinition = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorDefinitionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22340,8 +22340,8 @@ pub mod data_connector_definitions { } } 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`."] @@ -22361,9 +22361,9 @@ pub mod data_connector_definitions { #[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::DataConnectorDefinition = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorDefinitionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22408,7 +22408,7 @@ pub mod data_connector_definitions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) data_connector_definition_name: String, - pub(crate) connector_definition_input: models::DataConnectorDefinition, + pub(crate) connector_definition_input: models::DataConnectorDefinitionUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22445,8 +22445,8 @@ pub mod data_connector_definitions { } } 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`."] @@ -22607,7 +22607,7 @@ pub mod data_connectors { resource_group_name: impl Into, workspace_name: impl Into, data_connector_id: impl Into, - data_connector: impl Into, + data_connector: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -22817,9 +22817,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22899,8 +22899,8 @@ pub mod data_connectors { } } 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`."] @@ -22920,9 +22920,9 @@ pub mod data_connectors { #[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::DataConnector = serde_json::from_slice(&bytes)?; + let body: models::DataConnectorUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22967,7 +22967,7 @@ pub mod data_connectors { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) data_connector_id: String, - pub(crate) data_connector: models::DataConnector, + pub(crate) data_connector: models::DataConnectorUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -23004,8 +23004,8 @@ pub mod data_connectors { } } 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`."] @@ -23298,7 +23298,7 @@ pub mod data_connectors_check_requirements { subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - data_connectors_check_requirements: impl Into, + data_connectors_check_requirements: impl Into, ) -> post::RequestBuilder { post::RequestBuilder { client: self.0.clone(), @@ -23364,7 +23364,7 @@ pub mod data_connectors_check_requirements { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirements, + pub(crate) data_connectors_check_requirements: models::DataConnectorsCheckRequirementsUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/securityinsights/src/package_preview_2023_08/models.rs b/services/mgmt/securityinsights/src/package_preview_2023_08/models.rs index 907f18f2ff..7f5701b0c4 100644 --- a/services/mgmt/securityinsights/src/package_preview_2023_08/models.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_08/models.rs @@ -703,6 +703,18 @@ impl AlertRule { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleUnion { + Fusion(FusionAlertRule), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRule), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRule), + #[serde(rename = "NRT")] + Nrt(NrtAlertRule), + Scheduled(ScheduledAlertRule), + ThreatIntelligence(ThreatIntelligenceAlertRule), +} #[doc = "The kind of the alert rule"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AlertRuleKindEnum")] @@ -768,6 +780,18 @@ impl AlertRuleTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AlertRuleTemplateUnion { + Fusion(FusionAlertRuleTemplate), + #[serde(rename = "MLBehaviorAnalytics")] + MlBehaviorAnalytics(MlBehaviorAnalyticsAlertRuleTemplate), + MicrosoftSecurityIncidentCreation(MicrosoftSecurityIncidentCreationAlertRuleTemplate), + #[serde(rename = "NRT")] + Nrt(NrtAlertRuleTemplate), + Scheduled(ScheduledAlertRuleTemplate), + ThreatIntelligence(ThreatIntelligenceAlertRuleTemplate), +} #[doc = "alert rule template data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AlertRuleTemplateDataSource { @@ -894,7 +918,7 @@ pub struct AlertRuleTemplatesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rule templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRuleTemplatesList { type Continuation = String; @@ -903,7 +927,7 @@ impl azure_core::Continuable for AlertRuleTemplatesList { } } impl AlertRuleTemplatesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -922,7 +946,7 @@ pub struct AlertRulesList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of alert rules."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for AlertRulesList { type Continuation = String; @@ -931,7 +955,7 @@ impl azure_core::Continuable for AlertRulesList { } } impl AlertRulesList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -1359,6 +1383,13 @@ impl AutomationRuleAction { Self { order, action_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionType")] +pub enum AutomationRuleActionUnion { + AddIncidentTask(AutomationRuleAddIncidentTaskAction), + ModifyProperties(AutomationRuleModifyPropertiesAction), + RunPlaybook(AutomationRuleRunPlaybookAction), +} #[doc = "Describes an automation rule action to add a task to an incident"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleAddIncidentTaskAction { @@ -1385,7 +1416,7 @@ pub struct AutomationRuleBooleanCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub inner_conditions: Vec, + pub inner_conditions: Vec, } impl AutomationRuleBooleanCondition { pub fn new() -> Self { @@ -1439,6 +1470,15 @@ impl AutomationRuleCondition { Self { condition_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "conditionType")] +pub enum AutomationRuleConditionUnion { + Boolean(BooleanConditionProperties), + PropertyArrayChanged(PropertyArrayChangedConditionProperties), + PropertyArray(PropertyArrayConditionProperties), + PropertyChanged(PropertyChangedConditionProperties), + Property(PropertyConditionProperties), +} #[doc = "Describes an automation rule action to modify an object's properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AutomationRuleModifyPropertiesAction { @@ -1467,7 +1507,7 @@ pub struct AutomationRuleProperties { #[serde(rename = "triggeringLogic")] pub triggering_logic: AutomationRuleTriggeringLogic, #[doc = "The actions to execute when the automation rule is triggered."] - pub actions: Vec, + pub actions: Vec, #[doc = "The last time the automation rule was updated."] #[serde(rename = "lastModifiedTimeUtc", default, with = "azure_core::date::rfc3339::option")] pub last_modified_time_utc: Option, @@ -1486,7 +1526,7 @@ impl AutomationRuleProperties { display_name: String, order: i32, triggering_logic: AutomationRuleTriggeringLogic, - actions: Vec, + actions: Vec, ) -> Self { Self { display_name, @@ -1684,7 +1724,7 @@ pub struct AutomationRulePropertyArrayValuesCondition { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub item_conditions: Vec, + pub item_conditions: Vec, } impl AutomationRulePropertyArrayValuesCondition { pub fn new() -> Self { @@ -2178,7 +2218,7 @@ pub struct AutomationRuleTriggeringLogic { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub conditions: Vec, + pub conditions: Vec, } impl AutomationRuleTriggeringLogic { pub fn new(is_enabled: bool, triggers_on: TriggersOn, triggers_when: TriggersWhen) -> Self { @@ -2406,6 +2446,11 @@ impl BillingStatistic { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum BillingStatisticUnion { + SapSolutionUsage(SapSolutionUsageStatistic), +} #[doc = "The kind of the billing statistic"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BillingStatisticKindEnum")] @@ -2448,7 +2493,7 @@ pub struct BillingStatisticList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of billing statistics."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for BillingStatisticList { type Continuation = String; @@ -2457,7 +2502,7 @@ impl azure_core::Continuable for BillingStatisticList { } } impl BillingStatisticList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -2539,7 +2584,7 @@ pub mod bookmark_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of expansion result connected entities"] #[serde( default, @@ -3482,6 +3527,11 @@ impl CustomEntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum CustomEntityQueryUnion { + Activity(ActivityCustomEntityQuery), +} #[doc = "The kind of the entity query that supports put request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "CustomEntityQueryKind")] @@ -3728,6 +3778,39 @@ impl DataConnector { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorUnion { + AzureActiveDirectory(AadDataConnector), + AzureAdvancedThreatProtection(AatpDataConnector), + AzureSecurityCenter(AscDataConnector), + AmazonWebServicesCloudTrail(AwsCloudTrailDataConnector), + AmazonWebServicesS3(AwsS3DataConnector), + #[serde(rename = "APIPolling")] + ApiPolling(CodelessApiPollingDataConnector), + #[serde(rename = "GenericUI")] + GenericUi(CodelessUiDataConnector), + Dynamics365(Dynamics365DataConnector), + #[serde(rename = "GCP")] + Gcp(GcpDataConnector), + #[serde(rename = "IOT")] + Iot(IoTDataConnector), + MicrosoftCloudAppSecurity(McasDataConnector), + MicrosoftDefenderAdvancedThreatProtection(MdatpDataConnector), + MicrosoftThreatIntelligence(MstiDataConnector), + MicrosoftThreatProtection(MtpDataConnector), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionDataConnector), + Office365Project(Office365ProjectDataConnector), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpDataConnector), + Office365(OfficeDataConnector), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmDataConnector), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiDataConnector), + ThreatIntelligence(TiDataConnector), + ThreatIntelligenceTaxii(TiTaxiiDataConnector), +} #[doc = "Describes the state of user's authorization for a connector kind."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DataConnectorAuthorizationState")] @@ -3922,6 +4005,11 @@ impl DataConnectorDefinition { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorDefinitionUnion { + Customizable(CustomizableConnectorDefinition), +} #[doc = "Encapsulate the data connector definition object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataConnectorDefinitionArmCollectionWrapper { @@ -3930,7 +4018,7 @@ pub struct DataConnectorDefinitionArmCollectionWrapper { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, } @@ -4120,7 +4208,7 @@ pub struct DataConnectorList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of data connectors."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for DataConnectorList { type Continuation = String; @@ -4129,7 +4217,7 @@ impl azure_core::Continuable for DataConnectorList { } } impl DataConnectorList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -4183,6 +4271,32 @@ impl DataConnectorsCheckRequirements { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectorsCheckRequirementsUnion { + AzureActiveDirectory(AadCheckRequirements), + AzureAdvancedThreatProtection(AatpCheckRequirements), + AzureSecurityCenter(AscCheckRequirements), + AmazonWebServicesCloudTrail(AwsCloudTrailCheckRequirements), + AmazonWebServicesS3(AwsS3CheckRequirements), + Dynamics365(Dynamics365CheckRequirements), + #[serde(rename = "IOT")] + Iot(IoTCheckRequirements), + MicrosoftCloudAppSecurity(McasCheckRequirements), + MicrosoftDefenderAdvancedThreatProtection(MdatpCheckRequirements), + MicrosoftThreatIntelligence(MstiCheckRequirements), + MicrosoftPurviewInformationProtection(MicrosoftPurviewInformationProtectionCheckRequirements), + MicrosoftThreatProtection(MtpCheckRequirements), + Office365Project(Office365ProjectCheckRequirements), + #[serde(rename = "OfficeATP")] + OfficeAtp(OfficeAtpCheckRequirements), + #[serde(rename = "OfficeIRM")] + OfficeIrm(OfficeIrmCheckRequirements), + #[serde(rename = "OfficePowerBI")] + OfficePowerBi(OfficePowerBiCheckRequirements), + ThreatIntelligence(TiCheckRequirements), + ThreatIntelligenceTaxii(TiTaxiiCheckRequirements), +} #[doc = "The data type definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataTypeDefinitions { @@ -4657,6 +4771,12 @@ impl Entity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityUnion { + Bookmark(HuntingBookmark), + SecurityAlert(SecurityAlert), +} #[doc = "Settings with single toggle."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityAnalytics { @@ -4765,7 +4885,7 @@ pub mod entity_expand_response { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "Array of edges that connects the entity to the list of entities."] #[serde( default, @@ -5053,7 +5173,7 @@ pub struct EntityList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entities."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityList { type Continuation = String; @@ -5062,7 +5182,7 @@ impl azure_core::Continuable for EntityList { } } impl EntityList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5235,6 +5355,12 @@ impl EntityQuery { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryUnion { + Activity(ActivityEntityQuery), + Expansion(ExpansionEntityQuery), +} #[doc = "An abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EntityQueryItem { @@ -5260,6 +5386,11 @@ impl EntityQueryItem { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryItemUnion { + Insight(InsightQueryItem), +} #[doc = "An properties abstract Query item for entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EntityQueryItemProperties { @@ -5337,7 +5468,7 @@ pub struct EntityQueryList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity queries."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryList { type Continuation = String; @@ -5346,7 +5477,7 @@ impl azure_core::Continuable for EntityQueryList { } } impl EntityQueryList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5366,6 +5497,11 @@ impl EntityQueryTemplate { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityQueryTemplateUnion { + Activity(ActivityEntityQueryTemplate), +} #[doc = "The kind of the entity query template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityQueryTemplateKind")] @@ -5408,7 +5544,7 @@ pub struct EntityQueryTemplateList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of entity query templates."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for EntityQueryTemplateList { type Continuation = String; @@ -5417,7 +5553,7 @@ impl azure_core::Continuable for EntityQueryTemplateList { } } impl EntityQueryTemplateList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -5432,6 +5568,14 @@ impl EntityTimelineItem { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EntityTimelineItemUnion { + Activity(ActivityTimelineItem), + Anomaly(AnomalyTimelineItem), + Bookmark(BookmarkTimelineItem), + SecurityAlert(SecurityAlertTimelineItem), +} #[doc = "The entity query kind"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EntityTimelineKind")] @@ -5515,7 +5659,7 @@ pub struct EntityTimelineResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EntityTimelineResponse { pub fn new() -> Self { @@ -6622,7 +6766,7 @@ pub struct GetQueriesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl GetQueriesResponse { pub fn new() -> Self { @@ -7460,7 +7604,7 @@ pub struct IncidentEntitiesResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub entities: Vec, + pub entities: Vec, #[doc = "The metadata from the incident related entities results."] #[serde( rename = "metaData", @@ -11532,6 +11676,11 @@ impl SecurityMlAnalyticsSetting { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecurityMlAnalyticsSettingUnion { + Anomaly(AnomalySecurityMlAnalyticsSettings), +} #[doc = "security ml analytics settings data sources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityMlAnalyticsSettingsDataSource { @@ -11594,7 +11743,7 @@ pub struct SecurityMlAnalyticsSettingsList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of SecurityMLAnalyticsSettings"] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { type Continuation = String; @@ -11603,7 +11752,7 @@ impl azure_core::Continuable for SecurityMlAnalyticsSettingsList { } } impl SecurityMlAnalyticsSettingsList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -11679,10 +11828,10 @@ impl ServicePrincipal { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SettingList { #[doc = "Array of settings."] - pub value: Vec, + pub value: Vec, } impl SettingList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value } } } @@ -11746,6 +11895,14 @@ pub mod settings { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SettingsUnion { + Anomalies(Anomalies), + EntityAnalytics(EntityAnalytics), + EyesOn(EyesOn), + Ueba(Ueba), +} #[doc = "Represents a SourceControl in Azure Security Insights."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceControl { @@ -12386,6 +12543,12 @@ impl ThreatIntelligenceInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ThreatIntelligenceInformationUnion { + #[serde(rename = "indicator")] + Indicator(ThreatIntelligenceIndicatorModel), +} #[doc = "List of all the threat intelligence information objects."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ThreatIntelligenceInformationList { @@ -12393,7 +12556,7 @@ pub struct ThreatIntelligenceInformationList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Array of threat intelligence information objects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for ThreatIntelligenceInformationList { type Continuation = String; @@ -12402,7 +12565,7 @@ impl azure_core::Continuable for ThreatIntelligenceInformationList { } } impl ThreatIntelligenceInformationList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } diff --git a/services/mgmt/servicefabricmanagedclusters/src/package_2022_08_preview/models.rs b/services/mgmt/servicefabricmanagedclusters/src/package_2022_08_preview/models.rs index 5d1402a63a..72301be68e 100644 --- a/services/mgmt/servicefabricmanagedclusters/src/package_2022_08_preview/models.rs +++ b/services/mgmt/servicefabricmanagedclusters/src/package_2022_08_preview/models.rs @@ -2227,6 +2227,13 @@ impl Partition { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "partitionScheme")] +pub enum PartitionUnion { + Named(NamedPartitionScheme), + Singleton(SingletonPartitionScheme), + UniformInt64Range(UniformInt64RangePartitionScheme), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -2502,18 +2509,24 @@ impl ScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingMechanismUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + ScalePartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Specifies a metric to load balance a service during runtime."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ScalingPolicy { #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "scalingMechanism")] - pub scaling_mechanism: ScalingMechanism, + pub scaling_mechanism: ScalingMechanismUnion, #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "scalingTrigger")] - pub scaling_trigger: ScalingTrigger, + pub scaling_trigger: ScalingTriggerUnion, } impl ScalingPolicy { - pub fn new(scaling_mechanism: ScalingMechanism, scaling_trigger: ScalingTrigger) -> Self { + pub fn new(scaling_mechanism: ScalingMechanismUnion, scaling_trigger: ScalingTriggerUnion) -> Self { Self { scaling_mechanism, scaling_trigger, @@ -2532,6 +2545,12 @@ impl ScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingTriggerUnion { + AveragePartitionLoadTrigger(AveragePartitionLoadScalingTrigger), + AverageServiceLoadTrigger(AverageServiceLoadScalingTrigger), +} #[doc = "Creates a particular correlation between services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceCorrelation { @@ -2754,6 +2773,15 @@ impl ServicePlacementPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServicePlacementPolicyUnion { + InvalidDomain(ServicePlacementInvalidDomainPolicy), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicy), + PreferredPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicy), + RequiredDomainDistribution(ServicePlacementRequireDomainDistributionPolicy), + RequiredDomain(ServicePlacementRequiredDomainPolicy), +} #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePlacementPolicyType")] @@ -2859,7 +2887,7 @@ pub struct ServiceResource { pub proxy_resource: ProxyResource, #[doc = "The service resource properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -2906,13 +2934,13 @@ pub struct ServiceResourceProperties { pub service_type_name: String, #[doc = "Describes how the service is partitioned."] #[serde(rename = "partitionDescription")] - pub partition_description: Partition, + pub partition_description: PartitionUnion, #[doc = "The activation Mode of the service package"] #[serde(rename = "servicePackageActivationMode", default, skip_serializing_if = "Option::is_none")] pub service_package_activation_mode: Option, } impl ServiceResourceProperties { - pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: Partition) -> Self { + pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: PartitionUnion) -> Self { Self { service_resource_properties_base: ServiceResourcePropertiesBase::default(), provisioning_state: None, @@ -2963,6 +2991,12 @@ pub mod service_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceKind")] +pub enum ServiceResourcePropertiesUnion { + Stateful(StatefulServiceProperties), + Stateless(StatelessServiceProperties), +} #[doc = "The common service resource properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceResourcePropertiesBase { diff --git a/services/mgmt/servicefabricmanagedclusters/src/package_2022_10_preview/models.rs b/services/mgmt/servicefabricmanagedclusters/src/package_2022_10_preview/models.rs index 91cd43235d..29013422bc 100644 --- a/services/mgmt/servicefabricmanagedclusters/src/package_2022_10_preview/models.rs +++ b/services/mgmt/servicefabricmanagedclusters/src/package_2022_10_preview/models.rs @@ -2296,6 +2296,13 @@ impl Partition { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "partitionScheme")] +pub enum PartitionUnion { + Named(NamedPartitionScheme), + Singleton(SingletonPartitionScheme), + UniformInt64Range(UniformInt64RangePartitionScheme), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -2571,18 +2578,24 @@ impl ScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingMechanismUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + ScalePartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Specifies a metric to load balance a service during runtime."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ScalingPolicy { #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "scalingMechanism")] - pub scaling_mechanism: ScalingMechanism, + pub scaling_mechanism: ScalingMechanismUnion, #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "scalingTrigger")] - pub scaling_trigger: ScalingTrigger, + pub scaling_trigger: ScalingTriggerUnion, } impl ScalingPolicy { - pub fn new(scaling_mechanism: ScalingMechanism, scaling_trigger: ScalingTrigger) -> Self { + pub fn new(scaling_mechanism: ScalingMechanismUnion, scaling_trigger: ScalingTriggerUnion) -> Self { Self { scaling_mechanism, scaling_trigger, @@ -2601,6 +2614,12 @@ impl ScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingTriggerUnion { + AveragePartitionLoadTrigger(AveragePartitionLoadScalingTrigger), + AverageServiceLoadTrigger(AverageServiceLoadScalingTrigger), +} #[doc = "Creates a particular correlation between services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceCorrelation { @@ -2823,6 +2842,15 @@ impl ServicePlacementPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServicePlacementPolicyUnion { + InvalidDomain(ServicePlacementInvalidDomainPolicy), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicy), + PreferredPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicy), + RequiredDomainDistribution(ServicePlacementRequireDomainDistributionPolicy), + RequiredDomain(ServicePlacementRequiredDomainPolicy), +} #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePlacementPolicyType")] @@ -2928,7 +2956,7 @@ pub struct ServiceResource { pub proxy_resource: ProxyResource, #[doc = "The service resource properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -2975,7 +3003,7 @@ pub struct ServiceResourceProperties { pub service_type_name: String, #[doc = "Describes how the service is partitioned."] #[serde(rename = "partitionDescription")] - pub partition_description: Partition, + pub partition_description: PartitionUnion, #[doc = "The activation Mode of the service package"] #[serde(rename = "servicePackageActivationMode", default, skip_serializing_if = "Option::is_none")] pub service_package_activation_mode: Option, @@ -2984,7 +3012,7 @@ pub struct ServiceResourceProperties { pub service_dns_name: Option, } impl ServiceResourceProperties { - pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: Partition) -> Self { + pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: PartitionUnion) -> Self { Self { service_resource_properties_base: ServiceResourcePropertiesBase::default(), provisioning_state: None, @@ -3036,6 +3064,12 @@ pub mod service_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceKind")] +pub enum ServiceResourcePropertiesUnion { + Stateful(StatefulServiceProperties), + Stateless(StatelessServiceProperties), +} #[doc = "The common service resource properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceResourcePropertiesBase { diff --git a/services/mgmt/servicefabricmanagedclusters/src/package_2023_02_preview/models.rs b/services/mgmt/servicefabricmanagedclusters/src/package_2023_02_preview/models.rs index c22cc8e827..37ea43ce9f 100644 --- a/services/mgmt/servicefabricmanagedclusters/src/package_2023_02_preview/models.rs +++ b/services/mgmt/servicefabricmanagedclusters/src/package_2023_02_preview/models.rs @@ -2349,6 +2349,13 @@ impl Partition { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "partitionScheme")] +pub enum PartitionUnion { + Named(NamedPartitionScheme), + Singleton(SingletonPartitionScheme), + UniformInt64Range(UniformInt64RangePartitionScheme), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -2624,18 +2631,24 @@ impl ScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingMechanismUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + ScalePartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Specifies a metric to load balance a service during runtime."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ScalingPolicy { #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "scalingMechanism")] - pub scaling_mechanism: ScalingMechanism, + pub scaling_mechanism: ScalingMechanismUnion, #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "scalingTrigger")] - pub scaling_trigger: ScalingTrigger, + pub scaling_trigger: ScalingTriggerUnion, } impl ScalingPolicy { - pub fn new(scaling_mechanism: ScalingMechanism, scaling_trigger: ScalingTrigger) -> Self { + pub fn new(scaling_mechanism: ScalingMechanismUnion, scaling_trigger: ScalingTriggerUnion) -> Self { Self { scaling_mechanism, scaling_trigger, @@ -2654,6 +2667,12 @@ impl ScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingTriggerUnion { + AveragePartitionLoadTrigger(AveragePartitionLoadScalingTrigger), + AverageServiceLoadTrigger(AverageServiceLoadScalingTrigger), +} #[doc = "Creates a particular correlation between services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceCorrelation { @@ -2876,6 +2895,15 @@ impl ServicePlacementPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServicePlacementPolicyUnion { + InvalidDomain(ServicePlacementInvalidDomainPolicy), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicy), + PreferredPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicy), + RequiredDomainDistribution(ServicePlacementRequireDomainDistributionPolicy), + RequiredDomain(ServicePlacementRequiredDomainPolicy), +} #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePlacementPolicyType")] @@ -2981,7 +3009,7 @@ pub struct ServiceResource { pub proxy_resource: ProxyResource, #[doc = "The service resource properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -3028,7 +3056,7 @@ pub struct ServiceResourceProperties { pub service_type_name: String, #[doc = "Describes how the service is partitioned."] #[serde(rename = "partitionDescription")] - pub partition_description: Partition, + pub partition_description: PartitionUnion, #[doc = "The activation Mode of the service package"] #[serde(rename = "servicePackageActivationMode", default, skip_serializing_if = "Option::is_none")] pub service_package_activation_mode: Option, @@ -3037,7 +3065,7 @@ pub struct ServiceResourceProperties { pub service_dns_name: Option, } impl ServiceResourceProperties { - pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: Partition) -> Self { + pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: PartitionUnion) -> Self { Self { service_resource_properties_base: ServiceResourcePropertiesBase::default(), provisioning_state: None, @@ -3089,6 +3117,12 @@ pub mod service_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceKind")] +pub enum ServiceResourcePropertiesUnion { + Stateful(StatefulServiceProperties), + Stateless(StatelessServiceProperties), +} #[doc = "The common service resource properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceResourcePropertiesBase { diff --git a/services/mgmt/servicefabricmanagedclusters/src/package_2023_03_preview/models.rs b/services/mgmt/servicefabricmanagedclusters/src/package_2023_03_preview/models.rs index aa95e751f0..7c14b4403a 100644 --- a/services/mgmt/servicefabricmanagedclusters/src/package_2023_03_preview/models.rs +++ b/services/mgmt/servicefabricmanagedclusters/src/package_2023_03_preview/models.rs @@ -2361,6 +2361,13 @@ impl Partition { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "partitionScheme")] +pub enum PartitionUnion { + Named(NamedPartitionScheme), + Singleton(SingletonPartitionScheme), + UniformInt64Range(UniformInt64RangePartitionScheme), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -2636,18 +2643,24 @@ impl ScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingMechanismUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + ScalePartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Specifies a metric to load balance a service during runtime."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ScalingPolicy { #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "scalingMechanism")] - pub scaling_mechanism: ScalingMechanism, + pub scaling_mechanism: ScalingMechanismUnion, #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "scalingTrigger")] - pub scaling_trigger: ScalingTrigger, + pub scaling_trigger: ScalingTriggerUnion, } impl ScalingPolicy { - pub fn new(scaling_mechanism: ScalingMechanism, scaling_trigger: ScalingTrigger) -> Self { + pub fn new(scaling_mechanism: ScalingMechanismUnion, scaling_trigger: ScalingTriggerUnion) -> Self { Self { scaling_mechanism, scaling_trigger, @@ -2666,6 +2679,12 @@ impl ScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingTriggerUnion { + AveragePartitionLoadTrigger(AveragePartitionLoadScalingTrigger), + AverageServiceLoadTrigger(AverageServiceLoadScalingTrigger), +} #[doc = "Creates a particular correlation between services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceCorrelation { @@ -2888,6 +2907,15 @@ impl ServicePlacementPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServicePlacementPolicyUnion { + InvalidDomain(ServicePlacementInvalidDomainPolicy), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicy), + PreferredPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicy), + RequiredDomainDistribution(ServicePlacementRequireDomainDistributionPolicy), + RequiredDomain(ServicePlacementRequiredDomainPolicy), +} #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePlacementPolicyType")] @@ -2993,7 +3021,7 @@ pub struct ServiceResource { pub proxy_resource: ProxyResource, #[doc = "The service resource properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -3040,7 +3068,7 @@ pub struct ServiceResourceProperties { pub service_type_name: String, #[doc = "Describes how the service is partitioned."] #[serde(rename = "partitionDescription")] - pub partition_description: Partition, + pub partition_description: PartitionUnion, #[doc = "The activation Mode of the service package"] #[serde(rename = "servicePackageActivationMode", default, skip_serializing_if = "Option::is_none")] pub service_package_activation_mode: Option, @@ -3049,7 +3077,7 @@ pub struct ServiceResourceProperties { pub service_dns_name: Option, } impl ServiceResourceProperties { - pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: Partition) -> Self { + pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: PartitionUnion) -> Self { Self { service_resource_properties_base: ServiceResourcePropertiesBase::default(), provisioning_state: None, @@ -3101,6 +3129,12 @@ pub mod service_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceKind")] +pub enum ServiceResourcePropertiesUnion { + Stateful(StatefulServiceProperties), + Stateless(StatelessServiceProperties), +} #[doc = "The common service resource properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceResourcePropertiesBase { diff --git a/services/mgmt/servicefabricmanagedclusters/src/package_2023_07_preview/models.rs b/services/mgmt/servicefabricmanagedclusters/src/package_2023_07_preview/models.rs index df0c5ffb11..1068310717 100644 --- a/services/mgmt/servicefabricmanagedclusters/src/package_2023_07_preview/models.rs +++ b/services/mgmt/servicefabricmanagedclusters/src/package_2023_07_preview/models.rs @@ -2403,6 +2403,13 @@ impl Partition { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "partitionScheme")] +pub enum PartitionUnion { + Named(NamedPartitionScheme), + Singleton(SingletonPartitionScheme), + UniformInt64Range(UniformInt64RangePartitionScheme), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -2678,18 +2685,24 @@ impl ScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingMechanismUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + ScalePartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Specifies a metric to load balance a service during runtime."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ScalingPolicy { #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "scalingMechanism")] - pub scaling_mechanism: ScalingMechanism, + pub scaling_mechanism: ScalingMechanismUnion, #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "scalingTrigger")] - pub scaling_trigger: ScalingTrigger, + pub scaling_trigger: ScalingTriggerUnion, } impl ScalingPolicy { - pub fn new(scaling_mechanism: ScalingMechanism, scaling_trigger: ScalingTrigger) -> Self { + pub fn new(scaling_mechanism: ScalingMechanismUnion, scaling_trigger: ScalingTriggerUnion) -> Self { Self { scaling_mechanism, scaling_trigger, @@ -2708,6 +2721,12 @@ impl ScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ScalingTriggerUnion { + AveragePartitionLoadTrigger(AveragePartitionLoadScalingTrigger), + AverageServiceLoadTrigger(AverageServiceLoadScalingTrigger), +} #[doc = "Creates a particular correlation between services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceCorrelation { @@ -2930,6 +2949,15 @@ impl ServicePlacementPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServicePlacementPolicyUnion { + InvalidDomain(ServicePlacementInvalidDomainPolicy), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicy), + PreferredPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicy), + RequiredDomainDistribution(ServicePlacementRequireDomainDistributionPolicy), + RequiredDomain(ServicePlacementRequiredDomainPolicy), +} #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePlacementPolicyType")] @@ -3035,7 +3063,7 @@ pub struct ServiceResource { pub proxy_resource: ProxyResource, #[doc = "The service resource properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl ServiceResource { pub fn new() -> Self { @@ -3082,7 +3110,7 @@ pub struct ServiceResourceProperties { pub service_type_name: String, #[doc = "Describes how the service is partitioned."] #[serde(rename = "partitionDescription")] - pub partition_description: Partition, + pub partition_description: PartitionUnion, #[doc = "The activation Mode of the service package"] #[serde(rename = "servicePackageActivationMode", default, skip_serializing_if = "Option::is_none")] pub service_package_activation_mode: Option, @@ -3091,7 +3119,7 @@ pub struct ServiceResourceProperties { pub service_dns_name: Option, } impl ServiceResourceProperties { - pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: Partition) -> Self { + pub fn new(service_kind: ServiceKind, service_type_name: String, partition_description: PartitionUnion) -> Self { Self { service_resource_properties_base: ServiceResourcePropertiesBase::default(), provisioning_state: None, @@ -3143,6 +3171,12 @@ pub mod service_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "serviceKind")] +pub enum ServiceResourcePropertiesUnion { + Stateful(StatefulServiceProperties), + Stateless(StatelessServiceProperties), +} #[doc = "The common service resource properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceResourcePropertiesBase { diff --git a/services/mgmt/servicefabricmesh/src/package_2018_07_01_preview/models.rs b/services/mgmt/servicefabricmesh/src/package_2018_07_01_preview/models.rs index 086acee408..c3dc9713de 100644 --- a/services/mgmt/servicefabricmesh/src/package_2018_07_01_preview/models.rs +++ b/services/mgmt/servicefabricmesh/src/package_2018_07_01_preview/models.rs @@ -432,7 +432,7 @@ pub struct DiagnosticsDescription { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, #[doc = "Status of whether or not sinks are enabled."] #[serde(default, skip_serializing_if = "Option::is_none")] pub enabled: Option, @@ -530,6 +530,11 @@ impl DiagnosticsSinkProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DiagnosticsSinkPropertiesUnion { + AzureInternalMonitoringPipeline(AzureInternalMonitoringPipelineSinkDescription), +} #[doc = "Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, \nwhere instance name is dimension of the metric HTTP request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Dimension { diff --git a/services/mgmt/servicefabricmesh/src/package_2018_09_01_preview/models.rs b/services/mgmt/servicefabricmesh/src/package_2018_09_01_preview/models.rs index e2f0b6fc60..692fd45d31 100644 --- a/services/mgmt/servicefabricmesh/src/package_2018_09_01_preview/models.rs +++ b/services/mgmt/servicefabricmesh/src/package_2018_09_01_preview/models.rs @@ -134,10 +134,10 @@ pub struct ApplicationScopedVolume { pub volume_reference: VolumeReference, #[doc = "Describes parameters for creating application-scoped volumes."] #[serde(rename = "creationParameters")] - pub creation_parameters: ApplicationScopedVolumeCreationParameters, + pub creation_parameters: ApplicationScopedVolumeCreationParametersUnion, } impl ApplicationScopedVolume { - pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParameters) -> Self { + pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParametersUnion) -> Self { Self { volume_reference, creation_parameters, @@ -158,6 +158,11 @@ impl ApplicationScopedVolumeCreationParameters { Self { kind, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ApplicationScopedVolumeCreationParametersUnion { + ServiceFabricVolumeDisk(ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk), +} #[doc = "Describes parameters for creating application-scoped volumes provided by Service Fabric Volume Disks"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk { @@ -268,6 +273,11 @@ impl AutoScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMechanismUnion { + AddRemoveReplica(AddRemoveReplicaScalingMechanism), +} #[doc = "Enumerates the mechanisms for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMechanismKind")] @@ -314,6 +324,11 @@ impl AutoScalingMetric { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMetricUnion { + Resource(AutoScalingResourceMetric), +} #[doc = "Enumerates the metrics that are used for triggering auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMetricKind")] @@ -355,12 +370,12 @@ pub struct AutoScalingPolicy { #[doc = "The name of the auto scaling policy."] pub name: String, #[doc = "Describes the trigger for performing auto scaling operation."] - pub trigger: AutoScalingTrigger, + pub trigger: AutoScalingTriggerUnion, #[doc = "Describes the mechanism for performing auto scaling operation. Derived classes will describe the actual mechanism."] - pub mechanism: AutoScalingMechanism, + pub mechanism: AutoScalingMechanismUnion, } impl AutoScalingPolicy { - pub fn new(name: String, trigger: AutoScalingTrigger, mechanism: AutoScalingMechanism) -> Self { + pub fn new(name: String, trigger: AutoScalingTriggerUnion, mechanism: AutoScalingMechanismUnion) -> Self { Self { name, trigger, mechanism } } } @@ -427,6 +442,11 @@ impl AutoScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingTriggerUnion { + AverageLoad(AverageLoadScalingTrigger), +} #[doc = "Enumerates the triggers for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingTriggerKind")] @@ -501,7 +521,7 @@ pub struct AverageLoadScalingTrigger { #[serde(flatten)] pub auto_scaling_trigger: AutoScalingTrigger, #[doc = "Describes the metric that is used for triggering auto scaling operation. Derived classes will describe resources or metrics."] - pub metric: AutoScalingMetric, + pub metric: AutoScalingMetricUnion, #[doc = "Lower load threshold (if average load is below this threshold, service will scale down)."] #[serde(rename = "lowerLoadThreshold")] pub lower_load_threshold: f64, @@ -515,7 +535,7 @@ pub struct AverageLoadScalingTrigger { impl AverageLoadScalingTrigger { pub fn new( auto_scaling_trigger: AutoScalingTrigger, - metric: AutoScalingMetric, + metric: AutoScalingMetricUnion, lower_load_threshold: f64, upper_load_threshold: f64, scale_interval_in_seconds: i64, @@ -774,7 +794,7 @@ pub struct DiagnosticsDescription { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, #[doc = "Status of whether or not sinks are enabled."] #[serde(default, skip_serializing_if = "Option::is_none")] pub enabled: Option, @@ -872,6 +892,11 @@ impl DiagnosticsSinkProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DiagnosticsSinkPropertiesUnion { + AzureInternalMonitoringPipeline(AzureInternalMonitoringPipelineSinkDescription), +} #[doc = "Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, \nwhere instance name is dimension of the metric HTTP request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Dimension { @@ -1637,6 +1662,9 @@ impl NetworkResourcePropertiesBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum NetworkResourcePropertiesBaseUnion {} #[doc = "The operation system required by the code in service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "OperatingSystemType")] @@ -1991,6 +2019,9 @@ impl SecretResourcePropertiesBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecretResourcePropertiesBaseUnion {} #[doc = "This type represents the unencrypted value of the secret."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretValue { diff --git a/services/mgmt/servicelinker/src/package_2021_11_01_preview/models.rs b/services/mgmt/servicelinker/src/package_2021_11_01_preview/models.rs index 73dc9e6a96..68075498f5 100644 --- a/services/mgmt/servicelinker/src/package_2021_11_01_preview/models.rs +++ b/services/mgmt/servicelinker/src/package_2021_11_01_preview/models.rs @@ -15,6 +15,20 @@ impl AuthInfoBase { Self { auth_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum AuthInfoBaseUnion { + #[serde(rename = "secret")] + Secret(SecretAuthInfo), + #[serde(rename = "servicePrincipalCertificate")] + ServicePrincipalCertificate(ServicePrincipalCertificateAuthInfo), + #[serde(rename = "servicePrincipalSecret")] + ServicePrincipalSecret(ServicePrincipalSecretAuthInfo), + #[serde(rename = "systemAssignedIdentity")] + SystemAssignedIdentity(SystemAssignedIdentityAuthInfo), + #[serde(rename = "userAssignedIdentity")] + UserAssignedIdentity(UserAssignedIdentityAuthInfo), +} #[doc = "The authentication type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AuthType")] @@ -174,7 +188,7 @@ pub struct LinkerProperties { pub target_id: Option, #[doc = "The authentication info"] #[serde(rename = "authInfo", default, skip_serializing_if = "Option::is_none")] - pub auth_info: Option, + pub auth_info: Option, #[doc = "The application client type"] #[serde(rename = "clientType", default, skip_serializing_if = "Option::is_none")] pub client_type: Option, diff --git a/services/mgmt/servicelinker/src/package_2022_01_01_preview/models.rs b/services/mgmt/servicelinker/src/package_2022_01_01_preview/models.rs index ab9ddeb9d1..62f62281aa 100644 --- a/services/mgmt/servicelinker/src/package_2022_01_01_preview/models.rs +++ b/services/mgmt/servicelinker/src/package_2022_01_01_preview/models.rs @@ -15,6 +15,20 @@ impl AuthInfoBase { Self { auth_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum AuthInfoBaseUnion { + #[serde(rename = "secret")] + Secret(SecretAuthInfo), + #[serde(rename = "servicePrincipalCertificate")] + ServicePrincipalCertificate(ServicePrincipalCertificateAuthInfo), + #[serde(rename = "servicePrincipalSecret")] + ServicePrincipalSecret(ServicePrincipalSecretAuthInfo), + #[serde(rename = "systemAssignedIdentity")] + SystemAssignedIdentity(SystemAssignedIdentityAuthInfo), + #[serde(rename = "userAssignedIdentity")] + UserAssignedIdentity(UserAssignedIdentityAuthInfo), +} #[doc = "The authentication type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AuthType")] @@ -90,7 +104,7 @@ pub struct AzureResource { pub id: Option, #[doc = "The azure resource properties"] #[serde(rename = "resourceProperties", default, skip_serializing_if = "Option::is_none")] - pub resource_properties: Option, + pub resource_properties: Option, } impl AzureResource { pub fn new(target_service_base: TargetServiceBase) -> Self { @@ -113,6 +127,11 @@ impl AzureResourcePropertiesBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AzureResourcePropertiesBaseUnion { + KeyVault(AzureKeyVaultProperties), +} #[doc = "The azure resource type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AzureResourceType")] @@ -328,10 +347,10 @@ impl LinkerPatch { pub struct LinkerProperties { #[doc = "The target service properties"] #[serde(rename = "targetService", default, skip_serializing_if = "Option::is_none")] - pub target_service: Option, + pub target_service: Option, #[doc = "The authentication info"] #[serde(rename = "authInfo", default, skip_serializing_if = "Option::is_none")] - pub auth_info: Option, + pub auth_info: Option, #[doc = "The application client type"] #[serde(rename = "clientType", default, skip_serializing_if = "Option::is_none")] pub client_type: Option, @@ -628,7 +647,7 @@ pub struct SecretAuthInfo { pub name: Option, #[doc = "The secret info"] #[serde(rename = "secretInfo", default, skip_serializing_if = "Option::is_none")] - pub secret_info: Option, + pub secret_info: Option, } impl SecretAuthInfo { pub fn new(auth_info_base: AuthInfoBase) -> Self { @@ -651,6 +670,16 @@ impl SecretInfoBase { Self { secret_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "secretType")] +pub enum SecretInfoBaseUnion { + #[serde(rename = "keyVaultSecretReference")] + KeyVaultSecretReference(KeyVaultSecretReferenceSecretInfo), + #[serde(rename = "keyVaultSecretUri")] + KeyVaultSecretUri(KeyVaultSecretUriSecretInfo), + #[serde(rename = "rawValue")] + RawValue(ValueSecretInfo), +} #[doc = "An option to store secret value in secure place"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretStore { @@ -807,6 +836,13 @@ impl TargetServiceBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TargetServiceBaseUnion { + AzureResource(AzureResource), + ConfluentBootstrapServer(ConfluentBootstrapServer), + ConfluentSchemaRegistry(ConfluentSchemaRegistry), +} #[doc = "The target service type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "TargetServiceType")] diff --git a/services/mgmt/servicelinker/src/package_2022_05_01/models.rs b/services/mgmt/servicelinker/src/package_2022_05_01/models.rs index 132d2a4905..4977bf48e8 100644 --- a/services/mgmt/servicelinker/src/package_2022_05_01/models.rs +++ b/services/mgmt/servicelinker/src/package_2022_05_01/models.rs @@ -15,6 +15,20 @@ impl AuthInfoBase { Self { auth_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum AuthInfoBaseUnion { + #[serde(rename = "secret")] + Secret(SecretAuthInfo), + #[serde(rename = "servicePrincipalCertificate")] + ServicePrincipalCertificate(ServicePrincipalCertificateAuthInfo), + #[serde(rename = "servicePrincipalSecret")] + ServicePrincipalSecret(ServicePrincipalSecretAuthInfo), + #[serde(rename = "systemAssignedIdentity")] + SystemAssignedIdentity(SystemAssignedIdentityAuthInfo), + #[serde(rename = "userAssignedIdentity")] + UserAssignedIdentity(UserAssignedIdentityAuthInfo), +} #[doc = "The authentication type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AuthType")] @@ -90,7 +104,7 @@ pub struct AzureResource { pub id: Option, #[doc = "The azure resource properties"] #[serde(rename = "resourceProperties", default, skip_serializing_if = "Option::is_none")] - pub resource_properties: Option, + pub resource_properties: Option, } impl AzureResource { pub fn new(target_service_base: TargetServiceBase) -> Self { @@ -113,6 +127,11 @@ impl AzureResourcePropertiesBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AzureResourcePropertiesBaseUnion { + KeyVault(AzureKeyVaultProperties), +} #[doc = "The azure resource type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AzureResourceType")] @@ -328,10 +347,10 @@ impl LinkerPatch { pub struct LinkerProperties { #[doc = "The target service properties"] #[serde(rename = "targetService", default, skip_serializing_if = "Option::is_none")] - pub target_service: Option, + pub target_service: Option, #[doc = "The authentication info"] #[serde(rename = "authInfo", default, skip_serializing_if = "Option::is_none")] - pub auth_info: Option, + pub auth_info: Option, #[doc = "The application client type"] #[serde(rename = "clientType", default, skip_serializing_if = "Option::is_none")] pub client_type: Option, @@ -631,7 +650,7 @@ pub struct SecretAuthInfo { pub name: Option, #[doc = "The secret info"] #[serde(rename = "secretInfo", default, skip_serializing_if = "Option::is_none")] - pub secret_info: Option, + pub secret_info: Option, } impl SecretAuthInfo { pub fn new(auth_info_base: AuthInfoBase) -> Self { @@ -654,6 +673,16 @@ impl SecretInfoBase { Self { secret_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "secretType")] +pub enum SecretInfoBaseUnion { + #[serde(rename = "keyVaultSecretReference")] + KeyVaultSecretReference(KeyVaultSecretReferenceSecretInfo), + #[serde(rename = "keyVaultSecretUri")] + KeyVaultSecretUri(KeyVaultSecretUriSecretInfo), + #[serde(rename = "rawValue")] + RawValue(ValueSecretInfo), +} #[doc = "An option to store secret value in secure place"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretStore { @@ -810,6 +839,13 @@ impl TargetServiceBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TargetServiceBaseUnion { + AzureResource(AzureResource), + ConfluentBootstrapServer(ConfluentBootstrapServer), + ConfluentSchemaRegistry(ConfluentSchemaRegistry), +} #[doc = "The target service type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "TargetServiceType")] diff --git a/services/mgmt/servicelinker/src/package_2022_11_01_preview/models.rs b/services/mgmt/servicelinker/src/package_2022_11_01_preview/models.rs index 29576fba08..9cbd4f7d64 100644 --- a/services/mgmt/servicelinker/src/package_2022_11_01_preview/models.rs +++ b/services/mgmt/servicelinker/src/package_2022_11_01_preview/models.rs @@ -114,6 +114,24 @@ impl AuthInfoBase { Self { auth_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authType")] +pub enum AuthInfoBaseUnion { + #[serde(rename = "accessKey")] + AccessKey(AccessKeyInfoBase), + #[serde(rename = "secret")] + Secret(SecretAuthInfo), + #[serde(rename = "servicePrincipalCertificate")] + ServicePrincipalCertificate(ServicePrincipalCertificateAuthInfo), + #[serde(rename = "servicePrincipalSecret")] + ServicePrincipalSecret(ServicePrincipalSecretAuthInfo), + #[serde(rename = "systemAssignedIdentity")] + SystemAssignedIdentity(SystemAssignedIdentityAuthInfo), + #[serde(rename = "userAccount")] + UserAccount(UserAccountAuthInfo), + #[serde(rename = "userAssignedIdentity")] + UserAssignedIdentity(UserAssignedIdentityAuthInfo), +} #[doc = "The authentication type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AuthType")] @@ -195,7 +213,7 @@ pub struct AzureResource { pub id: Option, #[doc = "The azure resource properties"] #[serde(rename = "resourceProperties", default, skip_serializing_if = "Option::is_none")] - pub resource_properties: Option, + pub resource_properties: Option, } impl AzureResource { pub fn new(target_service_base: TargetServiceBase) -> Self { @@ -218,6 +236,11 @@ impl AzureResourcePropertiesBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AzureResourcePropertiesBaseUnion { + KeyVault(AzureKeyVaultProperties), +} #[doc = "The azure resource type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AzureResourceType")] @@ -755,6 +778,12 @@ impl DryrunParameters { Self { action_name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "actionName")] +pub enum DryrunParametersUnion { + #[serde(rename = "createOrUpdate")] + CreateOrUpdate(CreateOrUpdateDryrunParameters), +} #[doc = "a dryrun job to be updated."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DryrunPatch { @@ -779,6 +808,14 @@ impl DryrunPrerequisiteResult { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DryrunPrerequisiteResultUnion { + #[serde(rename = "basicError")] + BasicError(BasicErrorDryrunPrerequisiteResult), + #[serde(rename = "permissionsMissing")] + PermissionsMissing(PermissionsMissingDryrunPrerequisiteResult), +} #[doc = "The type of dryrun result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DryrunPrerequisiteResultType")] @@ -823,7 +860,7 @@ impl Serialize for DryrunPrerequisiteResultType { pub struct DryrunProperties { #[doc = "The parameters of the dryrun"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, + pub parameters: Option, #[doc = "the result of the dryrun"] #[serde( rename = "prerequisiteResults", @@ -831,7 +868,7 @@ pub struct DryrunProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub prerequisite_results: Vec, + pub prerequisite_results: Vec, #[doc = "the preview of the operations for creation"] #[serde( rename = "operationPreviews", @@ -1007,10 +1044,10 @@ impl LinkerPatch { pub struct LinkerProperties { #[doc = "The target service properties"] #[serde(rename = "targetService", default, skip_serializing_if = "Option::is_none")] - pub target_service: Option, + pub target_service: Option, #[doc = "The authentication info"] #[serde(rename = "authInfo", default, skip_serializing_if = "Option::is_none")] - pub auth_info: Option, + pub auth_info: Option, #[doc = "The application client type"] #[serde(rename = "clientType", default, skip_serializing_if = "Option::is_none")] pub client_type: Option, @@ -1322,7 +1359,7 @@ pub struct SecretAuthInfo { pub name: Option, #[doc = "The secret info"] #[serde(rename = "secretInfo", default, skip_serializing_if = "Option::is_none")] - pub secret_info: Option, + pub secret_info: Option, } impl SecretAuthInfo { pub fn new(auth_info_base: AuthInfoBase) -> Self { @@ -1345,6 +1382,16 @@ impl SecretInfoBase { Self { secret_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "secretType")] +pub enum SecretInfoBaseUnion { + #[serde(rename = "keyVaultSecretReference")] + KeyVaultSecretReference(KeyVaultSecretReferenceSecretInfo), + #[serde(rename = "keyVaultSecretUri")] + KeyVaultSecretUri(KeyVaultSecretUriSecretInfo), + #[serde(rename = "rawValue")] + RawValue(ValueSecretInfo), +} #[doc = "An option to store secret value in secure place"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretStore { @@ -1549,6 +1596,14 @@ impl TargetServiceBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum TargetServiceBaseUnion { + AzureResource(AzureResource), + ConfluentBootstrapServer(ConfluentBootstrapServer), + ConfluentSchemaRegistry(ConfluentSchemaRegistry), + SelfHostedServer(SelfHostedServer), +} #[doc = "The target service type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "TargetServiceType")] diff --git a/services/mgmt/servicemap/src/package_2015_11_preview/mod.rs b/services/mgmt/servicemap/src/package_2015_11_preview/mod.rs index b3eb7d882d..025ba26c83 100644 --- a/services/mgmt/servicemap/src/package_2015_11_preview/mod.rs +++ b/services/mgmt/servicemap/src/package_2015_11_preview/mod.rs @@ -3043,7 +3043,7 @@ pub mod maps { subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - request: impl Into, + request: impl Into, ) -> generate::RequestBuilder { generate::RequestBuilder { client: self.0.clone(), @@ -3109,7 +3109,7 @@ pub mod maps { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) request: models::MapRequest, + pub(crate) request: models::MapRequestUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] diff --git a/services/mgmt/servicemap/src/package_2015_11_preview/models.rs b/services/mgmt/servicemap/src/package_2015_11_preview/models.rs index 837b2bf549..e810789f5b 100644 --- a/services/mgmt/servicemap/src/package_2015_11_preview/models.rs +++ b/services/mgmt/servicemap/src/package_2015_11_preview/models.rs @@ -273,10 +273,10 @@ pub mod client_group { pub struct Properties { #[doc = "Represents a reference to another resource."] #[serde(rename = "clientsOf")] - pub clients_of: ResourceReference, + pub clients_of: ResourceReferenceUnion, } impl Properties { - pub fn new(clients_of: ResourceReference) -> Self { + pub fn new(clients_of: ResourceReferenceUnion) -> Self { Self { clients_of } } } @@ -494,6 +494,20 @@ pub mod core_resource { MachineGroup, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum CoreResourceUnion { + #[serde(rename = "clientGroup")] + ClientGroup(ClientGroup), + #[serde(rename = "machine")] + Machine(Machine), + #[serde(rename = "machineGroup")] + MachineGroup(MachineGroup), + #[serde(rename = "port")] + Port(Port), + #[serde(rename = "process")] + Process(Process), +} #[doc = "Error details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Error { @@ -554,6 +568,12 @@ pub mod hosting_configuration { ProviderAzure, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum HostingConfigurationUnion { + #[serde(rename = "provider:azure")] + ProviderAzure(AzureHostingConfiguration), +} #[doc = "Describes the hypervisor configuration of a machine."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HypervisorConfiguration { @@ -715,7 +735,7 @@ pub mod machine { pub hypervisor: Option, #[doc = "Describes the hosting configuration of a machine."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub hosting: Option, + pub hosting: Option, } impl Properties { pub fn new() -> Self { @@ -1146,6 +1166,12 @@ pub mod map_request { MapMachineListDependency, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum MapRequestUnion { + #[serde(rename = "map:single-machine-dependency")] + MapSingleMachineDependency(SingleMachineDependencyMapRequest), +} #[doc = "Specified the contents of a map response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MapResponse { @@ -1298,7 +1324,7 @@ pub mod port { pub monitoring_state: Option, #[doc = "Represents a reference to another resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub machine: Option, + pub machine: Option, #[doc = "Name to use for display purposes."] #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] pub display_name: Option, @@ -1408,7 +1434,7 @@ pub mod process { pub monitoring_state: Option, #[doc = "Represents a reference to another resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub machine: Option, + pub machine: Option, #[doc = "The name of the process executable"] #[serde(rename = "executableName", default, skip_serializing_if = "Option::is_none")] pub executable_name: Option, @@ -1432,13 +1458,13 @@ pub mod process { pub user: Option, #[doc = "Represents a reference to another resource."] #[serde(rename = "clientOf", default, skip_serializing_if = "Option::is_none")] - pub client_of: Option, + pub client_of: Option, #[doc = "Represents a reference to another resource."] #[serde(rename = "acceptorOf", default, skip_serializing_if = "Option::is_none")] - pub acceptor_of: Option, + pub acceptor_of: Option, #[doc = "Describes the hosting configuration of a process."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub hosting: Option, + pub hosting: Option, } impl Properties { pub fn new() -> Self { @@ -1621,6 +1647,12 @@ pub mod process_hosting_configuration { ProviderAzure, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ProcessHostingConfigurationUnion { + #[serde(rename = "provider:azure")] + ProviderAzure(AzureProcessHostingConfiguration), +} #[doc = "Reference to a process."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProcessReference { @@ -1695,13 +1727,21 @@ pub mod relationship { RelAcceptor, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum RelationshipUnion { + #[serde(rename = "rel:acceptor")] + RelAcceptor(Acceptor), + #[serde(rename = "rel:connection")] + RelConnection(Connection), +} #[doc = "Relationship properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RelationshipProperties { #[doc = "Represents a reference to another resource."] - pub source: ResourceReference, + pub source: ResourceReferenceUnion, #[doc = "Represents a reference to another resource."] - pub destination: ResourceReference, + pub destination: ResourceReferenceUnion, #[doc = "Relationship start time."] #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] pub start_time: Option, @@ -1710,7 +1750,7 @@ pub struct RelationshipProperties { pub end_time: Option, } impl RelationshipProperties { - pub fn new(source: ResourceReference, destination: ResourceReference) -> Self { + pub fn new(source: ResourceReferenceUnion, destination: ResourceReferenceUnion) -> Self { Self { source, destination, @@ -1780,6 +1820,20 @@ pub mod resource_reference { RefClientgroup, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ResourceReferenceUnion { + #[serde(rename = "ref:clientgroup")] + RefClientgroup(ClientGroupReference), + #[serde(rename = "ref:machine")] + RefMachine(MachineReference), + #[serde(rename = "ref:machinewithhints")] + RefMachinewithhints(MachineReferenceWithHints), + #[serde(rename = "ref:port")] + RefPort(PortReference), + #[serde(rename = "ref:process")] + RefProcess(ProcessReference), +} #[doc = "Specifies the computation of a single server dependency map. A single server dependency map includes all direct dependencies of a given machine."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SingleMachineDependencyMapRequest { diff --git a/services/mgmt/storagemover/src/package_2022_07_01_preview/models.rs b/services/mgmt/storagemover/src/package_2022_07_01_preview/models.rs index 95f9d0934a..ed6ae5fcef 100644 --- a/services/mgmt/storagemover/src/package_2022_07_01_preview/models.rs +++ b/services/mgmt/storagemover/src/package_2022_07_01_preview/models.rs @@ -257,13 +257,13 @@ pub struct Endpoint { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "The resource specific properties for the Storage Mover resource."] - pub properties: EndpointBaseProperties, + pub properties: EndpointBasePropertiesUnion, #[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 Endpoint { - pub fn new(properties: EndpointBaseProperties) -> Self { + pub fn new(properties: EndpointBasePropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -368,6 +368,12 @@ pub mod endpoint_base_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum EndpointBasePropertiesUnion { + AzureStorageBlobContainer(AzureStorageBlobContainerEndpointProperties), + NfsMount(NfsMountEndpointProperties), +} #[doc = "The Endpoint resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointBaseUpdateParameters { diff --git a/services/mgmt/storagemover/src/package_2023_03/models.rs b/services/mgmt/storagemover/src/package_2023_03/models.rs index 95f9d0934a..ed6ae5fcef 100644 --- a/services/mgmt/storagemover/src/package_2023_03/models.rs +++ b/services/mgmt/storagemover/src/package_2023_03/models.rs @@ -257,13 +257,13 @@ pub struct Endpoint { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "The resource specific properties for the Storage Mover resource."] - pub properties: EndpointBaseProperties, + pub properties: EndpointBasePropertiesUnion, #[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 Endpoint { - pub fn new(properties: EndpointBaseProperties) -> Self { + pub fn new(properties: EndpointBasePropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -368,6 +368,12 @@ pub mod endpoint_base_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum EndpointBasePropertiesUnion { + AzureStorageBlobContainer(AzureStorageBlobContainerEndpointProperties), + NfsMount(NfsMountEndpointProperties), +} #[doc = "The Endpoint resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointBaseUpdateParameters { diff --git a/services/mgmt/storagemover/src/package_preview_2023_07/models.rs b/services/mgmt/storagemover/src/package_preview_2023_07/models.rs index 78e869a252..0a8aee385e 100644 --- a/services/mgmt/storagemover/src/package_preview_2023_07/models.rs +++ b/services/mgmt/storagemover/src/package_preview_2023_07/models.rs @@ -356,19 +356,24 @@ impl Credentials { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CredentialsUnion { + AzureKeyVaultSmb(AzureKeyVaultSmbCredentials), +} #[doc = "The Endpoint resource, which contains information about file sources and targets."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Endpoint { #[serde(flatten)] pub proxy_resource: ProxyResource, #[doc = "The resource specific properties for the Storage Mover resource."] - pub properties: EndpointBaseProperties, + pub properties: EndpointBasePropertiesUnion, #[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 Endpoint { - pub fn new(properties: EndpointBaseProperties) -> Self { + pub fn new(properties: EndpointBasePropertiesUnion) -> Self { Self { proxy_resource: ProxyResource::default(), properties, @@ -436,12 +441,20 @@ pub mod endpoint_base_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum EndpointBasePropertiesUnion { + AzureStorageBlobContainer(AzureStorageBlobContainerEndpointProperties), + AzureStorageSmbFileShare(AzureStorageSmbFileShareEndpointProperties), + NfsMount(NfsMountEndpointProperties), + SmbMount(SmbMountEndpointProperties), +} #[doc = "The Endpoint resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointBaseUpdateParameters { #[doc = "The Endpoint resource, which contains information about file sources and targets."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl EndpointBaseUpdateParameters { pub fn new() -> Self { @@ -466,6 +479,14 @@ impl EndpointBaseUpdateProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointType")] +pub enum EndpointBaseUpdatePropertiesUnion { + AzureStorageBlobContainer(AzureStorageBlobContainerEndpointUpdateProperties), + AzureStorageSmbFileShare(AzureStorageSmbFileShareEndpointUpdateProperties), + NfsMount(NfsMountEndpointUpdateProperties), + SmbMount(SmbMountEndpointUpdateProperties), +} #[doc = "List of Endpoints."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointList { diff --git a/services/mgmt/streamanalytics/src/package_2021_10_preview/mod.rs b/services/mgmt/streamanalytics/src/package_2021_10_preview/mod.rs index 8e12c64305..f1187611db 100644 --- a/services/mgmt/streamanalytics/src/package_2021_10_preview/mod.rs +++ b/services/mgmt/streamanalytics/src/package_2021_10_preview/mod.rs @@ -1129,13 +1129,13 @@ pub mod functions { pub(crate) resource_group_name: String, pub(crate) job_name: String, pub(crate) function_name: String, - pub(crate) function_retrieve_default_definition_parameters: Option, + pub(crate) function_retrieve_default_definition_parameters: Option, } impl RequestBuilder { #[doc = "Parameters used to specify the type of function to retrieve the default definition for."] pub fn function_retrieve_default_definition_parameters( mut self, - function_retrieve_default_definition_parameters: impl Into, + function_retrieve_default_definition_parameters: impl Into, ) -> Self { self.function_retrieve_default_definition_parameters = Some(function_retrieve_default_definition_parameters.into()); self diff --git a/services/mgmt/streamanalytics/src/package_2021_10_preview/models.rs b/services/mgmt/streamanalytics/src/package_2021_10_preview/models.rs index 81f33a0b97..9cf2702854 100644 --- a/services/mgmt/streamanalytics/src/package_2021_10_preview/models.rs +++ b/services/mgmt/streamanalytics/src/package_2021_10_preview/models.rs @@ -1990,7 +1990,7 @@ pub struct Function { pub sub_resource: SubResource, #[doc = "The properties that are associated with a function."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Function { pub fn new() -> Self { @@ -2009,6 +2009,18 @@ impl FunctionBinding { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FunctionBindingUnion { + #[serde(rename = "Microsoft.MachineLearningServices")] + MicrosoftMachineLearningServices(AzureMachineLearningServiceFunctionBinding), + #[serde(rename = "Microsoft.MachineLearning/WebService")] + MicrosoftMachineLearningWebService(AzureMachineLearningStudioFunctionBinding), + #[serde(rename = "Microsoft.StreamAnalytics/CLRUdf")] + MicrosoftStreamAnalyticsClrUdf(CSharpFunctionBinding), + #[serde(rename = "Microsoft.StreamAnalytics/JavascriptUdf")] + MicrosoftStreamAnalyticsJavascriptUdf(JavaScriptFunctionBinding), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FunctionConfiguration { #[serde( @@ -2022,7 +2034,7 @@ pub struct FunctionConfiguration { pub output: Option, #[doc = "The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub binding: Option, + pub binding: Option, } impl FunctionConfiguration { pub fn new() -> Self { @@ -2102,6 +2114,12 @@ impl FunctionProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FunctionPropertiesUnion { + Aggregate(AggregateFunctionProperties), + Scalar(ScalarFunctionProperties), +} #[doc = "Parameters used to specify the type of function to retrieve the default definition for."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FunctionRetrieveDefaultDefinitionParameters { @@ -2114,6 +2132,18 @@ impl FunctionRetrieveDefaultDefinitionParameters { Self { binding_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "bindingType")] +pub enum FunctionRetrieveDefaultDefinitionParametersUnion { + #[serde(rename = "Microsoft.MachineLearningServices")] + MicrosoftMachineLearningServices(AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters), + #[serde(rename = "Microsoft.MachineLearning/WebService")] + MicrosoftMachineLearningWebService(AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters), + #[serde(rename = "Microsoft.StreamAnalytics/CLRUdf")] + MicrosoftStreamAnalyticsClrUdf(CSharpFunctionRetrieveDefaultDefinitionParameters), + #[serde(rename = "Microsoft.StreamAnalytics/JavascriptUdf")] + MicrosoftStreamAnalyticsJavascriptUdf(JavaScriptFunctionRetrieveDefaultDefinitionParameters), +} #[doc = "Describes a Gateway Message Bus output data source."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GatewayMessageBusOutputDataSource { @@ -2344,7 +2374,7 @@ pub struct Input { pub sub_resource: SubResource, #[doc = "The properties that are associated with an input."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Input { pub fn new() -> Self { @@ -2384,7 +2414,7 @@ pub struct InputProperties { pub type_: String, #[doc = "Describes how data from an input is serialized or how data is serialized when written to an output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub serialization: Option, + pub serialization: Option, #[doc = "Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention."] #[serde(default, skip_serializing_if = "Option::is_none")] pub diagnostics: Option, @@ -2414,6 +2444,12 @@ impl InputProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum InputPropertiesUnion { + Reference(ReferenceInputProperties), + Stream(StreamInputProperties), +} #[doc = "The input watermark mode."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "InputWatermarkMode")] @@ -2827,6 +2863,40 @@ impl OutputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum OutputDataSourceUnion { + #[serde(rename = "Microsoft.Kusto/clusters/databases")] + MicrosoftKustoClustersDatabases(AzureDataExplorerOutputDataSource), + #[serde(rename = "Microsoft.DataLake/Accounts")] + MicrosoftDataLakeAccounts(AzureDataLakeStoreOutputDataSource), + #[serde(rename = "Microsoft.AzureFunction")] + MicrosoftAzureFunction(AzureFunctionOutputDataSource), + #[serde(rename = "Microsoft.Sql/Server/Database")] + MicrosoftSqlServerDatabase(AzureSqlDatabaseOutputDataSource), + #[serde(rename = "Microsoft.Sql/Server/DataWarehouse")] + MicrosoftSqlServerDataWarehouse(AzureSynapseOutputDataSource), + #[serde(rename = "Microsoft.Storage/Table")] + MicrosoftStorageTable(AzureTableOutputDataSource), + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobOutputDataSource), + #[serde(rename = "Microsoft.Storage/DocumentDB")] + MicrosoftStorageDocumentDb(DocumentDbOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/EventHub")] + MicrosoftServiceBusEventHub(EventHubOutputDataSource), + #[serde(rename = "Microsoft.EventHub/EventHub")] + MicrosoftEventHubEventHub(EventHubV2OutputDataSource), + GatewayMessageBus(GatewayMessageBusOutputDataSource), + #[serde(rename = "Microsoft.DBForPostgreSQL/servers/databases")] + MicrosoftDbForPostgreSqlServersDatabases(PostgreSqlOutputDataSource), + #[serde(rename = "PowerBI")] + PowerBi(PowerBiOutputDataSource), + Raw(RawOutputDatasource), + #[serde(rename = "Microsoft.ServiceBus/Queue")] + MicrosoftServiceBusQueue(ServiceBusQueueOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/Topic")] + MicrosoftServiceBusTopic(ServiceBusTopicOutputDataSource), +} #[doc = "Indicates the policy to apply to events that arrive at the output and cannot be written to the external storage due to being malformed (missing column values, column values of wrong type or size)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "OutputErrorPolicy")] @@ -2894,7 +2964,7 @@ impl OutputListResult { pub struct OutputProperties { #[doc = "Describes the data source that output will be written to."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, #[doc = "The time frame for filtering Stream Analytics job outputs."] #[serde(rename = "timeWindow", default, skip_serializing_if = "Option::is_none")] pub time_window: Option, @@ -2903,7 +2973,7 @@ pub struct OutputProperties { pub size_window: Option, #[doc = "Describes how data from an input is serialized or how data is serialized when written to an output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub serialization: Option, + pub serialization: Option, #[doc = "Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention."] #[serde(default, skip_serializing_if = "Option::is_none")] pub diagnostics: Option, @@ -3547,6 +3617,16 @@ impl ReferenceInputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ReferenceInputDataSourceUnion { + #[serde(rename = "Microsoft.Sql/Server/Database")] + MicrosoftSqlServerDatabase(AzureSqlReferenceInputDataSource), + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobReferenceInputDataSource), + File(FileReferenceInputDataSource), + Raw(RawReferenceInputDataSource), +} #[doc = "The properties that are associated with an input containing reference data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReferenceInputProperties { @@ -3554,7 +3634,7 @@ pub struct ReferenceInputProperties { pub input_properties: InputProperties, #[doc = "Describes an input data source that contains reference data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, } impl ReferenceInputProperties { pub fn new(input_properties: InputProperties) -> Self { @@ -3782,6 +3862,16 @@ impl Serialization { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SerializationUnion { + Avro(AvroSerialization), + Csv(CsvSerialization), + CustomClr(CustomClrSerialization), + Delta(DeltaSerialization), + Json(JsonSerialization), + Parquet(ParquetSerialization), +} #[doc = "The common properties that are associated with Service Bus data sources (Queues, Topics, Event Hubs, etc.)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceBusDataSourceProperties { @@ -4059,6 +4149,22 @@ impl StreamInputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum StreamInputDataSourceUnion { + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobStreamInputDataSource), + #[serde(rename = "Microsoft.EventGrid/EventSubscriptions")] + MicrosoftEventGridEventSubscriptions(EventGridStreamInputDataSource), + #[serde(rename = "Microsoft.ServiceBus/EventHub")] + MicrosoftServiceBusEventHub(EventHubStreamInputDataSource), + #[serde(rename = "Microsoft.EventHub/EventHub")] + MicrosoftEventHubEventHub(EventHubV2StreamInputDataSource), + GatewayMessageBus(GatewayMessageBusStreamInputDataSource), + #[serde(rename = "Microsoft.Devices/IotHubs")] + MicrosoftDevicesIotHubs(IoTHubStreamInputDataSource), + Raw(RawStreamInputDataSource), +} #[doc = "The properties that are associated with an input containing stream data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StreamInputProperties { @@ -4066,7 +4172,7 @@ pub struct StreamInputProperties { pub input_properties: InputProperties, #[doc = "Describes an input data source that contains stream data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, } impl StreamInputProperties { pub fn new(input_properties: InputProperties) -> Self { diff --git a/services/mgmt/streamanalytics/src/package_pure_2016_03/mod.rs b/services/mgmt/streamanalytics/src/package_pure_2016_03/mod.rs index a1b8f56672..250f9d3cd0 100644 --- a/services/mgmt/streamanalytics/src/package_pure_2016_03/mod.rs +++ b/services/mgmt/streamanalytics/src/package_pure_2016_03/mod.rs @@ -4694,13 +4694,13 @@ pub mod functions { pub(crate) resource_group_name: String, pub(crate) job_name: String, pub(crate) function_name: String, - pub(crate) function_retrieve_default_definition_parameters: Option, + pub(crate) function_retrieve_default_definition_parameters: Option, } impl RequestBuilder { #[doc = "Parameters used to specify the type of function to retrieve the default definition for."] pub fn function_retrieve_default_definition_parameters( mut self, - function_retrieve_default_definition_parameters: impl Into, + function_retrieve_default_definition_parameters: impl Into, ) -> Self { self.function_retrieve_default_definition_parameters = Some(function_retrieve_default_definition_parameters.into()); self diff --git a/services/mgmt/streamanalytics/src/package_pure_2016_03/models.rs b/services/mgmt/streamanalytics/src/package_pure_2016_03/models.rs index 6c27d8c5d9..5b251b87cd 100644 --- a/services/mgmt/streamanalytics/src/package_pure_2016_03/models.rs +++ b/services/mgmt/streamanalytics/src/package_pure_2016_03/models.rs @@ -841,7 +841,7 @@ pub struct Function { pub sub_resource: SubResource, #[doc = "The properties that are associated with a function."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Function { pub fn new() -> Self { @@ -860,6 +860,14 @@ impl FunctionBinding { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FunctionBindingUnion { + #[serde(rename = "Microsoft.MachineLearning/WebService")] + MicrosoftMachineLearningWebService(AzureMachineLearningWebServiceFunctionBinding), + #[serde(rename = "Microsoft.StreamAnalytics/JavascriptUdf")] + MicrosoftStreamAnalyticsJavascriptUdf(JavaScriptFunctionBinding), +} #[doc = "Describes one input parameter of a function."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FunctionInput { @@ -927,6 +935,11 @@ impl FunctionProperties { Self { type_, etag: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FunctionPropertiesUnion { + Scalar(ScalarFunctionProperties), +} #[doc = "Parameters used to specify the type of function to retrieve the default definition for."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FunctionRetrieveDefaultDefinitionParameters { @@ -939,6 +952,14 @@ impl FunctionRetrieveDefaultDefinitionParameters { Self { binding_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "bindingType")] +pub enum FunctionRetrieveDefaultDefinitionParametersUnion { + #[serde(rename = "Microsoft.MachineLearning/WebService")] + MicrosoftMachineLearningWebService(AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters), + #[serde(rename = "Microsoft.StreamAnalytics/JavascriptUdf")] + MicrosoftStreamAnalyticsJavascriptUdf(JavaScriptFunctionRetrieveDefaultDefinitionParameters), +} #[doc = "An input object, containing all information associated with the named input. All inputs are contained under a streaming job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Input { @@ -946,7 +967,7 @@ pub struct Input { pub sub_resource: SubResource, #[doc = "The properties that are associated with an input."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Input { pub fn new() -> Self { @@ -986,7 +1007,7 @@ pub struct InputProperties { pub type_: String, #[doc = "Describes how data from an input is serialized or how data is serialized when written to an output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub serialization: Option, + pub serialization: Option, #[doc = "Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention."] #[serde(default, skip_serializing_if = "Option::is_none")] pub diagnostics: Option, @@ -1004,6 +1025,12 @@ impl InputProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum InputPropertiesUnion { + Reference(ReferenceInputProperties), + Stream(StreamInputProperties), +} #[doc = "Describes an IoT Hub input data source that contains stream data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IoTHubStreamInputDataSource { @@ -1283,6 +1310,28 @@ impl OutputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum OutputDataSourceUnion { + #[serde(rename = "Microsoft.DataLake/Accounts")] + MicrosoftDataLakeAccounts(AzureDataLakeStoreOutputDataSource), + #[serde(rename = "Microsoft.Sql/Server/Database")] + MicrosoftSqlServerDatabase(AzureSqlDatabaseOutputDataSource), + #[serde(rename = "Microsoft.Storage/Table")] + MicrosoftStorageTable(AzureTableOutputDataSource), + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobOutputDataSource), + #[serde(rename = "Microsoft.Storage/DocumentDB")] + MicrosoftStorageDocumentDb(DocumentDbOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/EventHub")] + MicrosoftServiceBusEventHub(EventHubOutputDataSource), + #[serde(rename = "PowerBI")] + PowerBi(PowerBiOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/Queue")] + MicrosoftServiceBusQueue(ServiceBusQueueOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/Topic")] + MicrosoftServiceBusTopic(ServiceBusTopicOutputDataSource), +} #[doc = "Indicates the policy to apply to events that arrive at the output and cannot be written to the external storage due to being malformed (missing column values, column values of wrong type or size)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "OutputErrorPolicy")] @@ -1350,10 +1399,10 @@ impl OutputListResult { pub struct OutputProperties { #[doc = "Describes the data source that output will be written to."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, #[doc = "Describes how data from an input is serialized or how data is serialized when written to an output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub serialization: Option, + pub serialization: Option, #[doc = "Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention."] #[serde(default, skip_serializing_if = "Option::is_none")] pub diagnostics: Option, @@ -1468,6 +1517,12 @@ impl ReferenceInputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ReferenceInputDataSourceUnion { + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobReferenceInputDataSource), +} #[doc = "The properties that are associated with an input containing reference data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReferenceInputProperties { @@ -1475,7 +1530,7 @@ pub struct ReferenceInputProperties { pub input_properties: InputProperties, #[doc = "Describes an input data source that contains reference data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, } impl ReferenceInputProperties { pub fn new(input_properties: InputProperties) -> Self { @@ -1533,7 +1588,7 @@ pub struct ScalarFunctionConfiguration { pub output: Option, #[doc = "The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub binding: Option, + pub binding: Option, } impl ScalarFunctionConfiguration { pub fn new() -> Self { @@ -1569,6 +1624,13 @@ impl Serialization { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SerializationUnion { + Avro(AvroSerialization), + Csv(CsvSerialization), + Json(JsonSerialization), +} #[doc = "The common properties that are associated with Service Bus data sources (Queues, Topics, Event Hubs, etc.)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceBusDataSourceProperties { @@ -1757,6 +1819,16 @@ impl StreamInputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum StreamInputDataSourceUnion { + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobStreamInputDataSource), + #[serde(rename = "Microsoft.ServiceBus/EventHub")] + MicrosoftServiceBusEventHub(EventHubStreamInputDataSource), + #[serde(rename = "Microsoft.Devices/IotHubs")] + MicrosoftDevicesIotHubs(IoTHubStreamInputDataSource), +} #[doc = "The properties that are associated with an input containing stream data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StreamInputProperties { @@ -1764,7 +1836,7 @@ pub struct StreamInputProperties { pub input_properties: InputProperties, #[doc = "Describes an input data source that contains stream data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, } impl StreamInputProperties { pub fn new(input_properties: InputProperties) -> Self { diff --git a/services/mgmt/streamanalytics/src/package_pure_2017_04_preview/mod.rs b/services/mgmt/streamanalytics/src/package_pure_2017_04_preview/mod.rs index 7782288e78..b65718702d 100644 --- a/services/mgmt/streamanalytics/src/package_pure_2017_04_preview/mod.rs +++ b/services/mgmt/streamanalytics/src/package_pure_2017_04_preview/mod.rs @@ -1120,13 +1120,13 @@ pub mod functions { pub(crate) resource_group_name: String, pub(crate) job_name: String, pub(crate) function_name: String, - pub(crate) function_retrieve_default_definition_parameters: Option, + pub(crate) function_retrieve_default_definition_parameters: Option, } impl RequestBuilder { #[doc = "Parameters used to specify the type of function to retrieve the default definition for."] pub fn function_retrieve_default_definition_parameters( mut self, - function_retrieve_default_definition_parameters: impl Into, + function_retrieve_default_definition_parameters: impl Into, ) -> Self { self.function_retrieve_default_definition_parameters = Some(function_retrieve_default_definition_parameters.into()); self diff --git a/services/mgmt/streamanalytics/src/package_pure_2017_04_preview/models.rs b/services/mgmt/streamanalytics/src/package_pure_2017_04_preview/models.rs index 7ac7f603e1..c7847c2833 100644 --- a/services/mgmt/streamanalytics/src/package_pure_2017_04_preview/models.rs +++ b/services/mgmt/streamanalytics/src/package_pure_2017_04_preview/models.rs @@ -1502,7 +1502,7 @@ pub struct Function { pub sub_resource: SubResource, #[doc = "The properties that are associated with a function."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Function { pub fn new() -> Self { @@ -1521,6 +1521,18 @@ impl FunctionBinding { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FunctionBindingUnion { + #[serde(rename = "Microsoft.MachineLearningServices")] + MicrosoftMachineLearningServices(AzureMachineLearningServiceFunctionBinding), + #[serde(rename = "Microsoft.MachineLearning/WebService")] + MicrosoftMachineLearningWebService(AzureMachineLearningStudioFunctionBinding), + #[serde(rename = "Microsoft.StreamAnalytics/CLRUdf")] + MicrosoftStreamAnalyticsClrUdf(CSharpFunctionBinding), + #[serde(rename = "Microsoft.StreamAnalytics/JavascriptUdf")] + MicrosoftStreamAnalyticsJavascriptUdf(JavaScriptFunctionBinding), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FunctionConfiguration { #[serde( @@ -1534,7 +1546,7 @@ pub struct FunctionConfiguration { pub output: Option, #[doc = "The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub binding: Option, + pub binding: Option, } impl FunctionConfiguration { pub fn new() -> Self { @@ -1614,6 +1626,12 @@ impl FunctionProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FunctionPropertiesUnion { + Aggregate(AggregateFunctionProperties), + Scalar(ScalarFunctionProperties), +} #[doc = "Parameters used to specify the type of function to retrieve the default definition for."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FunctionRetrieveDefaultDefinitionParameters { @@ -1626,6 +1644,18 @@ impl FunctionRetrieveDefaultDefinitionParameters { Self { binding_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "bindingType")] +pub enum FunctionRetrieveDefaultDefinitionParametersUnion { + #[serde(rename = "Microsoft.MachineLearningServices")] + MicrosoftMachineLearningServices(AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters), + #[serde(rename = "Microsoft.MachineLearning/WebService")] + MicrosoftMachineLearningWebService(AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters), + #[serde(rename = "Microsoft.StreamAnalytics/CLRUdf")] + MicrosoftStreamAnalyticsClrUdf(CSharpFunctionRetrieveDefaultDefinitionParameters), + #[serde(rename = "Microsoft.StreamAnalytics/JavascriptUdf")] + MicrosoftStreamAnalyticsJavascriptUdf(JavaScriptFunctionRetrieveDefaultDefinitionParameters), +} #[doc = "Describes how identity is verified"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Identity { @@ -1648,7 +1678,7 @@ pub struct Input { pub sub_resource: SubResource, #[doc = "The properties that are associated with an input."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Input { pub fn new() -> Self { @@ -1688,7 +1718,7 @@ pub struct InputProperties { pub type_: String, #[doc = "Describes how data from an input is serialized or how data is serialized when written to an output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub serialization: Option, + pub serialization: Option, #[doc = "Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention."] #[serde(default, skip_serializing_if = "Option::is_none")] pub diagnostics: Option, @@ -1714,6 +1744,12 @@ impl InputProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum InputPropertiesUnion { + Reference(ReferenceInputProperties), + Stream(StreamInputProperties), +} #[doc = "Describes an IoT Hub input data source that contains stream data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IoTHubStreamInputDataSource { @@ -2007,6 +2043,35 @@ impl OutputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum OutputDataSourceUnion { + #[serde(rename = "Microsoft.DataLake/Accounts")] + MicrosoftDataLakeAccounts(AzureDataLakeStoreOutputDataSource), + #[serde(rename = "Microsoft.AzureFunction")] + MicrosoftAzureFunction(AzureFunctionOutputDataSource), + #[serde(rename = "Microsoft.Sql/Server/Database")] + MicrosoftSqlServerDatabase(AzureSqlDatabaseOutputDataSource), + #[serde(rename = "Microsoft.Sql/Server/DataWarehouse")] + MicrosoftSqlServerDataWarehouse(AzureSynapseOutputDataSource), + #[serde(rename = "Microsoft.Storage/Table")] + MicrosoftStorageTable(AzureTableOutputDataSource), + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobOutputDataSource), + #[serde(rename = "Microsoft.Storage/DocumentDB")] + MicrosoftStorageDocumentDb(DocumentDbOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/EventHub")] + MicrosoftServiceBusEventHub(EventHubOutputDataSource), + #[serde(rename = "Microsoft.EventHub/EventHub")] + MicrosoftEventHubEventHub(EventHubV2OutputDataSource), + #[serde(rename = "PowerBI")] + PowerBi(PowerBiOutputDataSource), + Raw(RawOutputDatasource), + #[serde(rename = "Microsoft.ServiceBus/Queue")] + MicrosoftServiceBusQueue(ServiceBusQueueOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/Topic")] + MicrosoftServiceBusTopic(ServiceBusTopicOutputDataSource), +} #[doc = "Indicates the policy to apply to events that arrive at the output and cannot be written to the external storage due to being malformed (missing column values, column values of wrong type or size)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "OutputErrorPolicy")] @@ -2074,7 +2139,7 @@ impl OutputListResult { pub struct OutputProperties { #[doc = "Describes the data source that output will be written to."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, #[serde(rename = "timeWindow", default, skip_serializing_if = "Option::is_none")] pub time_window: Option, #[doc = "The size window to constrain a Stream Analytics output to."] @@ -2082,7 +2147,7 @@ pub struct OutputProperties { pub size_window: Option, #[doc = "Describes how data from an input is serialized or how data is serialized when written to an output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub serialization: Option, + pub serialization: Option, #[doc = "Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention."] #[serde(default, skip_serializing_if = "Option::is_none")] pub diagnostics: Option, @@ -2466,6 +2531,15 @@ impl ReferenceInputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ReferenceInputDataSourceUnion { + #[serde(rename = "Microsoft.Sql/Server/Database")] + MicrosoftSqlServerDatabase(AzureSqlReferenceInputDataSource), + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobReferenceInputDataSource), + Raw(RawReferenceInputDataSource), +} #[doc = "The properties that are associated with an input containing reference data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReferenceInputProperties { @@ -2473,7 +2547,7 @@ pub struct ReferenceInputProperties { pub input_properties: InputProperties, #[doc = "Describes an input data source that contains reference data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, } impl ReferenceInputProperties { pub fn new(input_properties: InputProperties) -> Self { @@ -2626,6 +2700,16 @@ impl Serialization { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SerializationUnion { + Avro(AvroSerialization), + Csv(CsvSerialization), + CustomClr(CustomClrSerialization), + Delta(DeltaSerialization), + Json(JsonSerialization), + Parquet(ParquetSerialization), +} #[doc = "The common properties that are associated with Service Bus data sources (Queues, Topics, Event Hubs, etc.)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceBusDataSourceProperties { @@ -2771,6 +2855,19 @@ impl StreamInputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum StreamInputDataSourceUnion { + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobStreamInputDataSource), + #[serde(rename = "Microsoft.ServiceBus/EventHub")] + MicrosoftServiceBusEventHub(EventHubStreamInputDataSource), + #[serde(rename = "Microsoft.EventHub/EventHub")] + MicrosoftEventHubEventHub(EventHubV2StreamInputDataSource), + #[serde(rename = "Microsoft.Devices/IotHubs")] + MicrosoftDevicesIotHubs(IoTHubStreamInputDataSource), + Raw(RawStreamInputDataSource), +} #[doc = "The properties that are associated with an input containing stream data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StreamInputProperties { @@ -2778,7 +2875,7 @@ pub struct StreamInputProperties { pub input_properties: InputProperties, #[doc = "Describes an input data source that contains stream data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, } impl StreamInputProperties { pub fn new(input_properties: InputProperties) -> Self { diff --git a/services/mgmt/streamanalytics/src/package_pure_2020_03/mod.rs b/services/mgmt/streamanalytics/src/package_pure_2020_03/mod.rs index 9429e06855..b300673b7c 100644 --- a/services/mgmt/streamanalytics/src/package_pure_2020_03/mod.rs +++ b/services/mgmt/streamanalytics/src/package_pure_2020_03/mod.rs @@ -4821,13 +4821,13 @@ pub mod functions { pub(crate) resource_group_name: String, pub(crate) job_name: String, pub(crate) function_name: String, - pub(crate) function_retrieve_default_definition_parameters: Option, + pub(crate) function_retrieve_default_definition_parameters: Option, } impl RequestBuilder { #[doc = "Parameters used to specify the type of function to retrieve the default definition for."] pub fn function_retrieve_default_definition_parameters( mut self, - function_retrieve_default_definition_parameters: impl Into, + function_retrieve_default_definition_parameters: impl Into, ) -> Self { self.function_retrieve_default_definition_parameters = Some(function_retrieve_default_definition_parameters.into()); self diff --git a/services/mgmt/streamanalytics/src/package_pure_2020_03/models.rs b/services/mgmt/streamanalytics/src/package_pure_2020_03/models.rs index a6ce93fcfa..45553dbae7 100644 --- a/services/mgmt/streamanalytics/src/package_pure_2020_03/models.rs +++ b/services/mgmt/streamanalytics/src/package_pure_2020_03/models.rs @@ -1410,7 +1410,7 @@ pub struct Function { pub sub_resource: SubResource, #[doc = "The properties that are associated with a function."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Function { pub fn new() -> Self { @@ -1429,6 +1429,14 @@ impl FunctionBinding { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FunctionBindingUnion { + #[serde(rename = "Microsoft.MachineLearning/WebService")] + MicrosoftMachineLearningWebService(AzureMachineLearningWebServiceFunctionBinding), + #[serde(rename = "Microsoft.StreamAnalytics/JavascriptUdf")] + MicrosoftStreamAnalyticsJavascriptUdf(JavaScriptFunctionBinding), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FunctionConfiguration { #[serde( @@ -1442,7 +1450,7 @@ pub struct FunctionConfiguration { pub output: Option, #[doc = "The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub binding: Option, + pub binding: Option, } impl FunctionConfiguration { pub fn new() -> Self { @@ -1522,6 +1530,12 @@ impl FunctionProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum FunctionPropertiesUnion { + Aggregate(AggregateFunctionProperties), + Scalar(ScalarFunctionProperties), +} #[doc = "Parameters used to specify the type of function to retrieve the default definition for."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FunctionRetrieveDefaultDefinitionParameters { @@ -1534,6 +1548,14 @@ impl FunctionRetrieveDefaultDefinitionParameters { Self { binding_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "bindingType")] +pub enum FunctionRetrieveDefaultDefinitionParametersUnion { + #[serde(rename = "Microsoft.MachineLearning/WebService")] + MicrosoftMachineLearningWebService(AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters), + #[serde(rename = "Microsoft.StreamAnalytics/JavascriptUdf")] + MicrosoftStreamAnalyticsJavascriptUdf(JavaScriptFunctionRetrieveDefaultDefinitionParameters), +} #[doc = "Describes a Gateway Message Bus output data source."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GatewayMessageBusOutputDataSource { @@ -1627,7 +1649,7 @@ pub struct Input { pub sub_resource: SubResource, #[doc = "The properties that are associated with an input."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Input { pub fn new() -> Self { @@ -1667,7 +1689,7 @@ pub struct InputProperties { pub type_: String, #[doc = "Describes how data from an input is serialized or how data is serialized when written to an output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub serialization: Option, + pub serialization: Option, #[doc = "Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention."] #[serde(default, skip_serializing_if = "Option::is_none")] pub diagnostics: Option, @@ -1693,6 +1715,12 @@ impl InputProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum InputPropertiesUnion { + Reference(ReferenceInputProperties), + Stream(StreamInputProperties), +} #[doc = "Describes an IoT Hub input data source that contains stream data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IoTHubStreamInputDataSource { @@ -2042,6 +2070,35 @@ impl OutputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum OutputDataSourceUnion { + #[serde(rename = "Microsoft.DataLake/Accounts")] + MicrosoftDataLakeAccounts(AzureDataLakeStoreOutputDataSource), + #[serde(rename = "Microsoft.AzureFunction")] + MicrosoftAzureFunction(AzureFunctionOutputDataSource), + #[serde(rename = "Microsoft.Sql/Server/Database")] + MicrosoftSqlServerDatabase(AzureSqlDatabaseOutputDataSource), + #[serde(rename = "Microsoft.Sql/Server/DataWarehouse")] + MicrosoftSqlServerDataWarehouse(AzureSynapseOutputDataSource), + #[serde(rename = "Microsoft.Storage/Table")] + MicrosoftStorageTable(AzureTableOutputDataSource), + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobOutputDataSource), + #[serde(rename = "Microsoft.Storage/DocumentDB")] + MicrosoftStorageDocumentDb(DocumentDbOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/EventHub")] + MicrosoftServiceBusEventHub(EventHubOutputDataSource), + #[serde(rename = "Microsoft.EventHub/EventHub")] + MicrosoftEventHubEventHub(EventHubV2OutputDataSource), + GatewayMessageBus(GatewayMessageBusOutputDataSource), + #[serde(rename = "PowerBI")] + PowerBi(PowerBiOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/Queue")] + MicrosoftServiceBusQueue(ServiceBusQueueOutputDataSource), + #[serde(rename = "Microsoft.ServiceBus/Topic")] + MicrosoftServiceBusTopic(ServiceBusTopicOutputDataSource), +} #[doc = "Indicates the policy to apply to events that arrive at the output and cannot be written to the external storage due to being malformed (missing column values, column values of wrong type or size)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "OutputErrorPolicy")] @@ -2109,7 +2166,7 @@ impl OutputListResult { pub struct OutputProperties { #[doc = "Describes the data source that output will be written to."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, #[doc = "The time frame for filtering Stream Analytics job outputs."] #[serde(rename = "timeWindow", default, skip_serializing_if = "Option::is_none")] pub time_window: Option, @@ -2118,7 +2175,7 @@ pub struct OutputProperties { pub size_window: Option, #[doc = "Describes how data from an input is serialized or how data is serialized when written to an output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub serialization: Option, + pub serialization: Option, #[doc = "Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention."] #[serde(default, skip_serializing_if = "Option::is_none")] pub diagnostics: Option, @@ -2379,6 +2436,15 @@ impl ReferenceInputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ReferenceInputDataSourceUnion { + #[serde(rename = "Microsoft.Sql/Server/Database")] + MicrosoftSqlServerDatabase(AzureSqlReferenceInputDataSource), + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobReferenceInputDataSource), + File(FileReferenceInputDataSource), +} #[doc = "The properties that are associated with an input containing reference data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReferenceInputProperties { @@ -2386,7 +2452,7 @@ pub struct ReferenceInputProperties { pub input_properties: InputProperties, #[doc = "Describes an input data source that contains reference data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, } impl ReferenceInputProperties { pub fn new(input_properties: InputProperties) -> Self { @@ -2503,6 +2569,14 @@ impl Serialization { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SerializationUnion { + Avro(AvroSerialization), + Csv(CsvSerialization), + Json(JsonSerialization), + Parquet(ParquetSerialization), +} #[doc = "The common properties that are associated with Service Bus data sources (Queues, Topics, Event Hubs, etc.)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceBusDataSourceProperties { @@ -2700,6 +2774,19 @@ impl StreamInputDataSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum StreamInputDataSourceUnion { + #[serde(rename = "Microsoft.Storage/Blob")] + MicrosoftStorageBlob(BlobStreamInputDataSource), + #[serde(rename = "Microsoft.ServiceBus/EventHub")] + MicrosoftServiceBusEventHub(EventHubStreamInputDataSource), + #[serde(rename = "Microsoft.EventHub/EventHub")] + MicrosoftEventHubEventHub(EventHubV2StreamInputDataSource), + GatewayMessageBus(GatewayMessageBusStreamInputDataSource), + #[serde(rename = "Microsoft.Devices/IotHubs")] + MicrosoftDevicesIotHubs(IoTHubStreamInputDataSource), +} #[doc = "The properties that are associated with an input containing stream data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StreamInputProperties { @@ -2707,7 +2794,7 @@ pub struct StreamInputProperties { pub input_properties: InputProperties, #[doc = "Describes an input data source that contains stream data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub datasource: Option, + pub datasource: Option, } impl StreamInputProperties { pub fn new(input_properties: InputProperties) -> Self { diff --git a/services/mgmt/synapse/src/package_composite_v1/models.rs b/services/mgmt/synapse/src/package_composite_v1/models.rs index 611f779194..37ee61a8c4 100644 --- a/services/mgmt/synapse/src/package_composite_v1/models.rs +++ b/services/mgmt/synapse/src/package_composite_v1/models.rs @@ -502,10 +502,10 @@ pub struct CmdkeySetupTypeProperties { #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, } impl CmdkeySetupTypeProperties { - pub fn new(target_name: serde_json::Value, user_name: serde_json::Value, password: SecretBase) -> Self { + pub fn new(target_name: serde_json::Value, user_name: serde_json::Value, password: SecretBaseUnion) -> Self { Self { target_name, user_name, @@ -566,6 +566,9 @@ impl CustomSetupBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CustomSetupBaseUnion {} #[doc = "Details of the customer managed key associated with the workspace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomerManagedKeyDetails { @@ -1488,6 +1491,12 @@ impl IntegrationRuntime { Self { type_, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeUnion { + Managed(ManagedIntegrationRuntime), + SelfHosted(SelfHostedIntegrationRuntime), +} #[doc = "The integration runtime authentication keys."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IntegrationRuntimeAuthKeys { @@ -2027,10 +2036,10 @@ pub struct IntegrationRuntimeResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "Azure Synapse nested object which serves as a compute resource for activities."] - pub properties: IntegrationRuntime, + pub properties: IntegrationRuntimeUnion, } impl IntegrationRuntimeResource { - pub fn new(properties: IntegrationRuntime) -> Self { + pub fn new(properties: IntegrationRuntimeUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -2128,7 +2137,7 @@ pub struct IntegrationRuntimeSsisProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub express_custom_setup_properties: Vec, + pub express_custom_setup_properties: Vec, } impl IntegrationRuntimeSsisProperties { pub fn new() -> Self { @@ -2287,6 +2296,12 @@ impl IntegrationRuntimeStatus { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeStatusUnion { + Managed(ManagedIntegrationRuntimeStatus), + SelfHosted(SelfHostedIntegrationRuntimeStatus), +} #[doc = "Integration runtime status response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IntegrationRuntimeStatusResponse { @@ -2294,10 +2309,10 @@ pub struct IntegrationRuntimeStatusResponse { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Integration runtime status."] - pub properties: IntegrationRuntimeStatus, + pub properties: IntegrationRuntimeStatusUnion, } impl IntegrationRuntimeStatusResponse { - pub fn new(properties: IntegrationRuntimeStatus) -> Self { + pub fn new(properties: IntegrationRuntimeStatusUnion) -> Self { Self { name: None, properties } } } @@ -2691,7 +2706,7 @@ pub struct LicensedComponentSetupTypeProperties { pub component_name: String, #[doc = "The base definition of a secret type."] #[serde(rename = "licenseKey", default, skip_serializing_if = "Option::is_none")] - pub license_key: Option, + pub license_key: Option, } impl LicensedComponentSetupTypeProperties { pub fn new(component_name: String) -> Self { @@ -2770,6 +2785,13 @@ impl LinkedIntegrationRuntimeType { Self { authorization_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authorizationType")] +pub enum LinkedIntegrationRuntimeTypeUnion { + Key(LinkedIntegrationRuntimeKeyAuthorization), + #[serde(rename = "RBAC")] + Rbac(LinkedIntegrationRuntimeRbacAuthorization), +} #[doc = "A list of SQL pool security alert policies."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ListSqlPoolSecurityAlertPolicies { @@ -4361,6 +4383,11 @@ impl SecretBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretBaseUnion { + SecureString(SecureString), +} #[doc = "Azure Synapse secure string definition. The string value will be masked with asterisks '*' during Get or List API calls."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecureString { @@ -4763,7 +4790,7 @@ pub mod self_hosted_integration_runtime_status_type_properties { pub struct SelfHostedIntegrationRuntimeTypeProperties { #[doc = "The base definition of a linked integration runtime."] #[serde(rename = "linkedInfo", default, skip_serializing_if = "Option::is_none")] - pub linked_info: Option, + pub linked_info: Option, } impl SelfHostedIntegrationRuntimeTypeProperties { pub fn new() -> Self { @@ -6411,6 +6438,14 @@ impl SsisObjectMetadata { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SsisObjectMetadataUnion { + Environment(SsisEnvironment), + Folder(SsisFolder), + Package(SsisPackage), + Project(SsisProject), +} #[doc = "A list of SSIS object metadata."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SsisObjectMetadataListResponse { @@ -6420,7 +6455,7 @@ pub struct SsisObjectMetadataListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link to the next page of results, if any remaining results exist."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/synapse/src/package_composite_v2/mod.rs b/services/mgmt/synapse/src/package_composite_v2/mod.rs index ff40773b84..2b4caf2b36 100644 --- a/services/mgmt/synapse/src/package_composite_v2/mod.rs +++ b/services/mgmt/synapse/src/package_composite_v2/mod.rs @@ -29961,7 +29961,7 @@ pub mod kusto_pool_databases { workspace_name: impl Into, kusto_pool_name: impl Into, database_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -29989,7 +29989,7 @@ pub mod kusto_pool_databases { workspace_name: impl Into, kusto_pool_name: impl Into, database_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -30136,9 +30136,9 @@ pub mod kusto_pool_databases { #[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::Database = serde_json::from_slice(&bytes)?; + let body: models::DatabaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -30227,8 +30227,8 @@ pub mod kusto_pool_databases { } } 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`."] @@ -30248,9 +30248,9 @@ pub mod kusto_pool_databases { #[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::Database = serde_json::from_slice(&bytes)?; + let body: models::DatabaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -30295,7 +30295,7 @@ pub mod kusto_pool_databases { pub(crate) workspace_name: String, pub(crate) kusto_pool_name: String, pub(crate) database_name: String, - pub(crate) parameters: models::Database, + pub(crate) parameters: models::DatabaseUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -30340,8 +30340,8 @@ pub mod kusto_pool_databases { } } 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."] @@ -30389,9 +30389,9 @@ pub mod kusto_pool_databases { #[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::Database = serde_json::from_slice(&bytes)?; + let body: models::DatabaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -30436,7 +30436,7 @@ pub mod kusto_pool_databases { pub(crate) workspace_name: String, pub(crate) kusto_pool_name: String, pub(crate) database_name: String, - pub(crate) parameters: models::Database, + pub(crate) parameters: models::DatabaseUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -30481,8 +30481,8 @@ pub mod kusto_pool_databases { } } 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."] @@ -30751,7 +30751,7 @@ pub mod kusto_pool_data_connections { kusto_pool_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -30782,7 +30782,7 @@ pub mod kusto_pool_data_connections { kusto_pool_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -31201,9 +31201,9 @@ pub mod kusto_pool_data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -31285,8 +31285,8 @@ pub mod kusto_pool_data_connections { } } 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`."] @@ -31306,9 +31306,9 @@ pub mod kusto_pool_data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -31354,7 +31354,7 @@ pub mod kusto_pool_data_connections { pub(crate) kusto_pool_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -31391,8 +31391,8 @@ pub mod kusto_pool_data_connections { } } 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."] @@ -31440,9 +31440,9 @@ pub mod kusto_pool_data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -31488,7 +31488,7 @@ pub mod kusto_pool_data_connections { pub(crate) kusto_pool_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -31525,8 +31525,8 @@ pub mod kusto_pool_data_connections { } } 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."] diff --git a/services/mgmt/synapse/src/package_composite_v2/models.rs b/services/mgmt/synapse/src/package_composite_v2/models.rs index 7f7baf3b2a..2dc16301c7 100644 --- a/services/mgmt/synapse/src/package_composite_v2/models.rs +++ b/services/mgmt/synapse/src/package_composite_v2/models.rs @@ -1109,10 +1109,10 @@ pub struct CmdkeySetupTypeProperties { #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, } impl CmdkeySetupTypeProperties { - pub fn new(target_name: serde_json::Value, user_name: serde_json::Value, password: SecretBase) -> Self { + pub fn new(target_name: serde_json::Value, user_name: serde_json::Value, password: SecretBaseUnion) -> Self { Self { target_name, user_name, @@ -1210,6 +1210,9 @@ impl CustomSetupBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CustomSetupBaseUnion {} #[doc = "Details of the customer managed key associated with the workspace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomerManagedKeyDetails { @@ -1294,6 +1297,13 @@ pub mod data_connection { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectionUnion { + EventGrid(EventGridDataConnection), + EventHub(EventHubDataConnection), + IotHub(IotHubDataConnection), +} #[doc = "A data connection check name availability request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataConnectionCheckNameRequest { @@ -1326,7 +1336,7 @@ pub struct DataConnectionListResult { 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 DataConnectionListResult { type Continuation = String; @@ -1347,7 +1357,7 @@ pub struct DataConnectionValidation { pub data_connection_name: Option, #[doc = "Class representing a data connection."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl DataConnectionValidation { pub fn new() -> Self { @@ -1676,6 +1686,12 @@ pub mod database { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DatabaseUnion { + ReadOnlyFollowing(ReadOnlyFollowingDatabase), + ReadWrite(ReadWriteDatabase), +} #[doc = "The result returned from a database check name availability request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatabaseCheckNameRequest { @@ -1710,7 +1726,7 @@ pub struct DatabaseListResult { 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 DatabaseListResult { type Continuation = String; @@ -2940,6 +2956,12 @@ impl IntegrationRuntime { Self { type_, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeUnion { + Managed(ManagedIntegrationRuntime), + SelfHosted(SelfHostedIntegrationRuntime), +} #[doc = "The integration runtime authentication keys."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IntegrationRuntimeAuthKeys { @@ -3479,10 +3501,10 @@ pub struct IntegrationRuntimeResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "Azure Synapse nested object which serves as a compute resource for activities."] - pub properties: IntegrationRuntime, + pub properties: IntegrationRuntimeUnion, } impl IntegrationRuntimeResource { - pub fn new(properties: IntegrationRuntime) -> Self { + pub fn new(properties: IntegrationRuntimeUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -3580,7 +3602,7 @@ pub struct IntegrationRuntimeSsisProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub express_custom_setup_properties: Vec, + pub express_custom_setup_properties: Vec, } impl IntegrationRuntimeSsisProperties { pub fn new() -> Self { @@ -3739,6 +3761,12 @@ impl IntegrationRuntimeStatus { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeStatusUnion { + Managed(ManagedIntegrationRuntimeStatus), + SelfHosted(SelfHostedIntegrationRuntimeStatus), +} #[doc = "Integration runtime status response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IntegrationRuntimeStatusResponse { @@ -3746,10 +3774,10 @@ pub struct IntegrationRuntimeStatusResponse { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Integration runtime status."] - pub properties: IntegrationRuntimeStatus, + pub properties: IntegrationRuntimeStatusUnion, } impl IntegrationRuntimeStatusResponse { - pub fn new(properties: IntegrationRuntimeStatus) -> Self { + pub fn new(properties: IntegrationRuntimeStatusUnion) -> Self { Self { name: None, properties } } } @@ -4557,7 +4585,7 @@ pub struct LicensedComponentSetupTypeProperties { pub component_name: String, #[doc = "The base definition of a secret type."] #[serde(rename = "licenseKey", default, skip_serializing_if = "Option::is_none")] - pub license_key: Option, + pub license_key: Option, } impl LicensedComponentSetupTypeProperties { pub fn new(component_name: String) -> Self { @@ -4636,6 +4664,13 @@ impl LinkedIntegrationRuntimeType { Self { authorization_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authorizationType")] +pub enum LinkedIntegrationRuntimeTypeUnion { + Key(LinkedIntegrationRuntimeKeyAuthorization), + #[serde(rename = "RBAC")] + Rbac(LinkedIntegrationRuntimeRbacAuthorization), +} #[doc = "List of available SKUs for a Kusto Pool."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ListResourceSkusResult { @@ -6561,6 +6596,11 @@ impl SecretBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretBaseUnion { + SecureString(SecureString), +} #[doc = "Azure Synapse secure string definition. The string value will be masked with asterisks '*' during Get or List API calls."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecureString { @@ -6963,7 +7003,7 @@ pub mod self_hosted_integration_runtime_status_type_properties { pub struct SelfHostedIntegrationRuntimeTypeProperties { #[doc = "The base definition of a linked integration runtime."] #[serde(rename = "linkedInfo", default, skip_serializing_if = "Option::is_none")] - pub linked_info: Option, + pub linked_info: Option, } impl SelfHostedIntegrationRuntimeTypeProperties { pub fn new() -> Self { @@ -8694,6 +8734,14 @@ impl SsisObjectMetadata { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SsisObjectMetadataUnion { + Environment(SsisEnvironment), + Folder(SsisFolder), + Package(SsisPackage), + Project(SsisProject), +} #[doc = "A list of SSIS object metadata."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SsisObjectMetadataListResponse { @@ -8703,7 +8751,7 @@ pub struct SsisObjectMetadataListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link to the next page of results, if any remaining results exist."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/synapse/src/package_kusto_pool_2021_04_preview/mod.rs b/services/mgmt/synapse/src/package_kusto_pool_2021_04_preview/mod.rs index 457f2dc82b..d42a78b694 100644 --- a/services/mgmt/synapse/src/package_kusto_pool_2021_04_preview/mod.rs +++ b/services/mgmt/synapse/src/package_kusto_pool_2021_04_preview/mod.rs @@ -1193,7 +1193,7 @@ pub mod databases { workspace_name: impl Into, kusto_pool_name: impl Into, database_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -1221,7 +1221,7 @@ pub mod databases { workspace_name: impl Into, kusto_pool_name: impl Into, database_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -1368,9 +1368,9 @@ pub mod databases { #[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::Database = serde_json::from_slice(&bytes)?; + let body: models::DatabaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1459,8 +1459,8 @@ pub mod databases { } } 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`."] @@ -1480,9 +1480,9 @@ pub mod databases { #[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::Database = serde_json::from_slice(&bytes)?; + let body: models::DatabaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1527,7 +1527,7 @@ pub mod databases { pub(crate) workspace_name: String, pub(crate) kusto_pool_name: String, pub(crate) database_name: String, - pub(crate) parameters: models::Database, + pub(crate) parameters: models::DatabaseUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1572,8 +1572,8 @@ pub mod databases { } } 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."] @@ -1621,9 +1621,9 @@ pub mod databases { #[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::Database = serde_json::from_slice(&bytes)?; + let body: models::DatabaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1668,7 +1668,7 @@ pub mod databases { pub(crate) workspace_name: String, pub(crate) kusto_pool_name: String, pub(crate) database_name: String, - pub(crate) parameters: models::Database, + pub(crate) parameters: models::DatabaseUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1713,8 +1713,8 @@ pub mod databases { } } 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."] @@ -1927,7 +1927,7 @@ pub mod data_connections { kusto_pool_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -1958,7 +1958,7 @@ pub mod data_connections { kusto_pool_name: impl Into, database_name: impl Into, data_connection_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -2103,9 +2103,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2187,8 +2187,8 @@ pub mod data_connections { } } 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`."] @@ -2208,9 +2208,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2256,7 +2256,7 @@ pub mod data_connections { pub(crate) kusto_pool_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2293,8 +2293,8 @@ pub mod data_connections { } } 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."] @@ -2342,9 +2342,9 @@ pub mod data_connections { #[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::DataConnection = serde_json::from_slice(&bytes)?; + let body: models::DataConnectionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2390,7 +2390,7 @@ pub mod data_connections { pub(crate) kusto_pool_name: String, pub(crate) database_name: String, pub(crate) data_connection_name: String, - pub(crate) parameters: models::DataConnection, + pub(crate) parameters: models::DataConnectionUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2427,8 +2427,8 @@ pub mod data_connections { } } 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."] diff --git a/services/mgmt/synapse/src/package_kusto_pool_2021_04_preview/models.rs b/services/mgmt/synapse/src/package_kusto_pool_2021_04_preview/models.rs index f7fc8b38fc..6a647250ea 100644 --- a/services/mgmt/synapse/src/package_kusto_pool_2021_04_preview/models.rs +++ b/services/mgmt/synapse/src/package_kusto_pool_2021_04_preview/models.rs @@ -537,6 +537,13 @@ pub mod data_connection { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DataConnectionUnion { + EventGrid(EventGridDataConnection), + EventHub(EventHubDataConnection), + IotHub(IotHubDataConnection), +} #[doc = "The list Kusto data connections operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataConnectionListResult { @@ -546,7 +553,7 @@ pub struct DataConnectionListResult { 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 DataConnectionListResult { type Continuation = String; @@ -623,6 +630,11 @@ pub mod database { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DatabaseUnion { + ReadWrite(ReadWriteDatabase), +} #[doc = "The list Kusto databases operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DatabaseListResult { @@ -632,7 +644,7 @@ pub struct DatabaseListResult { 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 DatabaseListResult { type Continuation = String; diff --git a/services/mgmt/synapse/src/package_preview_2021_06/models.rs b/services/mgmt/synapse/src/package_preview_2021_06/models.rs index eda058ba99..791cdd7407 100644 --- a/services/mgmt/synapse/src/package_preview_2021_06/models.rs +++ b/services/mgmt/synapse/src/package_preview_2021_06/models.rs @@ -534,10 +534,10 @@ pub struct CmdkeySetupTypeProperties { #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] - pub password: SecretBase, + pub password: SecretBaseUnion, } impl CmdkeySetupTypeProperties { - pub fn new(target_name: serde_json::Value, user_name: serde_json::Value, password: SecretBase) -> Self { + pub fn new(target_name: serde_json::Value, user_name: serde_json::Value, password: SecretBaseUnion) -> Self { Self { target_name, user_name, @@ -598,6 +598,9 @@ impl CustomSetupBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CustomSetupBaseUnion {} #[doc = "Details of the customer managed key associated with the workspace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomerManagedKeyDetails { @@ -1749,6 +1752,12 @@ impl IntegrationRuntime { Self { type_, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeUnion { + Managed(ManagedIntegrationRuntime), + SelfHosted(SelfHostedIntegrationRuntime), +} #[doc = "The integration runtime authentication keys."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IntegrationRuntimeAuthKeys { @@ -2288,10 +2297,10 @@ pub struct IntegrationRuntimeResource { #[serde(flatten)] pub sub_resource: SubResource, #[doc = "Azure Synapse nested object which serves as a compute resource for activities."] - pub properties: IntegrationRuntime, + pub properties: IntegrationRuntimeUnion, } impl IntegrationRuntimeResource { - pub fn new(properties: IntegrationRuntime) -> Self { + pub fn new(properties: IntegrationRuntimeUnion) -> Self { Self { sub_resource: SubResource::default(), properties, @@ -2389,7 +2398,7 @@ pub struct IntegrationRuntimeSsisProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub express_custom_setup_properties: Vec, + pub express_custom_setup_properties: Vec, } impl IntegrationRuntimeSsisProperties { pub fn new() -> Self { @@ -2548,6 +2557,12 @@ impl IntegrationRuntimeStatus { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum IntegrationRuntimeStatusUnion { + Managed(ManagedIntegrationRuntimeStatus), + SelfHosted(SelfHostedIntegrationRuntimeStatus), +} #[doc = "Integration runtime status response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IntegrationRuntimeStatusResponse { @@ -2555,10 +2570,10 @@ pub struct IntegrationRuntimeStatusResponse { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "Integration runtime status."] - pub properties: IntegrationRuntimeStatus, + pub properties: IntegrationRuntimeStatusUnion, } impl IntegrationRuntimeStatusResponse { - pub fn new(properties: IntegrationRuntimeStatus) -> Self { + pub fn new(properties: IntegrationRuntimeStatusUnion) -> Self { Self { name: None, properties } } } @@ -2952,7 +2967,7 @@ pub struct LicensedComponentSetupTypeProperties { pub component_name: String, #[doc = "The base definition of a secret type."] #[serde(rename = "licenseKey", default, skip_serializing_if = "Option::is_none")] - pub license_key: Option, + pub license_key: Option, } impl LicensedComponentSetupTypeProperties { pub fn new(component_name: String) -> Self { @@ -3031,6 +3046,13 @@ impl LinkedIntegrationRuntimeType { Self { authorization_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "authorizationType")] +pub enum LinkedIntegrationRuntimeTypeUnion { + Key(LinkedIntegrationRuntimeKeyAuthorization), + #[serde(rename = "RBAC")] + Rbac(LinkedIntegrationRuntimeRbacAuthorization), +} #[doc = "A list of SQL pool security alert policies."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ListSqlPoolSecurityAlertPolicies { @@ -4830,6 +4852,11 @@ impl SecretBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SecretBaseUnion { + SecureString(SecureString), +} #[doc = "Azure Synapse secure string definition. The string value will be masked with asterisks '*' during Get or List API calls."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecureString { @@ -5232,7 +5259,7 @@ pub mod self_hosted_integration_runtime_status_type_properties { pub struct SelfHostedIntegrationRuntimeTypeProperties { #[doc = "The base definition of a linked integration runtime."] #[serde(rename = "linkedInfo", default, skip_serializing_if = "Option::is_none")] - pub linked_info: Option, + pub linked_info: Option, } impl SelfHostedIntegrationRuntimeTypeProperties { pub fn new() -> Self { @@ -6875,6 +6902,14 @@ impl SsisObjectMetadata { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum SsisObjectMetadataUnion { + Environment(SsisEnvironment), + Folder(SsisFolder), + Package(SsisPackage), + Project(SsisProject), +} #[doc = "A list of SSIS object metadata."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SsisObjectMetadataListResponse { @@ -6884,7 +6919,7 @@ pub struct SsisObjectMetadataListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link to the next page of results, if any remaining results exist."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, diff --git a/services/mgmt/testbase/src/package_2020_12_16_preview/models.rs b/services/mgmt/testbase/src/package_2020_12_16_preview/models.rs index 3f3a0a8610..3a2ffc6752 100644 --- a/services/mgmt/testbase/src/package_2020_12_16_preview/models.rs +++ b/services/mgmt/testbase/src/package_2020_12_16_preview/models.rs @@ -38,7 +38,7 @@ pub struct AnalysisResultSingletonResource { pub system_data: Option, #[doc = "The properties of Analysis Result resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AnalysisResultSingletonResource { pub fn new() -> Self { @@ -115,6 +115,19 @@ pub mod analysis_result_singleton_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "analysisResultType")] +pub enum AnalysisResultSingletonResourcePropertiesUnion { + #[serde(rename = "CPURegression")] + CpuRegression(CpuRegressionResultSingletonResourceProperties), + #[serde(rename = "CPUUtilization")] + CpuUtilization(CpuUtilizationResultSingletonResourceProperties), + MemoryRegression(MemoryRegressionResultSingletonResourceProperties), + MemoryUtilization(MemoryUtilizationResultSingletonResourceProperties), + Reliability(ReliabilityResultSingletonResourceProperties), + ScriptExecution(ScriptExecutionResultSingletonResourceProperties), + TestAnalysis(TestAnalysisResultSingletonResourceProperties), +} #[doc = "A list of available OSs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AvailableOsListResult { diff --git a/services/mgmt/testbase/src/package_2022_04_01_preview/models.rs b/services/mgmt/testbase/src/package_2022_04_01_preview/models.rs index a20e74508a..1e02253170 100644 --- a/services/mgmt/testbase/src/package_2022_04_01_preview/models.rs +++ b/services/mgmt/testbase/src/package_2022_04_01_preview/models.rs @@ -38,7 +38,7 @@ pub struct AnalysisResultSingletonResource { pub system_data: Option, #[doc = "The properties of Analysis Result resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl AnalysisResultSingletonResource { pub fn new() -> Self { @@ -115,6 +115,19 @@ pub mod analysis_result_singleton_resource_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "analysisResultType")] +pub enum AnalysisResultSingletonResourcePropertiesUnion { + #[serde(rename = "CPURegression")] + CpuRegression(CpuRegressionResultSingletonResourceProperties), + #[serde(rename = "CPUUtilization")] + CpuUtilization(CpuUtilizationResultSingletonResourceProperties), + MemoryRegression(MemoryRegressionResultSingletonResourceProperties), + MemoryUtilization(MemoryUtilizationResultSingletonResourceProperties), + Reliability(ReliabilityResultSingletonResourceProperties), + ScriptExecution(ScriptExecutionResultSingletonResourceProperties), + TestAnalysis(TestAnalysisResultSingletonResourceProperties), +} #[doc = "A list of available OSs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AvailableOsListResult { diff --git a/services/mgmt/timeseriesinsights/src/package_2017_11_15/mod.rs b/services/mgmt/timeseriesinsights/src/package_2017_11_15/mod.rs index b11f9545ff..5045ef19da 100644 --- a/services/mgmt/timeseriesinsights/src/package_2017_11_15/mod.rs +++ b/services/mgmt/timeseriesinsights/src/package_2017_11_15/mod.rs @@ -1108,7 +1108,7 @@ pub mod event_sources { resource_group_name: impl Into, environment_name: impl Into, event_source_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -1195,9 +1195,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1284,8 +1284,8 @@ pub mod event_sources { } } 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`."] @@ -1305,9 +1305,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1352,7 +1352,7 @@ pub mod event_sources { pub(crate) resource_group_name: String, pub(crate) environment_name: String, pub(crate) event_source_name: String, - pub(crate) parameters: models::EventSourceCreateOrUpdateParameters, + pub(crate) parameters: models::EventSourceCreateOrUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1396,8 +1396,8 @@ pub mod event_sources { } } 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`."] @@ -1417,9 +1417,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1508,8 +1508,8 @@ pub mod event_sources { } } 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`."] diff --git a/services/mgmt/timeseriesinsights/src/package_2017_11_15/models.rs b/services/mgmt/timeseriesinsights/src/package_2017_11_15/models.rs index 90decb2596..09dcdc433e 100644 --- a/services/mgmt/timeseriesinsights/src/package_2017_11_15/models.rs +++ b/services/mgmt/timeseriesinsights/src/package_2017_11_15/models.rs @@ -533,6 +533,14 @@ pub mod event_source_create_or_update_parameters { MicrosoftIoTHub, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceCreateOrUpdateParametersUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceCreateOrUpdateParameters), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceCreateOrUpdateParameters), +} #[doc = "The response of the List EventSources operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSourceListResponse { @@ -542,7 +550,7 @@ pub struct EventSourceListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EventSourceListResponse { pub fn new() -> Self { @@ -588,6 +596,14 @@ pub mod event_source_resource { MicrosoftIoTHub, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceResourceUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceResource), + #[serde(rename = "Microsoft.IotHub")] + MicrosoftIotHub(IoTHubEventSourceResource), +} #[doc = "Parameters supplied to the Update Event Source operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSourceUpdateParameters { diff --git a/services/mgmt/timeseriesinsights/src/package_2018_08_preview/mod.rs b/services/mgmt/timeseriesinsights/src/package_2018_08_preview/mod.rs index 9d4222074a..49454f8c7b 100644 --- a/services/mgmt/timeseriesinsights/src/package_2018_08_preview/mod.rs +++ b/services/mgmt/timeseriesinsights/src/package_2018_08_preview/mod.rs @@ -293,7 +293,7 @@ pub mod environments { subscription_id: impl Into, resource_group_name: impl Into, environment_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -380,9 +380,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -476,8 +476,8 @@ pub mod environments { } } 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`."] @@ -497,9 +497,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -542,7 +542,7 @@ pub mod environments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) environment_name: String, - pub(crate) parameters: models::EnvironmentCreateOrUpdateParameters, + pub(crate) parameters: models::EnvironmentCreateOrUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -585,8 +585,8 @@ pub mod environments { } } 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."] @@ -634,9 +634,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -722,8 +722,8 @@ pub mod environments { } } 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."] @@ -1108,7 +1108,7 @@ pub mod event_sources { resource_group_name: impl Into, environment_name: impl Into, event_source_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -1195,9 +1195,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1284,8 +1284,8 @@ pub mod event_sources { } } 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`."] @@ -1305,9 +1305,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1352,7 +1352,7 @@ pub mod event_sources { pub(crate) resource_group_name: String, pub(crate) environment_name: String, pub(crate) event_source_name: String, - pub(crate) parameters: models::EventSourceCreateOrUpdateParameters, + pub(crate) parameters: models::EventSourceCreateOrUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1396,8 +1396,8 @@ pub mod event_sources { } } 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`."] @@ -1417,9 +1417,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1508,8 +1508,8 @@ pub mod event_sources { } } 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`."] diff --git a/services/mgmt/timeseriesinsights/src/package_2018_08_preview/models.rs b/services/mgmt/timeseriesinsights/src/package_2018_08_preview/models.rs index d0f2300a29..2f858cbe3f 100644 --- a/services/mgmt/timeseriesinsights/src/package_2018_08_preview/models.rs +++ b/services/mgmt/timeseriesinsights/src/package_2018_08_preview/models.rs @@ -223,6 +223,12 @@ pub mod environment_create_or_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentCreateOrUpdateParametersUnion { + LongTerm(LongTermEnvironmentCreateOrUpdateParameters), + Standard(StandardEnvironmentCreateOrUpdateParameters), +} #[doc = "The response of the List Environments operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentListResponse { @@ -232,7 +238,7 @@ pub struct EnvironmentListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EnvironmentListResponse { pub fn new() -> Self { @@ -267,6 +273,12 @@ pub mod environment_resource { LongTerm, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentResourceUnion { + LongTerm(LongTermEnvironmentResource), + Standard(StandardEnvironmentResource), +} #[doc = "Properties of the environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentResourceProperties { @@ -536,6 +548,14 @@ pub mod event_source_create_or_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceCreateOrUpdateParametersUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceCreateOrUpdateParameters), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceCreateOrUpdateParameters), +} #[doc = "The response of the List EventSources operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSourceListResponse { @@ -545,7 +565,7 @@ pub struct EventSourceListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EventSourceListResponse { pub fn new() -> Self { @@ -591,6 +611,14 @@ pub mod event_source_resource { MicrosoftIoTHub, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceResourceUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceResource), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceResource), +} #[doc = "Parameters supplied to the Update Event Source operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSourceUpdateParameters { diff --git a/services/mgmt/timeseriesinsights/src/package_2020_05_15/mod.rs b/services/mgmt/timeseriesinsights/src/package_2020_05_15/mod.rs index e5fac0d966..86e68737d2 100644 --- a/services/mgmt/timeseriesinsights/src/package_2020_05_15/mod.rs +++ b/services/mgmt/timeseriesinsights/src/package_2020_05_15/mod.rs @@ -293,7 +293,7 @@ pub mod environments { subscription_id: impl Into, resource_group_name: impl Into, environment_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -315,7 +315,7 @@ pub mod environments { subscription_id: impl Into, resource_group_name: impl Into, environment_name: impl Into, - environment_update_parameters: impl Into, + environment_update_parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -380,9 +380,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -476,8 +476,8 @@ pub mod environments { } } 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`."] @@ -497,9 +497,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -542,7 +542,7 @@ pub mod environments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) environment_name: String, - pub(crate) parameters: models::EnvironmentCreateOrUpdateParameters, + pub(crate) parameters: models::EnvironmentCreateOrUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -585,8 +585,8 @@ pub mod environments { } } 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."] @@ -634,9 +634,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -679,7 +679,7 @@ pub mod environments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) environment_name: String, - pub(crate) environment_update_parameters: models::EnvironmentUpdateParameters, + pub(crate) environment_update_parameters: models::EnvironmentUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -722,8 +722,8 @@ pub mod environments { } } 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."] @@ -1108,7 +1108,7 @@ pub mod event_sources { resource_group_name: impl Into, environment_name: impl Into, event_source_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -1133,7 +1133,7 @@ pub mod event_sources { resource_group_name: impl Into, environment_name: impl Into, event_source_name: impl Into, - event_source_update_parameters: impl Into, + event_source_update_parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -1195,9 +1195,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1284,8 +1284,8 @@ pub mod event_sources { } } 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`."] @@ -1305,9 +1305,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1352,7 +1352,7 @@ pub mod event_sources { pub(crate) resource_group_name: String, pub(crate) environment_name: String, pub(crate) event_source_name: String, - pub(crate) parameters: models::EventSourceCreateOrUpdateParameters, + pub(crate) parameters: models::EventSourceCreateOrUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1396,8 +1396,8 @@ pub mod event_sources { } } 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`."] @@ -1417,9 +1417,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1464,7 +1464,7 @@ pub mod event_sources { pub(crate) resource_group_name: String, pub(crate) environment_name: String, pub(crate) event_source_name: String, - pub(crate) event_source_update_parameters: models::EventSourceUpdateParameters, + pub(crate) event_source_update_parameters: models::EventSourceUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1508,8 +1508,8 @@ pub mod event_sources { } } 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`."] diff --git a/services/mgmt/timeseriesinsights/src/package_2020_05_15/models.rs b/services/mgmt/timeseriesinsights/src/package_2020_05_15/models.rs index b08addd505..80791c82b2 100644 --- a/services/mgmt/timeseriesinsights/src/package_2020_05_15/models.rs +++ b/services/mgmt/timeseriesinsights/src/package_2020_05_15/models.rs @@ -244,6 +244,12 @@ pub mod environment_create_or_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentCreateOrUpdateParametersUnion { + Gen1(Gen1EnvironmentCreateOrUpdateParameters), + Gen2(Gen2EnvironmentCreateOrUpdateParameters), +} #[doc = "The response of the List Environments operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentListResponse { @@ -253,7 +259,7 @@ pub struct EnvironmentListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EnvironmentListResponse { pub fn new() -> Self { @@ -288,6 +294,12 @@ pub mod environment_resource { Gen2, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentResourceUnion { + Gen1(Gen1EnvironmentResource), + Gen2(Gen2EnvironmentResource), +} #[doc = "Properties of the environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentResourceProperties { @@ -392,6 +404,12 @@ pub mod environment_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentUpdateParametersUnion { + Gen1(Gen1EnvironmentUpdateParameters), + Gen2(Gen2EnvironmentUpdateParameters), +} #[doc = "Properties of the EventHub event source."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventHubEventSourceCommonProperties { @@ -608,6 +626,14 @@ pub mod event_source_create_or_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceCreateOrUpdateParametersUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceCreateOrUpdateParameters), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceCreateOrUpdateParameters), +} #[doc = "The response of the List EventSources operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSourceListResponse { @@ -617,7 +643,7 @@ pub struct EventSourceListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EventSourceListResponse { pub fn new() -> Self { @@ -660,6 +686,14 @@ pub mod event_source_resource { MicrosoftIoTHub, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceResourceUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceResource), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceResource), +} #[doc = "Parameters supplied to the Update Event Source operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventSourceUpdateParameters { @@ -716,6 +750,14 @@ pub mod event_source_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceUpdateParametersUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceUpdateParameters), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceUpdateParameters), +} #[doc = "Parameters supplied to the Create or Update Environment operation for a Gen1 environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Gen1EnvironmentCreateOrUpdateParameters { diff --git a/services/mgmt/timeseriesinsights/src/package_preview_2021_03/mod.rs b/services/mgmt/timeseriesinsights/src/package_preview_2021_03/mod.rs index 382d5b4062..1fff096346 100644 --- a/services/mgmt/timeseriesinsights/src/package_preview_2021_03/mod.rs +++ b/services/mgmt/timeseriesinsights/src/package_preview_2021_03/mod.rs @@ -299,7 +299,7 @@ pub mod environments { subscription_id: impl Into, resource_group_name: impl Into, environment_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -321,7 +321,7 @@ pub mod environments { subscription_id: impl Into, resource_group_name: impl Into, environment_name: impl Into, - environment_update_parameters: impl Into, + environment_update_parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -386,9 +386,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -482,8 +482,8 @@ pub mod environments { } } 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`."] @@ -503,9 +503,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -548,7 +548,7 @@ pub mod environments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) environment_name: String, - pub(crate) parameters: models::EnvironmentCreateOrUpdateParameters, + pub(crate) parameters: models::EnvironmentCreateOrUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -591,8 +591,8 @@ pub mod environments { } } 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."] @@ -640,9 +640,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -685,7 +685,7 @@ pub mod environments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) environment_name: String, - pub(crate) environment_update_parameters: models::EnvironmentUpdateParameters, + pub(crate) environment_update_parameters: models::EnvironmentUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -728,8 +728,8 @@ pub mod environments { } } 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."] @@ -1114,7 +1114,7 @@ pub mod event_sources { resource_group_name: impl Into, environment_name: impl Into, event_source_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -1139,7 +1139,7 @@ pub mod event_sources { resource_group_name: impl Into, environment_name: impl Into, event_source_name: impl Into, - event_source_update_parameters: impl Into, + event_source_update_parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -1201,9 +1201,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1290,8 +1290,8 @@ pub mod event_sources { } } 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`."] @@ -1311,9 +1311,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1358,7 +1358,7 @@ pub mod event_sources { pub(crate) resource_group_name: String, pub(crate) environment_name: String, pub(crate) event_source_name: String, - pub(crate) parameters: models::EventSourceCreateOrUpdateParameters, + pub(crate) parameters: models::EventSourceCreateOrUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1402,8 +1402,8 @@ pub mod event_sources { } } 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`."] @@ -1423,9 +1423,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1470,7 +1470,7 @@ pub mod event_sources { pub(crate) resource_group_name: String, pub(crate) environment_name: String, pub(crate) event_source_name: String, - pub(crate) event_source_update_parameters: models::EventSourceUpdateParameters, + pub(crate) event_source_update_parameters: models::EventSourceUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1514,8 +1514,8 @@ pub mod event_sources { } } 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`."] diff --git a/services/mgmt/timeseriesinsights/src/package_preview_2021_03/models.rs b/services/mgmt/timeseriesinsights/src/package_preview_2021_03/models.rs index faa103d9ec..082f79192d 100644 --- a/services/mgmt/timeseriesinsights/src/package_preview_2021_03/models.rs +++ b/services/mgmt/timeseriesinsights/src/package_preview_2021_03/models.rs @@ -244,6 +244,12 @@ pub mod environment_create_or_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentCreateOrUpdateParametersUnion { + Gen1(Gen1EnvironmentCreateOrUpdateParameters), + Gen2(Gen2EnvironmentCreateOrUpdateParameters), +} #[doc = "The response of the List Environments operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentListResponse { @@ -253,7 +259,7 @@ pub struct EnvironmentListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EnvironmentListResponse { pub fn new() -> Self { @@ -288,6 +294,12 @@ pub mod environment_resource { Gen2, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentResourceUnion { + Gen1(Gen1EnvironmentResource), + Gen2(Gen2EnvironmentResource), +} #[doc = "Properties of the environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentResourceProperties { @@ -392,6 +404,12 @@ pub mod environment_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentUpdateParametersUnion { + Gen1(Gen1EnvironmentUpdateParameters), + Gen2(Gen2EnvironmentUpdateParameters), +} #[doc = "Properties of the EventHub event source."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventHubEventSourceCommonProperties { @@ -608,6 +626,14 @@ pub mod event_source_create_or_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceCreateOrUpdateParametersUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceCreateOrUpdateParameters), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceCreateOrUpdateParameters), +} #[doc = "The response of the List EventSources operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSourceListResponse { @@ -617,7 +643,7 @@ pub struct EventSourceListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EventSourceListResponse { pub fn new() -> Self { @@ -660,6 +686,14 @@ pub mod event_source_resource { MicrosoftIoTHub, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceResourceUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceResource), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceResource), +} #[doc = "Parameters supplied to the Update Event Source operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventSourceUpdateParameters { @@ -716,6 +750,14 @@ pub mod event_source_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceUpdateParametersUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceUpdateParameters), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceUpdateParameters), +} #[doc = "Parameters supplied to the Create or Update Environment operation for a Gen1 environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Gen1EnvironmentCreateOrUpdateParameters { diff --git a/services/mgmt/timeseriesinsights/src/package_preview_2021_06/mod.rs b/services/mgmt/timeseriesinsights/src/package_preview_2021_06/mod.rs index 6d8574865f..2ade5032e1 100644 --- a/services/mgmt/timeseriesinsights/src/package_preview_2021_06/mod.rs +++ b/services/mgmt/timeseriesinsights/src/package_preview_2021_06/mod.rs @@ -293,7 +293,7 @@ pub mod environments { subscription_id: impl Into, resource_group_name: impl Into, environment_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -315,7 +315,7 @@ pub mod environments { subscription_id: impl Into, resource_group_name: impl Into, environment_name: impl Into, - environment_update_parameters: impl Into, + environment_update_parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -380,9 +380,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -476,8 +476,8 @@ pub mod environments { } } 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`."] @@ -497,9 +497,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -542,7 +542,7 @@ pub mod environments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) environment_name: String, - pub(crate) parameters: models::EnvironmentCreateOrUpdateParameters, + pub(crate) parameters: models::EnvironmentCreateOrUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -585,8 +585,8 @@ pub mod environments { } } 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."] @@ -634,9 +634,9 @@ pub mod environments { #[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::EnvironmentResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -679,7 +679,7 @@ pub mod environments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) environment_name: String, - pub(crate) environment_update_parameters: models::EnvironmentUpdateParameters, + pub(crate) environment_update_parameters: models::EnvironmentUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -722,8 +722,8 @@ pub mod environments { } } 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."] @@ -1108,7 +1108,7 @@ pub mod event_sources { resource_group_name: impl Into, environment_name: impl Into, event_source_name: impl Into, - parameters: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -1133,7 +1133,7 @@ pub mod event_sources { resource_group_name: impl Into, environment_name: impl Into, event_source_name: impl Into, - event_source_update_parameters: impl Into, + event_source_update_parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -1195,9 +1195,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1284,8 +1284,8 @@ pub mod event_sources { } } 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`."] @@ -1305,9 +1305,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1352,7 +1352,7 @@ pub mod event_sources { pub(crate) resource_group_name: String, pub(crate) environment_name: String, pub(crate) event_source_name: String, - pub(crate) parameters: models::EventSourceCreateOrUpdateParameters, + pub(crate) parameters: models::EventSourceCreateOrUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1396,8 +1396,8 @@ pub mod event_sources { } } 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`."] @@ -1417,9 +1417,9 @@ pub mod event_sources { #[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::EventSourceResource = serde_json::from_slice(&bytes)?; + let body: models::EventSourceResourceUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1464,7 +1464,7 @@ pub mod event_sources { pub(crate) resource_group_name: String, pub(crate) environment_name: String, pub(crate) event_source_name: String, - pub(crate) event_source_update_parameters: models::EventSourceUpdateParameters, + pub(crate) event_source_update_parameters: models::EventSourceUpdateParametersUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1508,8 +1508,8 @@ pub mod event_sources { } } 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`."] diff --git a/services/mgmt/timeseriesinsights/src/package_preview_2021_06/models.rs b/services/mgmt/timeseriesinsights/src/package_preview_2021_06/models.rs index 6c502dbf2c..944111025d 100644 --- a/services/mgmt/timeseriesinsights/src/package_preview_2021_06/models.rs +++ b/services/mgmt/timeseriesinsights/src/package_preview_2021_06/models.rs @@ -244,6 +244,12 @@ pub mod environment_create_or_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentCreateOrUpdateParametersUnion { + Gen1(Gen1EnvironmentCreateOrUpdateParameters), + Gen2(Gen2EnvironmentCreateOrUpdateParameters), +} #[doc = "The response of the List Environments operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentListResponse { @@ -253,7 +259,7 @@ pub struct EnvironmentListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EnvironmentListResponse { pub fn new() -> Self { @@ -288,6 +294,12 @@ pub mod environment_resource { Gen2, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentResourceUnion { + Gen1(Gen1EnvironmentResource), + Gen2(Gen2EnvironmentResource), +} #[doc = "Properties of the environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentResourceProperties { @@ -395,6 +407,12 @@ pub mod environment_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EnvironmentUpdateParametersUnion { + Gen1(Gen1EnvironmentUpdateParameters), + Gen2(Gen2EnvironmentUpdateParameters), +} #[doc = "Properties of the EventHub event source."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventHubEventSourceCommonProperties { @@ -611,6 +629,14 @@ pub mod event_source_create_or_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceCreateOrUpdateParametersUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceCreateOrUpdateParameters), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceCreateOrUpdateParameters), +} #[doc = "The response of the List EventSources operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventSourceListResponse { @@ -620,7 +646,7 @@ pub struct EventSourceListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EventSourceListResponse { pub fn new() -> Self { @@ -663,6 +689,14 @@ pub mod event_source_resource { MicrosoftIoTHub, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceResourceUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceResource), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceResource), +} #[doc = "Parameters supplied to the Update Event Source operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventSourceUpdateParameters { @@ -719,6 +753,14 @@ pub mod event_source_update_parameters { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum EventSourceUpdateParametersUnion { + #[serde(rename = "Microsoft.EventHub")] + MicrosoftEventHub(EventHubEventSourceUpdateParameters), + #[serde(rename = "Microsoft.IoTHub")] + MicrosoftIoTHub(IoTHubEventSourceUpdateParameters), +} #[doc = "Parameters supplied to the Create or Update Environment operation for a Gen1 environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Gen1EnvironmentCreateOrUpdateParameters { diff --git a/services/mgmt/videoanalyzer/src/package_2021_05_01_preview/models.rs b/services/mgmt/videoanalyzer/src/package_2021_05_01_preview/models.rs index fd162cfd11..7ec1160b64 100644 --- a/services/mgmt/videoanalyzer/src/package_2021_05_01_preview/models.rs +++ b/services/mgmt/videoanalyzer/src/package_2021_05_01_preview/models.rs @@ -53,7 +53,7 @@ pub struct AccessPolicyProperties { pub role: Option, #[doc = "Base class for access policies authentication methods."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub authentication: Option, + pub authentication: Option, } impl AccessPolicyProperties { pub fn new() -> Self { @@ -176,6 +176,12 @@ impl AuthenticationBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum AuthenticationBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.JwtAuthentication")] + MicrosoftVideoAnalyzerJwtAuthentication(JwtAuthentication), +} #[doc = "The check availability request body."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckNameAvailabilityRequest { @@ -531,7 +537,7 @@ pub struct JwtAuthentication { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub keys: Vec, + pub keys: Vec, } impl JwtAuthentication { pub fn new(authentication_base: AuthenticationBase) -> Self { @@ -1094,6 +1100,14 @@ impl TokenKey { Self { type_, kid } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum TokenKeyUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.EccTokenKey")] + MicrosoftVideoAnalyzerEccTokenKey(EccTokenKey), + #[serde(rename = "#Microsoft.VideoAnalyzer.RsaTokenKey")] + MicrosoftVideoAnalyzerRsaTokenKey(RsaTokenKey), +} #[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 { diff --git a/services/mgmt/videoanalyzer/src/package_preview_2021_11/models.rs b/services/mgmt/videoanalyzer/src/package_preview_2021_11/models.rs index bd217449ed..46a4a0b43e 100644 --- a/services/mgmt/videoanalyzer/src/package_preview_2021_11/models.rs +++ b/services/mgmt/videoanalyzer/src/package_preview_2021_11/models.rs @@ -50,7 +50,7 @@ pub struct AccessPolicyProperties { pub role: Option, #[doc = "Base class for access policies authentication methods."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub authentication: Option, + pub authentication: Option, } impl AccessPolicyProperties { pub fn new() -> Self { @@ -187,6 +187,12 @@ impl AudioEncoderBase { Self { type_, bitrate_kbps: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum AudioEncoderBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.AudioEncoderAac")] + MicrosoftVideoAnalyzerAudioEncoderAac(AudioEncoderAac), +} #[doc = "Base class for access policies authentication methods."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AuthenticationBase { @@ -199,6 +205,12 @@ impl AuthenticationBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum AuthenticationBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.JwtAuthentication")] + MicrosoftVideoAnalyzerJwtAuthentication(JwtAuthentication), +} #[doc = "Base class for certificate sources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CertificateSource { @@ -211,6 +223,12 @@ impl CertificateSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum CertificateSourceUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.PemCertificateList")] + MicrosoftVideoAnalyzerPemCertificateList(PemCertificateList), +} #[doc = "The check availability request body."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckNameAvailabilityRequest { @@ -296,6 +314,12 @@ impl CredentialsBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum CredentialsBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.UsernamePasswordCredentials")] + MicrosoftVideoAnalyzerUsernamePasswordCredentials(UsernamePasswordCredentials), +} #[doc = "Required validation properties for tokens generated with Elliptical Curve algorithm."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EccTokenKey { @@ -431,10 +455,10 @@ pub struct EncoderCustomPreset { pub encoder_preset_base: EncoderPresetBase, #[doc = "Base type for all audio encoder presets, which define the recipe or instructions on how audio should be processed."] #[serde(rename = "audioEncoder", default, skip_serializing_if = "Option::is_none")] - pub audio_encoder: Option, + pub audio_encoder: Option, #[doc = "Base type for all video encoding presets, which define the recipe or instructions on how the input video should be processed."] #[serde(rename = "videoEncoder", default, skip_serializing_if = "Option::is_none")] - pub video_encoder: Option, + pub video_encoder: Option, } impl EncoderCustomPreset { pub fn new(encoder_preset_base: EncoderPresetBase) -> Self { @@ -457,16 +481,24 @@ impl EncoderPresetBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum EncoderPresetBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.EncoderCustomPreset")] + MicrosoftVideoAnalyzerEncoderCustomPreset(EncoderCustomPreset), + #[serde(rename = "#Microsoft.VideoAnalyzer.EncoderSystemPreset")] + MicrosoftVideoAnalyzerEncoderSystemPreset(EncoderSystemPreset), +} #[doc = "Encoder processor allows for encoding of the input content. For example, it can used to change the resolution from 4K to 1280x720."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EncoderProcessor { #[serde(flatten)] pub processor_node_base: ProcessorNodeBase, #[doc = "Base type for all encoder presets, which define the recipe or instructions on how the input content should be processed."] - pub preset: EncoderPresetBase, + pub preset: EncoderPresetBaseUnion, } impl EncoderProcessor { - pub fn new(processor_node_base: ProcessorNodeBase, preset: EncoderPresetBase) -> Self { + pub fn new(processor_node_base: ProcessorNodeBase, preset: EncoderPresetBaseUnion) -> Self { Self { processor_node_base, preset, @@ -594,15 +626,15 @@ pub struct EndpointBase { #[serde(rename = "@type")] pub type_: String, #[doc = "Base class for credential objects."] - pub credentials: CredentialsBase, + pub credentials: CredentialsBaseUnion, #[doc = "The endpoint URL for Video Analyzer to connect to."] pub url: String, #[doc = "Base class for tunnel objects."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub tunnel: Option, + pub tunnel: Option, } impl EndpointBase { - pub fn new(type_: String, credentials: CredentialsBase, url: String) -> Self { + pub fn new(type_: String, credentials: CredentialsBaseUnion, url: String) -> Self { Self { type_, credentials, @@ -611,6 +643,14 @@ impl EndpointBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum EndpointBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.TlsEndpoint")] + MicrosoftVideoAnalyzerTlsEndpoint(TlsEndpoint), + #[serde(rename = "#Microsoft.VideoAnalyzer.UnsecuredEndpoint")] + MicrosoftVideoAnalyzerUnsecuredEndpoint(UnsecuredEndpoint), +} #[doc = "The resource management error additional info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ErrorAdditionalInfo { @@ -781,7 +821,7 @@ pub struct JwtAuthentication { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub keys: Vec, + pub keys: Vec, } impl JwtAuthentication { pub fn new(authentication_base: AuthenticationBase) -> Self { @@ -1292,6 +1332,16 @@ impl NodeBase { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum NodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.ProcessorNodeBase")] + MicrosoftVideoAnalyzerProcessorNodeBase(ProcessorNodeBase), + #[serde(rename = "#Microsoft.VideoAnalyzer.SinkNodeBase")] + MicrosoftVideoAnalyzerSinkNodeBase(SinkNodeBase), + #[serde(rename = "#Microsoft.VideoAnalyzer.SourceNodeBase")] + MicrosoftVideoAnalyzerSourceNodeBase(SourceNodeBase), +} #[doc = "Describes an input signal to be used on a pipeline node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NodeInput { @@ -1858,19 +1908,19 @@ pub struct PipelineTopologyProperties { )] pub parameters: Vec, #[doc = "List of the topology source nodes. Source nodes enable external data to be ingested by the pipeline."] - pub sources: Vec, + pub sources: Vec, #[doc = "List of the topology processor nodes. Processor nodes enable pipeline data to be analyzed, processed or transformed."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub processors: Vec, + pub processors: Vec, #[doc = "List of the topology sink nodes. Sink nodes allow pipeline data to be stored or exported."] - pub sinks: Vec, + pub sinks: Vec, } impl PipelineTopologyProperties { - pub fn new(sources: Vec, sinks: Vec) -> Self { + pub fn new(sources: Vec, sinks: Vec) -> Self { Self { description: None, parameters: Vec::new(), @@ -1899,21 +1949,21 @@ pub struct PipelineTopologyPropertiesUpdate { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sources: Vec, + pub sources: Vec, #[doc = "List of the topology processor nodes. Processor nodes enable pipeline data to be analyzed, processed or transformed."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub processors: Vec, + pub processors: Vec, #[doc = "List of the topology sink nodes. Sink nodes allow pipeline data to be stored or exported."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, } impl PipelineTopologyPropertiesUpdate { pub fn new() -> Self { @@ -2216,6 +2266,12 @@ impl ProcessorNodeBase { Self { node_base, type_, inputs } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum ProcessorNodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.EncoderProcessor")] + MicrosoftVideoAnalyzerEncoderProcessor(EncoderProcessor), +} #[doc = "Metric properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Properties { @@ -2343,10 +2399,10 @@ pub struct RtspSource { #[serde(default, skip_serializing_if = "Option::is_none")] pub transport: Option, #[doc = "Base class for endpoints."] - pub endpoint: EndpointBase, + pub endpoint: EndpointBaseUnion, } impl RtspSource { - pub fn new(source_node_base: SourceNodeBase, endpoint: EndpointBase) -> Self { + pub fn new(source_node_base: SourceNodeBase, endpoint: EndpointBaseUnion) -> Self { Self { source_node_base, transport: None, @@ -2456,6 +2512,12 @@ impl SinkNodeBase { Self { node_base, type_, inputs } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum SinkNodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.VideoSink")] + MicrosoftVideoAnalyzerVideoSink(VideoSink), +} #[doc = "The SKU details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Sku { @@ -2561,6 +2623,14 @@ impl SourceNodeBase { Self { node_base, type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum SourceNodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.RtspSource")] + MicrosoftVideoAnalyzerRtspSource(RtspSource), + #[serde(rename = "#Microsoft.VideoAnalyzer.VideoSource")] + MicrosoftVideoAnalyzerVideoSource(VideoSource), +} #[doc = "The details about the associated storage account."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StorageAccount { @@ -2594,6 +2664,12 @@ impl TimeSequenceBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum TimeSequenceBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.VideoSequenceAbsoluteTimeMarkers")] + MicrosoftVideoAnalyzerVideoSequenceAbsoluteTimeMarkers(VideoSequenceAbsoluteTimeMarkers), +} #[doc = "TLS endpoint describes an endpoint that the pipeline can connect to over TLS transport (data is encrypted in transit)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TlsEndpoint { @@ -2601,7 +2677,7 @@ pub struct TlsEndpoint { pub endpoint_base: EndpointBase, #[doc = "Base class for certificate sources."] #[serde(rename = "trustedCertificates", default, skip_serializing_if = "Option::is_none")] - pub trusted_certificates: Option, + pub trusted_certificates: Option, #[doc = "Options for controlling the validation of TLS endpoints."] #[serde(rename = "validationOptions", default, skip_serializing_if = "Option::is_none")] pub validation_options: Option, @@ -2657,6 +2733,14 @@ impl TokenKey { Self { type_, kid } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum TokenKeyUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.EccTokenKey")] + MicrosoftVideoAnalyzerEccTokenKey(EccTokenKey), + #[serde(rename = "#Microsoft.VideoAnalyzer.RsaTokenKey")] + MicrosoftVideoAnalyzerRsaTokenKey(RsaTokenKey), +} #[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 { @@ -2689,6 +2773,12 @@ impl TunnelBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum TunnelBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.SecureIotDeviceRemoteTunnel")] + MicrosoftVideoAnalyzerSecureIotDeviceRemoteTunnel(SecureIotDeviceRemoteTunnel), +} #[doc = "Unsecured endpoint describes an endpoint that the pipeline can connect to over clear transport (no encryption in transit)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UnsecuredEndpoint { @@ -3242,6 +3332,12 @@ impl VideoEncoderBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum VideoEncoderBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.VideoEncoderH264")] + MicrosoftVideoAnalyzerVideoEncoderH264(VideoEncoderH264), +} #[doc = "A custom preset for encoding video with the H.264 (AVC) codec."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VideoEncoderH264 { @@ -3540,10 +3636,10 @@ pub struct VideoSource { pub video_name: String, #[doc = "A sequence of datetime ranges as a string."] #[serde(rename = "timeSequences")] - pub time_sequences: TimeSequenceBase, + pub time_sequences: TimeSequenceBaseUnion, } impl VideoSource { - pub fn new(source_node_base: SourceNodeBase, video_name: String, time_sequences: TimeSequenceBase) -> Self { + pub fn new(source_node_base: SourceNodeBase, video_name: String, time_sequences: TimeSequenceBaseUnion) -> Self { Self { source_node_base, video_name, diff --git a/services/mgmt/vmware/src/package_2021_06_01/models.rs b/services/mgmt/vmware/src/package_2021_06_01/models.rs index 472330636a..904aea0b7a 100644 --- a/services/mgmt/vmware/src/package_2021_06_01/models.rs +++ b/services/mgmt/vmware/src/package_2021_06_01/models.rs @@ -10,7 +10,7 @@ pub struct Addon { pub resource: Resource, #[doc = "The properties of an addon"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Addon { pub fn new() -> Self { @@ -163,6 +163,16 @@ pub mod addon_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "addonType")] +pub enum AddonPropertiesUnion { + #[serde(rename = "HCX")] + Hcx(AddonHcxProperties), + #[serde(rename = "SRM")] + Srm(AddonSrmProperties), + #[serde(rename = "VR")] + Vr(AddonVrProperties), +} #[doc = "The properties of a Site Recovery Manager (SRM) addon"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddonSrmProperties { @@ -1869,6 +1879,13 @@ pub mod script_execution_parameter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ScriptExecutionParameterUnion { + Credential(PsCredentialExecutionParameter), + SecureValue(ScriptSecureStringExecutionParameter), + Value(ScriptStringExecutionParameter), +} #[doc = "Properties of a user-invoked script"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ScriptExecutionProperties { @@ -1881,7 +1898,7 @@ pub struct ScriptExecutionProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub parameters: Vec, + pub parameters: Vec, #[doc = "Parameters that will be hidden/not visible to ARM, such as passwords and credentials"] #[serde( rename = "hiddenParameters", @@ -1889,7 +1906,7 @@ pub struct ScriptExecutionProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub hidden_parameters: Vec, + pub hidden_parameters: Vec, #[doc = "Error message if the script was able to run, but if the script itself had errors or powershell threw an exception"] #[serde(rename = "failureReason", default, skip_serializing_if = "Option::is_none")] pub failure_reason: Option, @@ -2389,7 +2406,7 @@ pub struct WorkloadNetworkDhcp { pub proxy_resource: ProxyResource, #[doc = "Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadNetworkDhcp { pub fn new() -> Self { @@ -2515,6 +2532,14 @@ pub mod workload_network_dhcp_entity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dhcpType")] +pub enum WorkloadNetworkDhcpEntityUnion { + #[serde(rename = "RELAY")] + Relay(WorkloadNetworkDhcpRelay), + #[serde(rename = "SERVER")] + Server(WorkloadNetworkDhcpServer), +} #[doc = "A list of NSX dhcp entities"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadNetworkDhcpList { diff --git a/services/mgmt/vmware/src/package_2021_12_01/models.rs b/services/mgmt/vmware/src/package_2021_12_01/models.rs index 0e8baa0a4b..1015e894d8 100644 --- a/services/mgmt/vmware/src/package_2021_12_01/models.rs +++ b/services/mgmt/vmware/src/package_2021_12_01/models.rs @@ -10,7 +10,7 @@ pub struct Addon { pub resource: Resource, #[doc = "The properties of an addon"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Addon { pub fn new() -> Self { @@ -163,6 +163,16 @@ pub mod addon_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "addonType")] +pub enum AddonPropertiesUnion { + #[serde(rename = "HCX")] + Hcx(AddonHcxProperties), + #[serde(rename = "SRM")] + Srm(AddonSrmProperties), + #[serde(rename = "VR")] + Vr(AddonVrProperties), +} #[doc = "The properties of a Site Recovery Manager (SRM) addon"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddonSrmProperties { @@ -1748,7 +1758,7 @@ pub struct PlacementPolicy { pub resource: Resource, #[doc = "Abstract placement policy properties"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl PlacementPolicy { pub fn new() -> Self { @@ -1901,6 +1911,12 @@ pub mod placement_policy_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum PlacementPolicyPropertiesUnion { + VmHost(VmHostPlacementPolicyProperties), + VmVm(VmVmPlacementPolicyProperties), +} #[doc = "An update of a DRS placement policy resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PlacementPolicyUpdate { @@ -2523,6 +2539,13 @@ pub mod script_execution_parameter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ScriptExecutionParameterUnion { + Credential(PsCredentialExecutionParameter), + SecureValue(ScriptSecureStringExecutionParameter), + Value(ScriptStringExecutionParameter), +} #[doc = "Properties of a user-invoked script"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ScriptExecutionProperties { @@ -2535,7 +2558,7 @@ pub struct ScriptExecutionProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub parameters: Vec, + pub parameters: Vec, #[doc = "Parameters that will be hidden/not visible to ARM, such as passwords and credentials"] #[serde( rename = "hiddenParameters", @@ -2543,7 +2566,7 @@ pub struct ScriptExecutionProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub hidden_parameters: Vec, + pub hidden_parameters: Vec, #[doc = "Error message if the script was able to run, but if the script itself had errors or powershell threw an exception"] #[serde(rename = "failureReason", default, skip_serializing_if = "Option::is_none")] pub failure_reason: Option, @@ -3203,7 +3226,7 @@ pub struct WorkloadNetworkDhcp { pub proxy_resource: ProxyResource, #[doc = "Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadNetworkDhcp { pub fn new() -> Self { @@ -3329,6 +3352,14 @@ pub mod workload_network_dhcp_entity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dhcpType")] +pub enum WorkloadNetworkDhcpEntityUnion { + #[serde(rename = "RELAY")] + Relay(WorkloadNetworkDhcpRelay), + #[serde(rename = "SERVER")] + Server(WorkloadNetworkDhcpServer), +} #[doc = "A list of NSX dhcp entities"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadNetworkDhcpList { diff --git a/services/mgmt/vmware/src/package_2022_05_01/models.rs b/services/mgmt/vmware/src/package_2022_05_01/models.rs index b149b08f7e..ce76e7ceb0 100644 --- a/services/mgmt/vmware/src/package_2022_05_01/models.rs +++ b/services/mgmt/vmware/src/package_2022_05_01/models.rs @@ -10,7 +10,7 @@ pub struct Addon { pub resource: Resource, #[doc = "The properties of an addon"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Addon { pub fn new() -> Self { @@ -184,6 +184,17 @@ pub mod addon_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "addonType")] +pub enum AddonPropertiesUnion { + Arc(AddonArcProperties), + #[serde(rename = "HCX")] + Hcx(AddonHcxProperties), + #[serde(rename = "SRM")] + Srm(AddonSrmProperties), + #[serde(rename = "VR")] + Vr(AddonVrProperties), +} #[doc = "The properties of a Site Recovery Manager (SRM) addon"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddonSrmProperties { @@ -1889,7 +1900,7 @@ pub struct PlacementPolicy { pub resource: Resource, #[doc = "Abstract placement policy properties"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl PlacementPolicy { pub fn new() -> Self { @@ -2044,6 +2055,12 @@ pub mod placement_policy_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum PlacementPolicyPropertiesUnion { + VmHost(VmHostPlacementPolicyProperties), + VmVm(VmVmPlacementPolicyProperties), +} #[doc = "An update of a DRS placement policy resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PlacementPolicyUpdate { @@ -2715,6 +2732,13 @@ pub mod script_execution_parameter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ScriptExecutionParameterUnion { + Credential(PsCredentialExecutionParameter), + SecureValue(ScriptSecureStringExecutionParameter), + Value(ScriptStringExecutionParameter), +} #[doc = "Properties of a user-invoked script"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ScriptExecutionProperties { @@ -2727,7 +2751,7 @@ pub struct ScriptExecutionProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub parameters: Vec, + pub parameters: Vec, #[doc = "Parameters that will be hidden/not visible to ARM, such as passwords and credentials"] #[serde( rename = "hiddenParameters", @@ -2735,7 +2759,7 @@ pub struct ScriptExecutionProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub hidden_parameters: Vec, + pub hidden_parameters: Vec, #[doc = "Error message if the script was able to run, but if the script itself had errors or powershell threw an exception"] #[serde(rename = "failureReason", default, skip_serializing_if = "Option::is_none")] pub failure_reason: Option, @@ -3422,7 +3446,7 @@ pub struct WorkloadNetworkDhcp { pub proxy_resource: ProxyResource, #[doc = "Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadNetworkDhcp { pub fn new() -> Self { @@ -3550,6 +3574,14 @@ pub mod workload_network_dhcp_entity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dhcpType")] +pub enum WorkloadNetworkDhcpEntityUnion { + #[serde(rename = "RELAY")] + Relay(WorkloadNetworkDhcpRelay), + #[serde(rename = "SERVER")] + Server(WorkloadNetworkDhcpServer), +} #[doc = "A list of NSX dhcp entities"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadNetworkDhcpList { diff --git a/services/mgmt/vmware/src/package_2023_03_01/models.rs b/services/mgmt/vmware/src/package_2023_03_01/models.rs index 589c33d398..6279b738f4 100644 --- a/services/mgmt/vmware/src/package_2023_03_01/models.rs +++ b/services/mgmt/vmware/src/package_2023_03_01/models.rs @@ -10,7 +10,7 @@ pub struct Addon { pub resource: Resource, #[doc = "The properties of an addon"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl Addon { pub fn new() -> Self { @@ -184,6 +184,17 @@ pub mod addon_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "addonType")] +pub enum AddonPropertiesUnion { + Arc(AddonArcProperties), + #[serde(rename = "HCX")] + Hcx(AddonHcxProperties), + #[serde(rename = "SRM")] + Srm(AddonSrmProperties), + #[serde(rename = "VR")] + Vr(AddonVrProperties), +} #[doc = "The properties of a Site Recovery Manager (SRM) addon"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddonSrmProperties { @@ -1889,7 +1900,7 @@ pub struct PlacementPolicy { pub resource: Resource, #[doc = "Abstract placement policy properties"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl PlacementPolicy { pub fn new() -> Self { @@ -2044,6 +2055,12 @@ pub mod placement_policy_properties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum PlacementPolicyPropertiesUnion { + VmHost(VmHostPlacementPolicyProperties), + VmVm(VmVmPlacementPolicyProperties), +} #[doc = "An update of a DRS placement policy resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PlacementPolicyUpdate { @@ -2723,6 +2740,13 @@ pub mod script_execution_parameter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ScriptExecutionParameterUnion { + Credential(PsCredentialExecutionParameter), + SecureValue(ScriptSecureStringExecutionParameter), + Value(ScriptStringExecutionParameter), +} #[doc = "Properties of a user-invoked script"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ScriptExecutionProperties { @@ -2735,7 +2759,7 @@ pub struct ScriptExecutionProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub parameters: Vec, + pub parameters: Vec, #[doc = "Parameters that will be hidden/not visible to ARM, such as passwords and credentials"] #[serde( rename = "hiddenParameters", @@ -2743,7 +2767,7 @@ pub struct ScriptExecutionProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub hidden_parameters: Vec, + pub hidden_parameters: Vec, #[doc = "Error message if the script was able to run, but if the script itself had errors or powershell threw an exception"] #[serde(rename = "failureReason", default, skip_serializing_if = "Option::is_none")] pub failure_reason: Option, @@ -3430,7 +3454,7 @@ pub struct WorkloadNetworkDhcp { pub proxy_resource: ProxyResource, #[doc = "Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkloadNetworkDhcp { pub fn new() -> Self { @@ -3558,6 +3582,14 @@ pub mod workload_network_dhcp_entity { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "dhcpType")] +pub enum WorkloadNetworkDhcpEntityUnion { + #[serde(rename = "RELAY")] + Relay(WorkloadNetworkDhcpRelay), + #[serde(rename = "SERVER")] + Server(WorkloadNetworkDhcpServer), +} #[doc = "A list of NSX dhcp entities"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkloadNetworkDhcpList { diff --git a/services/mgmt/webpubsub/src/package_2022_08_01_preview/models.rs b/services/mgmt/webpubsub/src/package_2022_08_01_preview/models.rs index c23fffd86b..e9ed9c6764 100644 --- a/services/mgmt/webpubsub/src/package_2022_08_01_preview/models.rs +++ b/services/mgmt/webpubsub/src/package_2022_08_01_preview/models.rs @@ -321,12 +321,12 @@ impl EventHubEndpoint { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListener { #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] - pub filter: EventListenerFilter, + pub filter: EventListenerFilterUnion, #[doc = "An endpoint specifying where Web PubSub should send events to."] - pub endpoint: EventListenerEndpoint, + pub endpoint: EventListenerEndpointUnion, } impl EventListener { - pub fn new(filter: EventListenerFilter, endpoint: EventListenerEndpoint) -> Self { + pub fn new(filter: EventListenerFilterUnion, endpoint: EventListenerEndpointUnion) -> Self { Self { filter, endpoint } } } @@ -378,6 +378,11 @@ pub mod event_listener_endpoint { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerEndpointUnion { + EventHub(EventHubEndpoint), +} #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListenerFilter { @@ -426,6 +431,11 @@ pub mod event_listener_filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerFilterUnion { + EventName(EventNameFilter), +} #[doc = "Filter events by their name."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventNameFilter { diff --git a/services/mgmt/webpubsub/src/package_2023_02_01/models.rs b/services/mgmt/webpubsub/src/package_2023_02_01/models.rs index c23fffd86b..e9ed9c6764 100644 --- a/services/mgmt/webpubsub/src/package_2023_02_01/models.rs +++ b/services/mgmt/webpubsub/src/package_2023_02_01/models.rs @@ -321,12 +321,12 @@ impl EventHubEndpoint { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListener { #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] - pub filter: EventListenerFilter, + pub filter: EventListenerFilterUnion, #[doc = "An endpoint specifying where Web PubSub should send events to."] - pub endpoint: EventListenerEndpoint, + pub endpoint: EventListenerEndpointUnion, } impl EventListener { - pub fn new(filter: EventListenerFilter, endpoint: EventListenerEndpoint) -> Self { + pub fn new(filter: EventListenerFilterUnion, endpoint: EventListenerEndpointUnion) -> Self { Self { filter, endpoint } } } @@ -378,6 +378,11 @@ pub mod event_listener_endpoint { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerEndpointUnion { + EventHub(EventHubEndpoint), +} #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListenerFilter { @@ -426,6 +431,11 @@ pub mod event_listener_filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerFilterUnion { + EventName(EventNameFilter), +} #[doc = "Filter events by their name."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventNameFilter { diff --git a/services/mgmt/webpubsub/src/package_2023_03_01_preview/models.rs b/services/mgmt/webpubsub/src/package_2023_03_01_preview/models.rs index 9d5899e373..a72f0ac124 100644 --- a/services/mgmt/webpubsub/src/package_2023_03_01_preview/models.rs +++ b/services/mgmt/webpubsub/src/package_2023_03_01_preview/models.rs @@ -313,12 +313,12 @@ impl EventHubEndpoint { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListener { #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] - pub filter: EventListenerFilter, + pub filter: EventListenerFilterUnion, #[doc = "An endpoint specifying where Web PubSub should send events to."] - pub endpoint: EventListenerEndpoint, + pub endpoint: EventListenerEndpointUnion, } impl EventListener { - pub fn new(filter: EventListenerFilter, endpoint: EventListenerEndpoint) -> Self { + pub fn new(filter: EventListenerFilterUnion, endpoint: EventListenerEndpointUnion) -> Self { Self { filter, endpoint } } } @@ -370,6 +370,11 @@ pub mod event_listener_endpoint { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerEndpointUnion { + EventHub(EventHubEndpoint), +} #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListenerFilter { @@ -418,6 +423,11 @@ pub mod event_listener_filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerFilterUnion { + EventName(EventNameFilter), +} #[doc = "Filter events by their name."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventNameFilter { diff --git a/services/mgmt/webpubsub/src/package_2023_06_01_preview/models.rs b/services/mgmt/webpubsub/src/package_2023_06_01_preview/models.rs index 044f09114e..ae8ea777b2 100644 --- a/services/mgmt/webpubsub/src/package_2023_06_01_preview/models.rs +++ b/services/mgmt/webpubsub/src/package_2023_06_01_preview/models.rs @@ -313,12 +313,12 @@ impl EventHubEndpoint { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListener { #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] - pub filter: EventListenerFilter, + pub filter: EventListenerFilterUnion, #[doc = "An endpoint specifying where Web PubSub should send events to."] - pub endpoint: EventListenerEndpoint, + pub endpoint: EventListenerEndpointUnion, } impl EventListener { - pub fn new(filter: EventListenerFilter, endpoint: EventListenerEndpoint) -> Self { + pub fn new(filter: EventListenerFilterUnion, endpoint: EventListenerEndpointUnion) -> Self { Self { filter, endpoint } } } @@ -370,6 +370,11 @@ pub mod event_listener_endpoint { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerEndpointUnion { + EventHub(EventHubEndpoint), +} #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListenerFilter { @@ -418,6 +423,11 @@ pub mod event_listener_filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerFilterUnion { + EventName(EventNameFilter), +} #[doc = "Filter events by their name."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventNameFilter { diff --git a/services/mgmt/webpubsub/src/package_2023_08_01_preview/models.rs b/services/mgmt/webpubsub/src/package_2023_08_01_preview/models.rs index 125ca670bf..38b9237abf 100644 --- a/services/mgmt/webpubsub/src/package_2023_08_01_preview/models.rs +++ b/services/mgmt/webpubsub/src/package_2023_08_01_preview/models.rs @@ -313,12 +313,12 @@ impl EventHubEndpoint { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListener { #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] - pub filter: EventListenerFilter, + pub filter: EventListenerFilterUnion, #[doc = "An endpoint specifying where Web PubSub should send events to."] - pub endpoint: EventListenerEndpoint, + pub endpoint: EventListenerEndpointUnion, } impl EventListener { - pub fn new(filter: EventListenerFilter, endpoint: EventListenerEndpoint) -> Self { + pub fn new(filter: EventListenerFilterUnion, endpoint: EventListenerEndpointUnion) -> Self { Self { filter, endpoint } } } @@ -370,6 +370,11 @@ pub mod event_listener_endpoint { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerEndpointUnion { + EventHub(EventHubEndpoint), +} #[doc = "A base class for event filter which determines whether an event should be sent to an event listener."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventListenerFilter { @@ -418,6 +423,11 @@ pub mod event_listener_filter { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventListenerFilterUnion { + EventName(EventNameFilter), +} #[doc = "Filter events by their name."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventNameFilter { diff --git a/services/mgmt/workloads/src/package_2021_12_01_preview/mod.rs b/services/mgmt/workloads/src/package_2021_12_01_preview/mod.rs index 7439b35e07..6b22c09caa 100644 --- a/services/mgmt/workloads/src/package_2021_12_01_preview/mod.rs +++ b/services/mgmt/workloads/src/package_2021_12_01_preview/mod.rs @@ -1649,9 +1649,9 @@ pub mod sap_sizing_recommendations { #[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::SapSizingRecommendationResult = serde_json::from_slice(&bytes)?; + let body: models::SapSizingRecommendationResultUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1740,8 +1740,8 @@ pub mod sap_sizing_recommendations { } } 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`."] diff --git a/services/mgmt/workloads/src/package_2021_12_01_preview/models.rs b/services/mgmt/workloads/src/package_2021_12_01_preview/models.rs index 90133b8245..53ced194f2 100644 --- a/services/mgmt/workloads/src/package_2021_12_01_preview/models.rs +++ b/services/mgmt/workloads/src/package_2021_12_01_preview/models.rs @@ -341,10 +341,10 @@ pub struct DeploymentConfiguration { pub app_location: Option, #[doc = "Deploy SAP Infrastructure Details."] #[serde(rename = "infrastructureConfiguration", default, skip_serializing_if = "Option::is_none")] - pub infrastructure_configuration: Option, + pub infrastructure_configuration: Option, #[doc = "The SAP Software configuration Input."] #[serde(rename = "softwareConfiguration", default, skip_serializing_if = "Option::is_none")] - pub software_configuration: Option, + pub software_configuration: Option, } impl DeploymentConfiguration { pub fn new(sap_configuration: SapConfiguration) -> Self { @@ -403,10 +403,10 @@ pub struct DeploymentWithOsConfiguration { pub app_location: Option, #[doc = "Deploy SAP Infrastructure Details."] #[serde(rename = "infrastructureConfiguration", default, skip_serializing_if = "Option::is_none")] - pub infrastructure_configuration: Option, + pub infrastructure_configuration: Option, #[doc = "The SAP Software configuration Input."] #[serde(rename = "softwareConfiguration", default, skip_serializing_if = "Option::is_none")] - pub software_configuration: Option, + pub software_configuration: Option, #[doc = "Defines the OS and SAP Configurations for Deployment"] #[serde(rename = "osSapConfiguration", default, skip_serializing_if = "Option::is_none")] pub os_sap_configuration: Option, @@ -824,6 +824,13 @@ impl FileShareConfiguration { Self { configuration_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "configurationType")] +pub enum FileShareConfigurationUnion { + CreateAndMount(CreateAndMountFileShareConfiguration), + Mount(MountFileShareConfiguration), + Skip(SkipFileShareConfiguration), +} #[doc = "The type of file share config."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "FileShareConfigurationType")] @@ -1088,6 +1095,12 @@ impl InfrastructureConfiguration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "deploymentType")] +pub enum InfrastructureConfigurationUnion { + SingleServer(SingleServerConfiguration), + ThreeTier(ThreeTierConfiguration), +} #[doc = "Specifies the Linux operating system settings on the virtual machine.

For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LinuxConfiguration { @@ -1504,6 +1517,12 @@ pub mod os_configuration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "osType")] +pub enum OsConfigurationUnion { + Linux(LinuxConfiguration), + Windows(WindowsConfiguration), +} #[doc = "Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OsProfile { @@ -1515,7 +1534,7 @@ pub struct OsProfile { pub admin_password: Option, #[doc = "Defines the OS configuration."] #[serde(rename = "osConfiguration", default, skip_serializing_if = "Option::is_none")] - pub os_configuration: Option, + pub os_configuration: Option, } impl OsProfile { pub fn new() -> Self { @@ -2027,7 +2046,7 @@ pub struct ProviderInstanceProperties { pub errors: Option, #[doc = "Gets or sets the provider specific properties."] #[serde(rename = "providerSettings", default, skip_serializing_if = "Option::is_none")] - pub provider_settings: Option, + pub provider_settings: Option, } impl ProviderInstanceProperties { pub fn new() -> Self { @@ -2096,6 +2115,17 @@ impl ProviderSpecificProperties { Self { provider_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "providerType")] +pub enum ProviderSpecificPropertiesUnion { + Db2(Db2ProviderInstanceProperties), + SapHana(HanaDbProviderInstanceProperties), + MsSqlServer(MsSqlServerProviderInstanceProperties), + PrometheusHaCluster(PrometheusHaClusterProviderInstanceProperties), + #[serde(rename = "PrometheusOS")] + PrometheusOs(PrometheusOsProviderInstanceProperties), + SapNetWeaver(SapNetWeaverProviderInstanceProperties), +} #[doc = "Defines the provisioning states."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ProvisioningState")] @@ -2459,6 +2489,14 @@ impl SapConfiguration { Self { configuration_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "configurationType")] +pub enum SapConfigurationUnion { + Deployment(DeploymentConfiguration), + #[serde(rename = "DeploymentWithOSConfig")] + DeploymentWithOsConfig(DeploymentWithOsConfiguration), + Discovery(DiscoveryConfiguration), +} #[doc = "Define the Database resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SapDatabaseInstance { @@ -2807,6 +2845,12 @@ impl SapSizingRecommendationResult { Self { deployment_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "deploymentType")] +pub enum SapSizingRecommendationResultUnion { + SingleServer(SingleServerRecommendationResult), + ThreeTier(ThreeTierRecommendationResult), +} #[doc = "The SAP software installation Type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "SapSoftwareInstallationType")] @@ -2989,7 +3033,7 @@ pub struct SapVirtualInstanceProperties { #[serde(rename = "sapProduct")] pub sap_product: SapProductType, #[doc = "The SAP Configuration."] - pub configuration: SapConfiguration, + pub configuration: SapConfigurationUnion, #[doc = "Managed resource group configuration"] #[serde(rename = "managedResourceGroupConfiguration", default, skip_serializing_if = "Option::is_none")] pub managed_resource_group_configuration: Option, @@ -3010,7 +3054,7 @@ pub struct SapVirtualInstanceProperties { pub errors: Option, } impl SapVirtualInstanceProperties { - pub fn new(environment: EnvironmentType, sap_product: SapProductType, configuration: SapConfiguration) -> Self { + pub fn new(environment: EnvironmentType, sap_product: SapProductType, configuration: SapConfigurationUnion) -> Self { Self { environment, sap_product, @@ -3772,6 +3816,14 @@ impl SoftwareConfiguration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "softwareInstallationType")] +pub enum SoftwareConfigurationUnion { + External(ExternalInstallationSoftwareConfiguration), + #[serde(rename = "SAPInstallWithoutOSConfig")] + SapInstallWithoutOsConfig(SapInstallWithoutOsConfigSoftwareConfiguration), + ServiceInitiated(ServiceInitiatedSoftwareConfiguration), +} #[doc = "SSH configuration for Linux based VMs running on Azure"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SshConfiguration { @@ -3872,7 +3924,7 @@ impl StopRequest { pub struct StorageConfiguration { #[doc = "File Share configuration details, populated with information on storage configuration mounted on the VIS. The createAndMount option is selected in case of missing input."] #[serde(rename = "transportFileShareConfiguration", default, skip_serializing_if = "Option::is_none")] - pub transport_file_share_configuration: Option, + pub transport_file_share_configuration: Option, } impl StorageConfiguration { pub fn new() -> Self { diff --git a/services/mgmt/workloads/src/package_2023_04/mod.rs b/services/mgmt/workloads/src/package_2023_04/mod.rs index 94146d1849..904c935b28 100644 --- a/services/mgmt/workloads/src/package_2023_04/mod.rs +++ b/services/mgmt/workloads/src/package_2023_04/mod.rs @@ -203,9 +203,9 @@ pub mod sap_sizing_recommendations { #[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::SapSizingRecommendationResult = serde_json::from_slice(&bytes)?; + let body: models::SapSizingRecommendationResultUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -294,8 +294,8 @@ pub mod sap_sizing_recommendations { } } 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`."] diff --git a/services/mgmt/workloads/src/package_2023_04/models.rs b/services/mgmt/workloads/src/package_2023_04/models.rs index 8dd3c216c0..077624e741 100644 --- a/services/mgmt/workloads/src/package_2023_04/models.rs +++ b/services/mgmt/workloads/src/package_2023_04/models.rs @@ -468,10 +468,10 @@ pub struct DeploymentConfiguration { pub app_location: Option, #[doc = "Deploy SAP Infrastructure Details."] #[serde(rename = "infrastructureConfiguration", default, skip_serializing_if = "Option::is_none")] - pub infrastructure_configuration: Option, + pub infrastructure_configuration: Option, #[doc = "The SAP Software configuration Input."] #[serde(rename = "softwareConfiguration", default, skip_serializing_if = "Option::is_none")] - pub software_configuration: Option, + pub software_configuration: Option, } impl DeploymentConfiguration { pub fn new(sap_configuration: SapConfiguration) -> Self { @@ -530,10 +530,10 @@ pub struct DeploymentWithOsConfiguration { pub app_location: Option, #[doc = "Deploy SAP Infrastructure Details."] #[serde(rename = "infrastructureConfiguration", default, skip_serializing_if = "Option::is_none")] - pub infrastructure_configuration: Option, + pub infrastructure_configuration: Option, #[doc = "The SAP Software configuration Input."] #[serde(rename = "softwareConfiguration", default, skip_serializing_if = "Option::is_none")] - pub software_configuration: Option, + pub software_configuration: Option, #[doc = "Defines the OS and SAP Configurations for Deployment"] #[serde(rename = "osSapConfiguration", default, skip_serializing_if = "Option::is_none")] pub os_sap_configuration: Option, @@ -985,6 +985,13 @@ impl FileShareConfiguration { Self { configuration_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "configurationType")] +pub enum FileShareConfigurationUnion { + CreateAndMount(CreateAndMountFileShareConfiguration), + Mount(MountFileShareConfiguration), + Skip(SkipFileShareConfiguration), +} #[doc = "The type of file share config."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "FileShareConfigurationType")] @@ -1243,6 +1250,12 @@ impl InfrastructureConfiguration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "deploymentType")] +pub enum InfrastructureConfigurationUnion { + SingleServer(SingleServerConfiguration), + ThreeTier(ThreeTierConfiguration), +} #[doc = "Specifies the Linux operating system settings on the virtual machine.

For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LinuxConfiguration { @@ -1742,6 +1755,12 @@ pub mod os_configuration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "osType")] +pub enum OsConfigurationUnion { + Linux(LinuxConfiguration), + Windows(WindowsConfiguration), +} #[doc = "Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OsProfile { @@ -1753,7 +1772,7 @@ pub struct OsProfile { pub admin_password: Option, #[doc = "Defines the OS configuration."] #[serde(rename = "osConfiguration", default, skip_serializing_if = "Option::is_none")] - pub os_configuration: Option, + pub os_configuration: Option, } impl OsProfile { pub fn new() -> Self { @@ -2255,7 +2274,7 @@ pub struct ProviderInstanceProperties { pub errors: Option, #[doc = "Gets or sets the provider specific properties."] #[serde(rename = "providerSettings", default, skip_serializing_if = "Option::is_none")] - pub provider_settings: Option, + pub provider_settings: Option, } impl ProviderInstanceProperties { pub fn new() -> Self { @@ -2324,6 +2343,17 @@ impl ProviderSpecificProperties { Self { provider_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "providerType")] +pub enum ProviderSpecificPropertiesUnion { + Db2(Db2ProviderInstanceProperties), + SapHana(HanaDbProviderInstanceProperties), + MsSqlServer(MsSqlServerProviderInstanceProperties), + PrometheusHaCluster(PrometheusHaClusterProviderInstanceProperties), + #[serde(rename = "PrometheusOS")] + PrometheusOs(PrometheusOsProviderInstanceProperties), + SapNetWeaver(SapNetWeaverProviderInstanceProperties), +} #[doc = "Defines the provisioning states."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ProvisioningState")] @@ -2664,6 +2694,14 @@ impl SapConfiguration { Self { configuration_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "configurationType")] +pub enum SapConfigurationUnion { + Deployment(DeploymentConfiguration), + #[serde(rename = "DeploymentWithOSConfig")] + DeploymentWithOsConfig(DeploymentWithOsConfiguration), + Discovery(DiscoveryConfiguration), +} #[doc = "Define the Database resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SapDatabaseInstance { @@ -2997,6 +3035,12 @@ impl SapSizingRecommendationResult { Self { deployment_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "deploymentType")] +pub enum SapSizingRecommendationResultUnion { + SingleServer(SingleServerRecommendationResult), + ThreeTier(ThreeTierRecommendationResult), +} #[doc = "The SAP software installation Type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "SapSoftwareInstallationType")] @@ -3179,7 +3223,7 @@ pub struct SapVirtualInstanceProperties { #[serde(rename = "sapProduct")] pub sap_product: SapProductType, #[doc = "The SAP Configuration."] - pub configuration: SapConfiguration, + pub configuration: SapConfigurationUnion, #[doc = "Managed resource group configuration"] #[serde(rename = "managedResourceGroupConfiguration", default, skip_serializing_if = "Option::is_none")] pub managed_resource_group_configuration: Option, @@ -3200,7 +3244,7 @@ pub struct SapVirtualInstanceProperties { pub errors: Option, } impl SapVirtualInstanceProperties { - pub fn new(environment: EnvironmentType, sap_product: SapProductType, configuration: SapConfiguration) -> Self { + pub fn new(environment: EnvironmentType, sap_product: SapProductType, configuration: SapConfigurationUnion) -> Self { Self { environment, sap_product, @@ -3627,7 +3671,7 @@ pub struct SingleServerConfiguration { pub db_disk_configuration: Option, #[doc = "The resource-names input to specify custom names for underlying azure resources that are part of a single server SAP system."] #[serde(rename = "customResourceNames", default, skip_serializing_if = "Option::is_none")] - pub custom_resource_names: Option, + pub custom_resource_names: Option, } impl SingleServerConfiguration { pub fn new( @@ -3658,6 +3702,11 @@ impl SingleServerCustomResourceNames { Self { naming_pattern_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "namingPatternType")] +pub enum SingleServerCustomResourceNamesUnion { + FullResourceName(SingleServerFullResourceNames), +} #[doc = "The resource name object where the specified values will be full resource names of the corresponding resources in a single server SAP system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SingleServerFullResourceNames { @@ -3717,6 +3766,14 @@ impl SoftwareConfiguration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "softwareInstallationType")] +pub enum SoftwareConfigurationUnion { + External(ExternalInstallationSoftwareConfiguration), + #[serde(rename = "SAPInstallWithoutOSConfig")] + SapInstallWithoutOsConfig(SapInstallWithoutOsConfigSoftwareConfiguration), + ServiceInitiated(ServiceInitiatedSoftwareConfiguration), +} #[doc = "SSH configuration for Linux based VMs running on Azure"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SshConfiguration { @@ -3817,7 +3874,7 @@ impl StopRequest { pub struct StorageConfiguration { #[doc = "File Share configuration details, populated with information on storage configuration mounted on the VIS. The createAndMount option is selected in case of missing input."] #[serde(rename = "transportFileShareConfiguration", default, skip_serializing_if = "Option::is_none")] - pub transport_file_share_configuration: Option, + pub transport_file_share_configuration: Option, } impl StorageConfiguration { pub fn new() -> Self { @@ -3872,7 +3929,7 @@ pub struct ThreeTierConfiguration { pub storage_configuration: Option, #[doc = "The resource-names input to specify custom names for underlying azure resources that are part of a three tier SAP system."] #[serde(rename = "customResourceNames", default, skip_serializing_if = "Option::is_none")] - pub custom_resource_names: Option, + pub custom_resource_names: Option, } impl ThreeTierConfiguration { pub fn new( @@ -3905,6 +3962,11 @@ impl ThreeTierCustomResourceNames { Self { naming_pattern_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "namingPatternType")] +pub enum ThreeTierCustomResourceNamesUnion { + FullResourceName(ThreeTierFullResourceNames), +} #[doc = "The resource name object where the specified values will be full resource names of the corresponding resources in a three tier SAP system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ThreeTierFullResourceNames { diff --git a/services/mgmt/workloads/src/package_preview_2022_11/mod.rs b/services/mgmt/workloads/src/package_preview_2022_11/mod.rs index 0f58891b2e..46113821e8 100644 --- a/services/mgmt/workloads/src/package_preview_2022_11/mod.rs +++ b/services/mgmt/workloads/src/package_preview_2022_11/mod.rs @@ -203,9 +203,9 @@ pub mod sap_sizing_recommendations { #[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::SapSizingRecommendationResult = serde_json::from_slice(&bytes)?; + let body: models::SapSizingRecommendationResultUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -294,8 +294,8 @@ pub mod sap_sizing_recommendations { } } 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`."] diff --git a/services/mgmt/workloads/src/package_preview_2022_11/models.rs b/services/mgmt/workloads/src/package_preview_2022_11/models.rs index d6f58a9e20..2f84742ffd 100644 --- a/services/mgmt/workloads/src/package_preview_2022_11/models.rs +++ b/services/mgmt/workloads/src/package_preview_2022_11/models.rs @@ -468,10 +468,10 @@ pub struct DeploymentConfiguration { pub app_location: Option, #[doc = "Deploy SAP Infrastructure Details."] #[serde(rename = "infrastructureConfiguration", default, skip_serializing_if = "Option::is_none")] - pub infrastructure_configuration: Option, + pub infrastructure_configuration: Option, #[doc = "The SAP Software configuration Input."] #[serde(rename = "softwareConfiguration", default, skip_serializing_if = "Option::is_none")] - pub software_configuration: Option, + pub software_configuration: Option, } impl DeploymentConfiguration { pub fn new(sap_configuration: SapConfiguration) -> Self { @@ -530,10 +530,10 @@ pub struct DeploymentWithOsConfiguration { pub app_location: Option, #[doc = "Deploy SAP Infrastructure Details."] #[serde(rename = "infrastructureConfiguration", default, skip_serializing_if = "Option::is_none")] - pub infrastructure_configuration: Option, + pub infrastructure_configuration: Option, #[doc = "The SAP Software configuration Input."] #[serde(rename = "softwareConfiguration", default, skip_serializing_if = "Option::is_none")] - pub software_configuration: Option, + pub software_configuration: Option, #[doc = "Defines the OS and SAP Configurations for Deployment"] #[serde(rename = "osSapConfiguration", default, skip_serializing_if = "Option::is_none")] pub os_sap_configuration: Option, @@ -985,6 +985,13 @@ impl FileShareConfiguration { Self { configuration_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "configurationType")] +pub enum FileShareConfigurationUnion { + CreateAndMount(CreateAndMountFileShareConfiguration), + Mount(MountFileShareConfiguration), + Skip(SkipFileShareConfiguration), +} #[doc = "The type of file share config."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "FileShareConfigurationType")] @@ -1249,6 +1256,12 @@ impl InfrastructureConfiguration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "deploymentType")] +pub enum InfrastructureConfigurationUnion { + SingleServer(SingleServerConfiguration), + ThreeTier(ThreeTierConfiguration), +} #[doc = "Specifies the Linux operating system settings on the virtual machine.

For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LinuxConfiguration { @@ -1748,6 +1761,12 @@ pub mod os_configuration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "osType")] +pub enum OsConfigurationUnion { + Linux(LinuxConfiguration), + Windows(WindowsConfiguration), +} #[doc = "Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OsProfile { @@ -1759,7 +1778,7 @@ pub struct OsProfile { pub admin_password: Option, #[doc = "Defines the OS configuration."] #[serde(rename = "osConfiguration", default, skip_serializing_if = "Option::is_none")] - pub os_configuration: Option, + pub os_configuration: Option, } impl OsProfile { pub fn new() -> Self { @@ -2261,7 +2280,7 @@ pub struct ProviderInstanceProperties { pub errors: Option, #[doc = "Gets or sets the provider specific properties."] #[serde(rename = "providerSettings", default, skip_serializing_if = "Option::is_none")] - pub provider_settings: Option, + pub provider_settings: Option, } impl ProviderInstanceProperties { pub fn new() -> Self { @@ -2330,6 +2349,17 @@ impl ProviderSpecificProperties { Self { provider_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "providerType")] +pub enum ProviderSpecificPropertiesUnion { + Db2(Db2ProviderInstanceProperties), + SapHana(HanaDbProviderInstanceProperties), + MsSqlServer(MsSqlServerProviderInstanceProperties), + PrometheusHaCluster(PrometheusHaClusterProviderInstanceProperties), + #[serde(rename = "PrometheusOS")] + PrometheusOs(PrometheusOsProviderInstanceProperties), + SapNetWeaver(SapNetWeaverProviderInstanceProperties), +} #[doc = "Defines the provisioning states."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ProvisioningState")] @@ -2670,6 +2700,14 @@ impl SapConfiguration { Self { configuration_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "configurationType")] +pub enum SapConfigurationUnion { + Deployment(DeploymentConfiguration), + #[serde(rename = "DeploymentWithOSConfig")] + DeploymentWithOsConfig(DeploymentWithOsConfiguration), + Discovery(DiscoveryConfiguration), +} #[doc = "Define the Database resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SapDatabaseInstance { @@ -3003,6 +3041,12 @@ impl SapSizingRecommendationResult { Self { deployment_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "deploymentType")] +pub enum SapSizingRecommendationResultUnion { + SingleServer(SingleServerRecommendationResult), + ThreeTier(ThreeTierRecommendationResult), +} #[doc = "The SAP software installation Type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "SapSoftwareInstallationType")] @@ -3185,7 +3229,7 @@ pub struct SapVirtualInstanceProperties { #[serde(rename = "sapProduct")] pub sap_product: SapProductType, #[doc = "The SAP Configuration."] - pub configuration: SapConfiguration, + pub configuration: SapConfigurationUnion, #[doc = "Managed resource group configuration"] #[serde(rename = "managedResourceGroupConfiguration", default, skip_serializing_if = "Option::is_none")] pub managed_resource_group_configuration: Option, @@ -3206,7 +3250,7 @@ pub struct SapVirtualInstanceProperties { pub errors: Option, } impl SapVirtualInstanceProperties { - pub fn new(environment: EnvironmentType, sap_product: SapProductType, configuration: SapConfiguration) -> Self { + pub fn new(environment: EnvironmentType, sap_product: SapProductType, configuration: SapConfigurationUnion) -> Self { Self { environment, sap_product, @@ -3633,7 +3677,7 @@ pub struct SingleServerConfiguration { pub db_disk_configuration: Option, #[doc = "The resource-names input to specify custom names for underlying azure resources that are part of a single server SAP system."] #[serde(rename = "customResourceNames", default, skip_serializing_if = "Option::is_none")] - pub custom_resource_names: Option, + pub custom_resource_names: Option, } impl SingleServerConfiguration { pub fn new( @@ -3664,6 +3708,11 @@ impl SingleServerCustomResourceNames { Self { naming_pattern_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "namingPatternType")] +pub enum SingleServerCustomResourceNamesUnion { + FullResourceName(SingleServerFullResourceNames), +} #[doc = "The resource name object where the specified values will be full resource names of the corresponding resources in a single server SAP system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SingleServerFullResourceNames { @@ -3723,6 +3772,14 @@ impl SoftwareConfiguration { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "softwareInstallationType")] +pub enum SoftwareConfigurationUnion { + External(ExternalInstallationSoftwareConfiguration), + #[serde(rename = "SAPInstallWithoutOSConfig")] + SapInstallWithoutOsConfig(SapInstallWithoutOsConfigSoftwareConfiguration), + ServiceInitiated(ServiceInitiatedSoftwareConfiguration), +} #[doc = "SSH configuration for Linux based VMs running on Azure"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SshConfiguration { @@ -3823,7 +3880,7 @@ impl StopRequest { pub struct StorageConfiguration { #[doc = "File Share configuration details, populated with information on storage configuration mounted on the VIS. The createAndMount option is selected in case of missing input."] #[serde(rename = "transportFileShareConfiguration", default, skip_serializing_if = "Option::is_none")] - pub transport_file_share_configuration: Option, + pub transport_file_share_configuration: Option, } impl StorageConfiguration { pub fn new() -> Self { @@ -3878,7 +3935,7 @@ pub struct ThreeTierConfiguration { pub storage_configuration: Option, #[doc = "The resource-names input to specify custom names for underlying azure resources that are part of a three tier SAP system."] #[serde(rename = "customResourceNames", default, skip_serializing_if = "Option::is_none")] - pub custom_resource_names: Option, + pub custom_resource_names: Option, } impl ThreeTierConfiguration { pub fn new( @@ -3911,6 +3968,11 @@ impl ThreeTierCustomResourceNames { Self { naming_pattern_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "namingPatternType")] +pub enum ThreeTierCustomResourceNamesUnion { + FullResourceName(ThreeTierFullResourceNames), +} #[doc = "The resource name object where the specified values will be full resource names of the corresponding resources in a three tier SAP system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ThreeTierFullResourceNames { diff --git a/services/svc/agrifood/src/package_2023_06_01_preview/models.rs b/services/svc/agrifood/src/package_2023_06_01_preview/models.rs index 4845885ef6..a040b3028c 100644 --- a/services/svc/agrifood/src/package_2023_06_01_preview/models.rs +++ b/services/svc/agrifood/src/package_2023_06_01_preview/models.rs @@ -305,6 +305,12 @@ impl AuthCredentials { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AuthCredentialsUnion { + ApiKeyAuthCredentials(ApiKeyAuthCredentials), + OAuthClientCredentials(OAuthClientCredentials), +} #[doc = "CredentialTypeEnum."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AuthCredentialsKind")] @@ -619,7 +625,7 @@ pub mod biomass_model_job { pub struct Boundary { #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Indicates the type of boundary belonging to a parent."] #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] pub type_: Option, @@ -628,10 +634,10 @@ pub struct Boundary { pub crs: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub centroid: Option, + pub centroid: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub bbox: Option, + pub bbox: Option, #[doc = "Party Id."] #[serde(rename = "partyId", default, skip_serializing_if = "Option::is_none")] pub party_id: Option, @@ -1855,6 +1861,13 @@ impl GeoJsonObject { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum GeoJsonObjectUnion { + MultiPolygon(MultiPolygon), + Point(Point), + Polygon(Polygon), +} #[doc = "GeoJSON object type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "GeoJsonObjectType")] @@ -3929,7 +3942,7 @@ pub struct SearchBoundaryQuery { pub max_area: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, } impl SearchBoundaryQuery { pub fn new() -> Self { @@ -4004,7 +4017,7 @@ pub struct SearchFeaturesQuery { pub end_date_time: time::OffsetDateTime, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub intersects: Option, + pub intersects: Option, #[doc = "Only features that have a geometry that intersects the bounding box are selected.\r\nThe bounding box is provided as four numbers. The coordinate reference system of the values is WGS84 longitude/latitude."] #[serde( default, diff --git a/services/svc/agrifood/src/package_2023_07_01_preview/models.rs b/services/svc/agrifood/src/package_2023_07_01_preview/models.rs index 6fc4062764..adb0dea92d 100644 --- a/services/svc/agrifood/src/package_2023_07_01_preview/models.rs +++ b/services/svc/agrifood/src/package_2023_07_01_preview/models.rs @@ -90,7 +90,7 @@ pub struct ApplicationData { pub source: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Name to identify resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -364,6 +364,12 @@ impl AuthCredentials { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AuthCredentialsUnion { + ApiKeyAuthCredentials(ApiKeyAuthCredentials), + OAuthClientCredentials(OAuthClientCredentials), +} #[doc = "CredentialTypeEnum."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AuthCredentialsKind")] @@ -1575,7 +1581,7 @@ pub struct Field { pub source: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Name to identify resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -1671,6 +1677,13 @@ impl GeoJsonObject { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum GeoJsonObjectUnion { + MultiPolygon(MultiPolygon), + Point(Point), + Polygon(Polygon), +} #[doc = "GeoJSON object type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "GeoJsonObjectType")] @@ -1846,7 +1859,7 @@ pub struct HarvestData { pub source: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Name to identify resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -3236,7 +3249,7 @@ pub struct PlantTissueAnalysis { pub source: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Name to identify resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -3417,7 +3430,7 @@ pub struct PlantingData { pub source: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Name to identify resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -3649,7 +3662,7 @@ pub struct Prescription { pub source: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Name to identify resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -4160,7 +4173,7 @@ pub struct SearchApplicationDataQuery { pub max_last_modified_date_time: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, #[doc = "Party ID which belongs to the operation data."] #[serde(rename = "partyId", default, skip_serializing_if = "Option::is_none")] pub party_id: Option, @@ -4184,7 +4197,7 @@ pub struct SearchFeaturesQuery { pub end_date_time: time::OffsetDateTime, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub intersects: Option, + pub intersects: Option, #[doc = "Only features that have a geometry that intersects the bounding box are selected.\r\nThe bounding box is provided as four numbers. The coordinate reference system of the values is WGS84 longitude/latitude."] #[serde( default, @@ -4284,7 +4297,7 @@ pub struct SearchFieldQuery { pub max_last_modified_date_time: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, } impl SearchFieldQuery { pub fn new() -> Self { @@ -4415,7 +4428,7 @@ pub struct SearchHarvestDataQuery { pub max_last_modified_date_time: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, #[doc = "Party ID which belongs to the operation data."] #[serde(rename = "partyId", default, skip_serializing_if = "Option::is_none")] pub party_id: Option, @@ -4503,7 +4516,7 @@ pub struct SearchPlantTissueAnalysisQuery { pub max_last_modified_date_time: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, #[doc = "Party ID which belongs to the operation data."] #[serde(rename = "partyId", default, skip_serializing_if = "Option::is_none")] pub party_id: Option, @@ -4619,7 +4632,7 @@ pub struct SearchPlantingDataQuery { pub max_last_modified_date_time: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, #[doc = "Party ID which belongs to the operation data."] #[serde(rename = "partyId", default, skip_serializing_if = "Option::is_none")] pub party_id: Option, @@ -4713,7 +4726,7 @@ pub struct SearchPrescriptionQuery { pub max_last_modified_date_time: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, #[doc = "Party ID which belongs to the operation data."] #[serde(rename = "partyId", default, skip_serializing_if = "Option::is_none")] pub party_id: Option, @@ -4809,7 +4822,7 @@ pub struct SearchSeasonalFieldQuery { pub max_last_modified_date_time: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, #[doc = "Party ID which belongs to the operation data."] #[serde(rename = "partyId", default, skip_serializing_if = "Option::is_none")] pub party_id: Option, @@ -4919,7 +4932,7 @@ pub struct SearchTillageDataQuery { pub max_last_modified_date_time: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, #[doc = "Party ID which belongs to the operation data."] #[serde(rename = "partyId", default, skip_serializing_if = "Option::is_none")] pub party_id: Option, @@ -4997,7 +5010,7 @@ pub struct SearchZoneQuery { pub max_last_modified_date_time: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(rename = "intersectsWithGeometry", default, skip_serializing_if = "Option::is_none")] - pub intersects_with_geometry: Option, + pub intersects_with_geometry: Option, #[doc = "Party ID which belongs to the operation data."] #[serde(rename = "partyId", default, skip_serializing_if = "Option::is_none")] pub party_id: Option, @@ -5134,7 +5147,7 @@ pub struct SeasonalField { pub source: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Name to identify resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -6508,7 +6521,7 @@ pub struct TillageData { pub source: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Name to identify resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -7066,7 +7079,7 @@ pub struct Zone { pub source: Option, #[doc = "GeoJSON (For more details: https://geojson.org/). Note: Coordinates are expected in [Longitude, Latitude] format."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub geometry: Option, + pub geometry: Option, #[doc = "Name to identify resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, diff --git a/services/svc/applicationinsights/src/v1/models.rs b/services/svc/applicationinsights/src/v1/models.rs index ba9afe8bac..c635f665f4 100644 --- a/services/svc/applicationinsights/src/v1/models.rs +++ b/services/svc/applicationinsights/src/v1/models.rs @@ -793,7 +793,7 @@ pub struct EventsResult { pub ai_messages: Vec, #[doc = "Events query result data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, + pub value: Option, } impl EventsResult { pub fn new() -> Self { @@ -887,6 +887,30 @@ pub mod events_result_data { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventsResultDataUnion { + #[serde(rename = "availabilityResult")] + AvailabilityResult(EventsAvailabilityResultResult), + #[serde(rename = "browserTiming")] + BrowserTiming(EventsBrowserTimingResult), + #[serde(rename = "customEvent")] + CustomEvent(EventsCustomEventResult), + #[serde(rename = "customMetric")] + CustomMetric(EventsCustomMetricResult), + #[serde(rename = "dependency")] + Dependency(EventsDependencyResult), + #[serde(rename = "exception")] + Exception(EventsExceptionResult), + #[serde(rename = "pageView")] + PageView(EventsPageViewResult), + #[serde(rename = "performanceCounter")] + PerformanceCounter(EventsPerformanceCounterResult), + #[serde(rename = "request")] + Request(EventsRequestResult), + #[serde(rename = "trace")] + Trace(EventsTraceResult), +} #[doc = "An events query result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventsResults { @@ -907,7 +931,7 @@ pub struct EventsResults { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl EventsResults { pub fn new() -> Self { diff --git a/services/svc/confidentialledger/src/package_2023_06_01_preview_mccf/models.rs b/services/svc/confidentialledger/src/package_2023_06_01_preview_mccf/models.rs index c792805784..c4e4b6ab58 100644 --- a/services/svc/confidentialledger/src/package_2023_06_01_preview_mccf/models.rs +++ b/services/svc/confidentialledger/src/package_2023_06_01_preview_mccf/models.rs @@ -684,7 +684,7 @@ pub struct ServiceStateNode { pub retired_committed: bool, #[doc = "Common type for attestation information, describing the cryptographically-endorsed claim of what code is executing, and what platform it is executing on. Derived types contain platform-specific details."] #[serde(rename = "quoteInfo")] - pub quote_info: ServiceStateQuoteInfo, + pub quote_info: ServiceStateQuoteInfoUnion, #[doc = "A collection of interfaces by which this node may be contacted. Some may be limited to private networks, and others may be DNS names or internet-public network addresses. The keys are arbitrary strings determined by the node operator."] #[serde(rename = "rpcInterfaces")] pub rpc_interfaces: serde_json::Value, @@ -695,7 +695,7 @@ impl ServiceStateNode { status: ServiceStateNodeStatus, certificate: ServiceStatePem, retired_committed: bool, - quote_info: ServiceStateQuoteInfo, + quote_info: ServiceStateQuoteInfoUnion, rpc_interfaces: serde_json::Value, ) -> Self { Self { @@ -759,6 +759,14 @@ impl ServiceStateQuoteInfo { Self { format } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "format")] +pub enum ServiceStateQuoteInfoUnion { + #[serde(rename = "OE_SGX_v1")] + OeSgxV1(ServiceStateSgxQuoteInfo), + #[serde(rename = "AMD_SEV_SNP_v1")] + AmdSevSnpV1(ServiceStateSnpQuoteInfo), +} #[doc = "General information about the current service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceStateServiceInfo { diff --git a/services/svc/datalakeanalytics/src/package_job_2015_11_preview/models.rs b/services/svc/datalakeanalytics/src/package_job_2015_11_preview/models.rs index 19181e5d7c..9ae3ee8f44 100644 --- a/services/svc/datalakeanalytics/src/package_job_2015_11_preview/models.rs +++ b/services/svc/datalakeanalytics/src/package_job_2015_11_preview/models.rs @@ -228,10 +228,10 @@ pub struct JobInformation { #[serde(rename = "hierarchyQueueNode", default, skip_serializing_if = "Option::is_none")] pub hierarchy_queue_node: Option, #[doc = "The common Data Lake Analytics job properties."] - pub properties: JobProperties, + pub properties: JobPropertiesUnion, } impl JobInformation { - pub fn new(name: String, type_: job_information::Type, properties: JobProperties) -> Self { + pub fn new(name: String, type_: job_information::Type, properties: JobPropertiesUnion) -> Self { Self { job_id: None, name, @@ -355,6 +355,12 @@ impl JobProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum JobPropertiesUnion { + Hive(HiveJobProperties), + USql(USqlJobProperties), +} #[doc = "The Data Lake Analytics U-SQL job resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobResource { diff --git a/services/svc/datalakeanalytics/src/package_job_2016_03_preview/models.rs b/services/svc/datalakeanalytics/src/package_job_2016_03_preview/models.rs index 212e84344e..4078a3cb07 100644 --- a/services/svc/datalakeanalytics/src/package_job_2016_03_preview/models.rs +++ b/services/svc/datalakeanalytics/src/package_job_2016_03_preview/models.rs @@ -247,10 +247,10 @@ pub struct JobInformation { #[serde(rename = "hierarchyQueueNode", default, skip_serializing_if = "Option::is_none")] pub hierarchy_queue_node: Option, #[doc = "The common Data Lake Analytics job properties."] - pub properties: JobProperties, + pub properties: JobPropertiesUnion, } impl JobInformation { - pub fn new(name: String, type_: job_information::Type, properties: JobProperties) -> Self { + pub fn new(name: String, type_: job_information::Type, properties: JobPropertiesUnion) -> Self { Self { job_id: None, name, @@ -377,6 +377,12 @@ impl JobProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum JobPropertiesUnion { + Hive(HiveJobProperties), + USql(USqlJobProperties), +} #[doc = "The Data Lake Analytics job resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobResource { diff --git a/services/svc/datalakeanalytics/src/package_job_2016_11/models.rs b/services/svc/datalakeanalytics/src/package_job_2016_11/models.rs index 5ea27af30f..595e50805f 100644 --- a/services/svc/datalakeanalytics/src/package_job_2016_11/models.rs +++ b/services/svc/datalakeanalytics/src/package_job_2016_11/models.rs @@ -10,10 +10,10 @@ pub struct BaseJobParameters { #[serde(rename = "type")] pub type_: base_job_parameters::Type, #[doc = "The common Data Lake Analytics job properties for job submission."] - pub properties: CreateJobProperties, + pub properties: CreateJobPropertiesUnion, } impl BaseJobParameters { - pub fn new(type_: base_job_parameters::Type, properties: CreateJobProperties) -> Self { + pub fn new(type_: base_job_parameters::Type, properties: CreateJobPropertiesUnion) -> Self { Self { type_, properties } } } @@ -105,6 +105,11 @@ impl CreateJobProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CreateJobPropertiesUnion { + USql(CreateUSqlJobProperties), +} #[doc = "U-SQL job properties used when submitting U-SQL jobs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateUSqlJobProperties { @@ -334,10 +339,10 @@ pub struct JobInformation { )] pub state_audit_records: Vec, #[doc = "The common Data Lake Analytics job properties."] - pub properties: JobProperties, + pub properties: JobPropertiesUnion, } impl JobInformation { - pub fn new(job_information_basic: JobInformationBasic, properties: JobProperties) -> Self { + pub fn new(job_information_basic: JobInformationBasic, properties: JobPropertiesUnion) -> Self { Self { job_information_basic, error_message: Vec::new(), @@ -627,6 +632,12 @@ impl JobProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum JobPropertiesUnion { + Hive(HiveJobProperties), + USql(USqlJobProperties), +} #[doc = "Recurrence job information for a specific recurrence."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobRecurrenceInformation { diff --git a/services/svc/datalakeanalytics/src/package_job_2017_09_preview/models.rs b/services/svc/datalakeanalytics/src/package_job_2017_09_preview/models.rs index 984bd209ea..cd9770be90 100644 --- a/services/svc/datalakeanalytics/src/package_job_2017_09_preview/models.rs +++ b/services/svc/datalakeanalytics/src/package_job_2017_09_preview/models.rs @@ -10,10 +10,10 @@ pub struct BaseJobParameters { #[serde(rename = "type")] pub type_: base_job_parameters::Type, #[doc = "The common Data Lake Analytics job properties for job submission."] - pub properties: CreateJobProperties, + pub properties: CreateJobPropertiesUnion, } impl BaseJobParameters { - pub fn new(type_: base_job_parameters::Type, properties: CreateJobProperties) -> Self { + pub fn new(type_: base_job_parameters::Type, properties: CreateJobPropertiesUnion) -> Self { Self { type_, properties } } } @@ -106,6 +106,12 @@ impl CreateJobProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CreateJobPropertiesUnion { + Scope(CreateScopeJobProperties), + USql(CreateUSqlJobProperties), +} #[doc = "The parameters used to submit a new Data Lake Analytics Scope job. (Only for use internally with Scope job type.)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateScopeJobParameters { @@ -377,10 +383,10 @@ pub struct JobInformation { )] pub state_audit_records: Vec, #[doc = "The common Data Lake Analytics job properties."] - pub properties: JobProperties, + pub properties: JobPropertiesUnion, } impl JobInformation { - pub fn new(job_information_basic: JobInformationBasic, properties: JobProperties) -> Self { + pub fn new(job_information_basic: JobInformationBasic, properties: JobPropertiesUnion) -> Self { Self { job_information_basic, error_message: Vec::new(), @@ -677,6 +683,13 @@ impl JobProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum JobPropertiesUnion { + Hive(HiveJobProperties), + Scope(ScopeJobProperties), + USql(USqlJobProperties), +} #[doc = "Recurrence job information for a specific recurrence."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobRecurrenceInformation { diff --git a/services/svc/eventgrid/src/package_2018_01/models.rs b/services/svc/eventgrid/src/package_2018_01/models.rs index 93f66b81ee..f3dc130f9e 100644 --- a/services/svc/eventgrid/src/package_2018_01/models.rs +++ b/services/svc/eventgrid/src/package_2018_01/models.rs @@ -3670,7 +3670,7 @@ pub struct MediaJobCanceledEventData { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub outputs: Vec, + pub outputs: Vec, } impl MediaJobCanceledEventData { pub fn new() -> Self { @@ -3775,7 +3775,7 @@ pub struct MediaJobErroredEventData { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub outputs: Vec, + pub outputs: Vec, } impl MediaJobErroredEventData { pub fn new() -> Self { @@ -3793,7 +3793,7 @@ pub struct MediaJobFinishedEventData { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub outputs: Vec, + pub outputs: Vec, } impl MediaJobFinishedEventData { pub fn new() -> Self { @@ -3842,6 +3842,12 @@ pub mod media_job_output { Scheduled, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum MediaJobOutputUnion { + #[serde(rename = "#Microsoft.Media.JobOutputAsset")] + MicrosoftMediaJobOutputAsset(MediaJobOutputAsset), +} #[doc = "The event data for a Job output asset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MediaJobOutputAsset { @@ -3951,7 +3957,7 @@ pub struct MediaJobOutputStateChangeEventData { pub previous_state: Option, #[doc = "The event data for a Job output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub output: Option, + pub output: Option, #[doc = "Gets the Job correlation data."] #[serde(rename = "jobCorrelationData", default, skip_serializing_if = "Option::is_none")] pub job_correlation_data: Option, diff --git a/services/svc/eventgrid/src/package_2023_06_01_preview/models.rs b/services/svc/eventgrid/src/package_2023_06_01_preview/models.rs index 0d2aadf34d..a53d63989e 100644 --- a/services/svc/eventgrid/src/package_2023_06_01_preview/models.rs +++ b/services/svc/eventgrid/src/package_2023_06_01_preview/models.rs @@ -3845,7 +3845,7 @@ pub struct MediaJobCanceledEventData { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub outputs: Vec, + pub outputs: Vec, } impl MediaJobCanceledEventData { pub fn new() -> Self { @@ -3950,7 +3950,7 @@ pub struct MediaJobErroredEventData { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub outputs: Vec, + pub outputs: Vec, } impl MediaJobErroredEventData { pub fn new() -> Self { @@ -3968,7 +3968,7 @@ pub struct MediaJobFinishedEventData { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub outputs: Vec, + pub outputs: Vec, } impl MediaJobFinishedEventData { pub fn new() -> Self { @@ -4017,6 +4017,12 @@ pub mod media_job_output { Scheduled, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@odata.type")] +pub enum MediaJobOutputUnion { + #[serde(rename = "#Microsoft.Media.JobOutputAsset")] + MicrosoftMediaJobOutputAsset(MediaJobOutputAsset), +} #[doc = "The event data for a Job output asset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MediaJobOutputAsset { @@ -4126,7 +4132,7 @@ pub struct MediaJobOutputStateChangeEventData { pub previous_state: Option, #[doc = "The event data for a Job output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub output: Option, + pub output: Option, #[doc = "Gets the Job correlation data."] #[serde(rename = "jobCorrelationData", default, skip_serializing_if = "Option::is_none")] pub job_correlation_data: Option, diff --git a/services/svc/graphrbac/src/v1_6/models.rs b/services/svc/graphrbac/src/v1_6/models.rs index 8b98a1371f..949fc199c1 100644 --- a/services/svc/graphrbac/src/v1_6/models.rs +++ b/services/svc/graphrbac/src/v1_6/models.rs @@ -604,6 +604,12 @@ impl DirectoryObject { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "objectType")] +pub enum DirectoryObjectUnion { + Group(AdGroup), + AppRoleAssignment(AppRoleAssignment), +} #[doc = "DirectoryObject list operation result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DirectoryObjectListResult { @@ -613,7 +619,7 @@ pub struct DirectoryObjectListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The URL to get the next set of results."] #[serde(rename = "odata.nextLink", default, skip_serializing_if = "Option::is_none")] pub odata_next_link: Option, diff --git a/services/svc/iotcentral/Cargo.toml b/services/svc/iotcentral/Cargo.toml index 1966f2bc57..d29accf99e 100644 --- a/services/svc/iotcentral/Cargo.toml +++ b/services/svc/iotcentral/Cargo.toml @@ -37,8 +37,8 @@ default = ["package-2022-07-31", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] -"package-2022-10-31-preview" = [] "package-2022-07-31" = [] -"package-2022-06-30-preview" = [] "package-2022-05-31" = [] -"package-2021-04-30-preview" = [] \ No newline at end of file +"package-2021-04-30-preview" = [] +"package-1_2-preview" = [] +"package-1_1-preview" = [] \ No newline at end of file diff --git a/services/svc/iotcentral/README.md b/services/svc/iotcentral/README.md index 9f7f4eca7e..a3d2107c48 100644 --- a/services/svc/iotcentral/README.md +++ b/services/svc/iotcentral/README.md @@ -10,8 +10,8 @@ The default tag is `package-2022-07-31`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: -- `package-2022-10-31-preview` has 120 operations from 1 API versions: `2022-10-31-preview`. Use crate feature `package-2022-10-31-preview` to enable. The operations will be in the `package_2022_10_31_preview` module. - `package-2022-07-31` has 96 operations from 1 API versions: `2022-07-31`. Use crate feature `package-2022-07-31` to enable. The operations will be in the `package_2022_07_31` module. -- `package-2022-06-30-preview` has 114 operations from 1 API versions: `2022-06-30-preview`. Use crate feature `package-2022-06-30-preview` to enable. The operations will be in the `package_2022_06_30_preview` module. - `package-2022-05-31` has 67 operations from 1 API versions: `2022-05-31`. Use crate feature `package-2022-05-31` to enable. The operations will be in the `package_2022_05_31` module. -- `package-2021-04-30-preview` has 71 operations from 1 API versions: `preview`. Use crate feature `package-2021-04-30-preview` to enable. The operations will be in the `package_2021_04_30_preview` module. \ No newline at end of file +- `package-2021-04-30-preview` has 71 operations from 1 API versions: `preview`. Use crate feature `package-2021-04-30-preview` to enable. The operations will be in the `package_2021_04_30_preview` module. +- `package-1.2-preview` has 92 operations from 1 API versions: `1.2-preview`. Use crate feature `package-1_2-preview` to enable. The operations will be in the `package_1_2_preview` module. +- `package-1.1-preview` has 88 operations from 1 API versions: `1.1-preview`. Use crate feature `package-1_1-preview` to enable. The operations will be in the `package_1_1_preview` module. \ No newline at end of file diff --git a/services/svc/iotcentral/autorust.toml b/services/svc/iotcentral/autorust.toml new file mode 100644 index 0000000000..956d1af6d2 --- /dev/null +++ b/services/svc/iotcentral/autorust.toml @@ -0,0 +1,7 @@ +[tags] +deny = [ + # duplicate "x-ms-discriminator-value" + # https://github.com/Azure/azure-rest-api-specs/issues/25931 + "package-2022-10-31-preview", + "package-2022-06-30-preview", + ] diff --git a/services/svc/iotcentral/src/lib.rs b/services/svc/iotcentral/src/lib.rs index d7a9590e28..5a36ebfc37 100644 --- a/services/svc/iotcentral/src/lib.rs +++ b/services/svc/iotcentral/src/lib.rs @@ -3,18 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] -#[cfg(feature = "package-2022-10-31-preview")] -pub mod package_2022_10_31_preview; -#[cfg(all(feature = "package-2022-10-31-preview", not(feature = "no-default-tag")))] -pub use package_2022_10_31_preview::*; #[cfg(feature = "package-2022-07-31")] pub mod package_2022_07_31; #[cfg(all(feature = "package-2022-07-31", not(feature = "no-default-tag")))] pub use package_2022_07_31::*; -#[cfg(feature = "package-2022-06-30-preview")] -pub mod package_2022_06_30_preview; -#[cfg(all(feature = "package-2022-06-30-preview", not(feature = "no-default-tag")))] -pub use package_2022_06_30_preview::*; #[cfg(feature = "package-2022-05-31")] pub mod package_2022_05_31; #[cfg(all(feature = "package-2022-05-31", not(feature = "no-default-tag")))] @@ -23,3 +15,11 @@ pub use package_2022_05_31::*; pub mod package_2021_04_30_preview; #[cfg(all(feature = "package-2021-04-30-preview", not(feature = "no-default-tag")))] pub use package_2021_04_30_preview::*; +#[cfg(feature = "package-1_2-preview")] +pub mod package_1_2_preview; +#[cfg(all(feature = "package-1_2-preview", not(feature = "no-default-tag")))] +pub use package_1_2_preview::*; +#[cfg(feature = "package-1_1-preview")] +pub mod package_1_1_preview; +#[cfg(all(feature = "package-1_1-preview", not(feature = "no-default-tag")))] +pub use package_1_1_preview::*; diff --git a/services/svc/iotcentral/src/package_2022_10_31_preview/mod.rs b/services/svc/iotcentral/src/package_1_1_preview/mod.rs similarity index 70% rename from services/svc/iotcentral/src/package_2022_10_31_preview/mod.rs rename to services/svc/iotcentral/src/package_1_1_preview/mod.rs index 02dcd60bc5..dc2ea58cda 100644 --- a/services/svc/iotcentral/src/package_2022_10_31_preview/mod.rs +++ b/services/svc/iotcentral/src/package_1_1_preview/mod.rs @@ -106,12 +106,6 @@ impl Client { pub fn api_tokens_client(&self) -> api_tokens::Client { api_tokens::Client(self.clone()) } - pub fn dashboards_client(&self) -> dashboards::Client { - dashboards::Client(self.clone()) - } - pub fn deployment_manifests_client(&self) -> deployment_manifests::Client { - deployment_manifests::Client(self.clone()) - } pub fn destinations_client(&self) -> destinations::Client { destinations::Client(self.clone()) } @@ -124,9 +118,6 @@ impl Client { pub fn devices_client(&self) -> devices::Client { devices::Client(self.clone()) } - pub fn enrollment_groups_client(&self) -> enrollment_groups::Client { - enrollment_groups::Client(self.clone()) - } pub fn exports_client(&self) -> exports::Client { exports::Client(self.clone()) } @@ -145,9 +136,6 @@ impl Client { pub fn roles_client(&self) -> roles::Client { roles::Client(self.clone()) } - pub fn scheduled_jobs_client(&self) -> scheduled_jobs::Client { - scheduled_jobs::Client(self.clone()) - } pub fn users_client(&self) -> users::Client { users::Client(self.clone()) } @@ -272,7 +260,7 @@ pub mod api_tokens { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -308,7 +296,7 @@ pub mod api_tokens { let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } @@ -396,7 +384,7 @@ pub mod api_tokens { let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } @@ -498,7 +486,7 @@ pub mod api_tokens { let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } @@ -593,14 +581,14 @@ pub mod api_tokens { let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } } -pub mod dashboards { +pub mod destinations { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -608,58 +596,64 @@ pub mod dashboards { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of dashboards in an application."] + #[doc = "Get the list of destinations in an application."] pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - filter: None, - maxpagesize: None, - orderby: None, - } + list::RequestBuilder { client: self.0.clone() } } - #[doc = "Get a dashboard by ID."] + #[doc = "Get a destination by ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `dashboard_id`: Unique ID for the dashboard."] - pub fn get(&self, dashboard_id: impl Into) -> get::RequestBuilder { + #[doc = "* `destination_id`: Unique ID for the destination."] + pub fn get(&self, destination_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - dashboard_id: dashboard_id.into(), + destination_id: destination_id.into(), } } - #[doc = "Create a dashboard"] + #[doc = "Create or update a destination"] + #[doc = "Create or update a definition for where to send data."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `dashboard_id`: Unique ID for the dashboard."] - #[doc = "* `body`: Dashboard definition."] - pub fn create(&self, dashboard_id: impl Into, body: impl Into) -> create::RequestBuilder { + #[doc = "* `destination_id`: Unique ID for the destination."] + #[doc = "* `body`: Destination body."] + pub fn create(&self, destination_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - dashboard_id: dashboard_id.into(), + destination_id: destination_id.into(), body: body.into(), } } - #[doc = "Update a dashboard"] + #[doc = "Patch a destination."] + #[doc = "Perform an incremental update to a destination."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `dashboard_id`: Unique ID for the dashboard."] - #[doc = "* `body`: Dashboard definition."] - pub fn update(&self, dashboard_id: impl Into, body: impl Into) -> update::RequestBuilder { + #[doc = "* `destination_id`: Unique ID for the destination."] + #[doc = "* `body`: Destination patch body."] + pub fn update(&self, destination_id: impl Into, body: impl Into) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - dashboard_id: dashboard_id.into(), + destination_id: destination_id.into(), body: body.into(), - if_match: None, } } - #[doc = "Delete a dashboard"] + #[doc = "Delete a destination."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `dashboard_id`: Unique ID for the dashboard."] - pub fn remove(&self, dashboard_id: impl Into) -> remove::RequestBuilder { + #[doc = "* `destination_id`: Unique ID for the destination."] + pub fn remove(&self, destination_id: impl Into) -> remove::RequestBuilder { remove::RequestBuilder { client: self.0.clone(), - dashboard_id: dashboard_id.into(), + destination_id: destination_id.into(), + } + } + #[doc = "List all exports connected to the given destination."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `destination_id`: Unique ID for the destination."] + pub fn list_exports(&self, destination_id: impl Into) -> list_exports::RequestBuilder { + list_exports::RequestBuilder { + client: self.0.clone(), + destination_id: destination_id.into(), } } } @@ -672,9 +666,9 @@ pub mod dashboards { #[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::DashboardCollection = serde_json::from_slice(&bytes)?; + let body: models::DestinationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -715,27 +709,9 @@ pub mod dashboards { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) filter: Option, - pub(crate) maxpagesize: Option, - pub(crate) orderby: Option, } impl RequestBuilder { - #[doc = "An expression on the resource type that selects the resources to be returned."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - self - } - #[doc = "An expression that specify the order of the returned resources."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.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 { @@ -756,7 +732,7 @@ pub mod dashboards { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -770,15 +746,6 @@ pub mod dashboards { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("filter", filter); - } - if let Some(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.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? @@ -797,11 +764,11 @@ pub mod dashboards { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/destinations", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } @@ -816,9 +783,9 @@ pub mod dashboards { #[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::Dashboard = serde_json::from_slice(&bytes)?; + let body: models::DestinationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -859,7 +826,7 @@ pub mod dashboards { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) dashboard_id: String, + pub(crate) destination_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."] @@ -885,18 +852,22 @@ pub mod dashboards { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards/{}", self.client.endpoint(), &self.dashboard_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/dataExport/destinations/{}", + self.client.endpoint(), + &self.destination_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -916,9 +887,9 @@ pub mod dashboards { #[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::Dashboard = serde_json::from_slice(&bytes)?; + let body: models::DestinationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -959,8 +930,8 @@ pub mod dashboards { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) dashboard_id: String, - pub(crate) body: models::Dashboard, + pub(crate) destination_id: String, + pub(crate) body: models::DestinationUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -987,18 +958,22 @@ pub mod dashboards { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards/{}", self.client.endpoint(), &self.dashboard_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/dataExport/destinations/{}", + self.client.endpoint(), + &self.destination_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -1018,9 +993,9 @@ pub mod dashboards { #[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::Dashboard = serde_json::from_slice(&bytes)?; + let body: models::DestinationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1061,16 +1036,10 @@ pub mod dashboards { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) dashboard_id: String, + pub(crate) destination_id: String, pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()`."] @@ -1087,29 +1056,30 @@ pub mod dashboards { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - req.insert_header("content-type", "application/merge-patch+json"); + req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards/{}", self.client.endpoint(), &self.dashboard_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/dataExport/destinations/{}", + self.client.endpoint(), + &self.destination_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -1167,7 +1137,7 @@ pub mod dashboards { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) dashboard_id: String, + pub(crate) destination_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."] @@ -1193,88 +1163,21 @@ pub mod dashboards { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards/{}", self.client.endpoint(), &self.dashboard_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/dataExport/destinations/{}", + self.client.endpoint(), + &self.destination_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } -} -pub mod destinations { - 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 = "Get the list of destinations in an application."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - #[doc = "Get a destination by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - pub fn get(&self, destination_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - destination_id: destination_id.into(), - } - } - #[doc = "Create or update a destination"] - #[doc = "Create or update a definition for where to send data."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - #[doc = "* `body`: Destination body."] - pub fn create(&self, destination_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - destination_id: destination_id.into(), - body: body.into(), - } - } - #[doc = "Patch a destination."] - #[doc = "Perform an incremental update to a destination."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - #[doc = "* `body`: Destination patch body."] - pub fn update(&self, destination_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - destination_id: destination_id.into(), - body: body.into(), - if_match: None, - } - } - #[doc = "Delete a destination."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - pub fn remove(&self, destination_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { - client: self.0.clone(), - destination_id: destination_id.into(), - } - } - #[doc = "List all exports connected to the given destination."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - pub fn list_exports(&self, destination_id: impl Into) -> list_exports::RequestBuilder { - list_exports::RequestBuilder { - client: self.0.clone(), - destination_id: destination_id.into(), - } - } - } - pub mod list { + pub mod list_exports { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -1283,9 +1186,9 @@ pub mod destinations { #[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::DestinationCollection = serde_json::from_slice(&bytes)?; + let body: models::ExportCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1326,9 +1229,10 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) destination_id: String, } impl RequestBuilder { - 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 { @@ -1349,7 +1253,7 @@ pub mod destinations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1381,17 +1285,91 @@ pub mod destinations { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dataExport/destinations", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/dataExport/destinations/{}/exports", + self.client.endpoint(), + &self.destination_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } - pub mod get { +} +pub mod exports { + 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 = "Get the list of exports in an application."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + #[doc = "Get an export by ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `export_id`: Unique ID for the export."] + pub fn get(&self, export_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + export_id: export_id.into(), + } + } + #[doc = "Create or update an export"] + #[doc = "Create or update a definition for exporting data. Also used to connect or disconnect an export from destinations."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `export_id`: Unique ID for the export."] + #[doc = "* `body`: Export body."] + pub fn create(&self, export_id: impl Into, body: impl Into) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + export_id: export_id.into(), + body: body.into(), + } + } + #[doc = "Patch an export."] + #[doc = "Perform an incremental update to an export."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `export_id`: Unique ID for the export."] + #[doc = "* `body`: Export patch body."] + pub fn update(&self, export_id: impl Into, body: impl Into) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + export_id: export_id.into(), + body: body.into(), + } + } + #[doc = "Delete an export."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `export_id`: Unique ID for the export."] + pub fn remove(&self, export_id: impl Into) -> remove::RequestBuilder { + remove::RequestBuilder { + client: self.0.clone(), + export_id: export_id.into(), + } + } + #[doc = "List all destinations connected to the given export."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `export_id`: Unique ID for the export."] + pub fn list_destinations(&self, export_id: impl Into) -> list_destinations::RequestBuilder { + list_destinations::RequestBuilder { + client: self.0.clone(), + export_id: export_id.into(), + } + } + } + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -1400,9 +1378,9 @@ pub mod destinations { #[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::Destination = serde_json::from_slice(&bytes)?; + let body: models::ExportCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1443,15 +1421,132 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_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({ + 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, "1.1-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!("{}/dataExport/exports", 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, "1.1-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::Export = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) export_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()?; @@ -1469,22 +1564,18 @@ pub mod destinations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}", - self.client.endpoint(), - &self.destination_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -1504,9 +1595,9 @@ pub mod destinations { #[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::Destination = serde_json::from_slice(&bytes)?; + let body: models::Export = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1547,8 +1638,8 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_id: String, - pub(crate) body: models::Destination, + pub(crate) export_id: String, + pub(crate) body: models::Export, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1575,22 +1666,18 @@ pub mod destinations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}", - self.client.endpoint(), - &self.destination_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -1610,9 +1697,9 @@ pub mod destinations { #[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::Destination = serde_json::from_slice(&bytes)?; + let body: models::Export = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1653,16 +1740,10 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_id: String, + pub(crate) export_id: String, pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()`."] @@ -1681,31 +1762,24 @@ pub mod destinations { ); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}", - self.client.endpoint(), - &self.destination_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -1763,7 +1837,7 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_id: String, + pub(crate) export_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."] @@ -1789,21 +1863,17 @@ pub mod destinations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}", - self.client.endpoint(), - &self.destination_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } - pub mod list_exports { + pub mod list_destinations { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -1812,9 +1882,9 @@ pub mod destinations { #[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::ExportCollection = serde_json::from_slice(&bytes)?; + let body: models::DestinationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1855,10 +1925,10 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_id: String, + pub(crate) export_id: String, } impl RequestBuilder { - 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 { @@ -1879,7 +1949,7 @@ pub mod destinations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1912,21 +1982,21 @@ pub mod destinations { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}/exports", + "{}/dataExport/exports/{}/destinations", self.client.endpoint(), - &self.destination_id + &self.export_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } } -pub mod exports { +pub mod device_groups { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -1934,67 +2004,10 @@ pub mod exports { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of exports in an application."] + #[doc = "Get the list of device groups in an application."] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } - #[doc = "Get an export by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - pub fn get(&self, export_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - export_id: export_id.into(), - } - } - #[doc = "Create or update an export"] - #[doc = "Create or update a definition for exporting data. Also used to connect or disconnect an export from destinations."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - #[doc = "* `body`: Export body."] - pub fn create(&self, export_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - export_id: export_id.into(), - body: body.into(), - } - } - #[doc = "Patch an export."] - #[doc = "Perform an incremental update to an export."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - #[doc = "* `body`: Export patch body."] - pub fn update(&self, export_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - export_id: export_id.into(), - body: body.into(), - if_match: None, - } - } - #[doc = "Delete an export."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - pub fn remove(&self, export_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { - client: self.0.clone(), - export_id: export_id.into(), - } - } - #[doc = "List all destinations connected to the given export."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - pub fn list_destinations(&self, export_id: impl Into) -> list_destinations::RequestBuilder { - list_destinations::RequestBuilder { - client: self.0.clone(), - export_id: export_id.into(), - } - } } pub mod list { use super::models; @@ -2005,9 +2018,9 @@ pub mod exports { #[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::ExportCollection = serde_json::from_slice(&bytes)?; + let body: models::DeviceGroupCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2050,7 +2063,7 @@ pub mod exports { pub(crate) client: super::super::Client, } impl RequestBuilder { - 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 { @@ -2071,7 +2084,7 @@ pub mod exports { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2103,28 +2116,92 @@ pub mod exports { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceGroups", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-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::Export = serde_json::from_slice(&bytes)?; +} +pub mod device_templates { + 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 = "Get the list of device templates in an application with basic ODATA support ($top, $filter, $orderby), [more details](https://aka.ms/iotcentralodatasupport)."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + filter: None, + top: None, + orderby: None, + } + } + #[doc = "Get a device template by ID"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] + pub fn get(&self, device_template_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + device_template_id: device_template_id.into(), + } + } + #[doc = "Publish a new device template. Default views will be automatically generated for new device templates created this way."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] + #[doc = "* `body`: Device template body."] + pub fn create(&self, device_template_id: impl Into, body: impl Into) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + device_template_id: device_template_id.into(), + body: body.into(), + } + } + #[doc = "Update the cloud properties and overrides of an existing device template via patch."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] + #[doc = "* `body`: Device template patch body."] + pub fn update(&self, device_template_id: impl Into, body: impl Into) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + device_template_id: device_template_id.into(), + body: body.into(), + } + } + #[doc = "Delete a device template"] + #[doc = "Delete an existing device template by device ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] + pub fn remove(&self, device_template_id: impl Into) -> remove::RequestBuilder { + remove::RequestBuilder { + client: self.0.clone(), + device_template_id: device_template_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::DeviceTemplateCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2165,55 +2242,99 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) export_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) orderby: 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 = "Filter string for results."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Page size of returned results."] + pub fn top(mut self, top: i64) -> Self { + self.top = Some(top); + self + } + #[doc = "The order by string for results."] + 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 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?)) + 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, "1.1-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(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.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!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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 { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -2222,9 +2343,9 @@ pub mod exports { #[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::Export = serde_json::from_slice(&bytes)?; + let body: models::DeviceTemplate = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2265,8 +2386,7 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) export_id: String, - pub(crate) body: models::Export, + pub(crate) device_template_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."] @@ -2278,33 +2398,32 @@ pub mod exports { 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()), ); - 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!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -2315,7 +2434,7 @@ pub mod exports { } } } - pub mod update { + pub mod create { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -2324,9 +2443,9 @@ pub mod exports { #[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::Export = serde_json::from_slice(&bytes)?; + let body: models::DeviceTemplate = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2367,16 +2486,10 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) export_id: String, - pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, + pub(crate) device_template_id: String, + pub(crate) body: models::DeviceTemplate, } impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()`."] @@ -2386,7 +2499,7 @@ pub mod exports { 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::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2395,27 +2508,24 @@ pub mod exports { ); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -2426,7 +2536,7 @@ pub mod exports { } } } - pub mod remove { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -2435,6 +2545,11 @@ pub mod exports { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceTemplate = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -2473,7 +2588,8 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) export_id: String, + pub(crate) device_template_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2485,31 +2601,44 @@ pub mod exports { 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!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_destinations { + pub mod remove { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -2518,11 +2647,6 @@ pub mod exports { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DestinationCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -2561,78 +2685,44 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) export_id: String, + pub(crate) device_template_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, "2022-10-31-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 + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::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!( - "{}/dataExport/exports/{}/destinations", - self.client.endpoint(), - &self.export_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } } -pub mod deployment_manifests { +pub mod devices { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -2640,4596 +2730,715 @@ pub mod deployment_manifests { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of deployment manifests."] - #[doc = "Get the list of deployment manifests."] + #[doc = "Get the list of devices in an application with basic ODATA support ($top, $filter, $orderby), [more details](https://aka.ms/iotcentralodatasupport)."] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), - maxpagesize: None, filter: None, + top: None, + orderby: None, } } - #[doc = "Get a deployment manifest by ID."] - #[doc = "Get a deployment manifest by ID."] + #[doc = "Get a device by ID"] + #[doc = "Get details about an existing device by device ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `deployment_manifest_id`: Unique ID for the deployment manifest."] - pub fn get(&self, deployment_manifest_id: impl Into) -> get::RequestBuilder { + #[doc = "* `device_id`: Unique ID of the device."] + pub fn get(&self, device_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - deployment_manifest_id: deployment_manifest_id.into(), + device_id: device_id.into(), } } - #[doc = "Create a new deployment manifest."] - #[doc = "Create a new deployment manifest."] + #[doc = "Create or update a device"] + #[doc = "Create a new device."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `deployment_manifest_id`: Unique ID for the deployment manifest."] - #[doc = "* `body`: deployment manifest body."] - pub fn create( - &self, - deployment_manifest_id: impl Into, - body: impl Into, - ) -> create::RequestBuilder { + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Device body."] + pub fn create(&self, device_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - deployment_manifest_id: deployment_manifest_id.into(), + device_id: device_id.into(), body: body.into(), } } - #[doc = "Update an existing deployment manifest."] - #[doc = "Update an existing deployment manifest."] + #[doc = "Update a device via patch"] + #[doc = "Update an existing device by ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `deployment_manifest_id`: Unique ID for the deployment manifest."] - #[doc = "* `body`: Deployment manifest patch body."] - pub fn update(&self, deployment_manifest_id: impl Into, body: impl Into) -> update::RequestBuilder { + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Device patch body."] + pub fn update(&self, device_id: impl Into, body: impl Into) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - deployment_manifest_id: deployment_manifest_id.into(), + device_id: device_id.into(), body: body.into(), - if_match: None, } } - #[doc = "Delete a deployment manifest."] - #[doc = "Delete a deployment manifest."] + #[doc = "Delete a device"] + #[doc = "Delete an existing device by device ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `deployment_manifest_id`: Unique ID for the deployment manifest."] - pub fn remove(&self, deployment_manifest_id: impl Into) -> remove::RequestBuilder { + #[doc = "* `device_id`: Unique ID of the device."] + pub fn remove(&self, device_id: impl Into) -> remove::RequestBuilder { remove::RequestBuilder { client: self.0.clone(), - deployment_manifest_id: deployment_manifest_id.into(), + device_id: device_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::DeploymentManifestCollection = serde_json::from_slice(&bytes)?; - Ok(body) + #[doc = "Get device attestation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn get_attestation(&self, device_id: impl Into) -> get_attestation::RequestBuilder { + get_attestation::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + } + #[doc = "Create an individual device attestation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Individual device attestation body."] + pub fn create_attestation( + &self, + device_id: impl Into, + body: impl Into, + ) -> create_attestation::RequestBuilder { + create_attestation::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + body: body.into(), } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + } + #[doc = "Update an individual device attestation via patch"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Individual device attestation patch body."] + pub fn update_attestation( + &self, + device_id: impl Into, + body: impl Into, + ) -> update_attestation::RequestBuilder { + update_attestation::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + body: body.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Remove an individual device attestation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn remove_attestation(&self, device_id: impl Into) -> remove_attestation::RequestBuilder { + remove_attestation::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Get device command history"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `command_name`: Name of this device command."] + pub fn get_command_history( + &self, + device_id: impl Into, + command_name: impl Into, + ) -> get_command_history::RequestBuilder { + get_command_history::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + command_name: command_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) maxpagesize: Option, - pub(crate) filter: Option, + #[doc = "Run a device command"] + #[doc = "Run a command on a device."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `command_name`: Name of this device command."] + #[doc = "* `body`: Device command body."] + pub fn run_command( + &self, + device_id: impl Into, + command_name: impl Into, + body: impl Into, + ) -> run_command::RequestBuilder { + run_command::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + command_name: command_name.into(), + body: body.into(), + } } - impl RequestBuilder { - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - self + #[doc = "List the components present in a device"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn list_components(&self, device_id: impl Into) -> list_components::RequestBuilder { + list_components::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } - #[doc = "An expression on the resource type that selects the resources to be returned."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self + } + #[doc = "Get component command history"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `command_name`: Name of this device command."] + pub fn get_component_command_history( + &self, + device_id: impl Into, + component_name: impl Into, + command_name: impl Into, + ) -> get_component_command_history::RequestBuilder { + get_component_command_history::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + command_name: command_name.into(), } - 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-31-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(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.to_string()); - } - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("filter", filter); - } - 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!("{}/deploymentManifests", 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, "2022-10-31-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::DeploymentManifest = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) deployment_manifest_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!( - "{}/deploymentManifests/{}", - self.client.endpoint(), - &self.deployment_manifest_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-31-preview"); - } - Ok(url) + #[doc = "Run a component command"] + #[doc = "Run a command on a component."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `command_name`: Name of this device command."] + #[doc = "* `body`: Device command body."] + pub fn run_component_command( + &self, + device_id: impl Into, + component_name: impl Into, + command_name: impl Into, + body: impl Into, + ) -> run_component_command::RequestBuilder { + run_component_command::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + command_name: command_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 sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/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 = "Get device properties for a specific component"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + pub fn get_component_properties( + &self, + device_id: impl Into, + component_name: impl Into, + ) -> get_component_properties::RequestBuilder { + get_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), } } - } - 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::DeploymentManifest = serde_json::from_slice(&bytes)?; - 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 = "Replace device properties for a specific component"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `body`: Device properties."] + pub fn replace_component_properties( + &self, + device_id: impl Into, + component_name: impl Into, + body: impl Into, + ) -> replace_component_properties::RequestBuilder { + replace_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + body: body.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Update device properties for a specific component via patch"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `body`: Device properties patch."] + pub fn update_component_properties( + &self, + device_id: impl Into, + component_name: impl Into, + body: impl Into, + ) -> update_component_properties::RequestBuilder { + update_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + body: body.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Get component telemetry value"] + #[doc = "Get the last telemetry value from a component."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `telemetry_name`: Name of this device telemetry."] + pub fn get_component_telemetry_value( + &self, + device_id: impl Into, + component_name: impl Into, + telemetry_name: impl Into, + ) -> get_component_telemetry_value::RequestBuilder { + get_component_telemetry_value::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + telemetry_name: telemetry_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) deployment_manifest_id: String, - pub(crate) body: models::DeploymentManifest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!( - "{}/deploymentManifests/{}", - self.client.endpoint(), - &self.deployment_manifest_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::DeploymentManifest = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) deployment_manifest_id: String, - pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, - } - impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()), - ); - req.insert_header("content-type", "application/merge-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/deploymentManifests/{}", - self.client.endpoint(), - &self.deployment_manifest_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) deployment_manifest_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!( - "{}/deploymentManifests/{}", - self.client.endpoint(), - &self.deployment_manifest_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-31-preview"); - } - Ok(url) - } - } - } -} -pub mod device_groups { - 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 = "Get the list of device groups in an application."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - filter: None, - maxpagesize: None, - orderby: None, - } - } - #[doc = "Get the device group by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - pub fn get(&self, device_group_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - } - } - #[doc = "Create or update a device group"] - #[doc = "Create or update a device group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - #[doc = "* `body`: Device group body."] - pub fn create(&self, device_group_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - body: body.into(), - } - } - #[doc = "Update a device group via patch"] - #[doc = "Update an existing device group by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - #[doc = "* `body`: Device group patch body."] - pub fn update(&self, device_group_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - body: body.into(), - if_match: None, - } - } - #[doc = "Delete a device group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - pub fn remove(&self, device_group_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - } - } - #[doc = "Get the devices of a device group"] - #[doc = "Get the list of devices by device group ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - pub fn get_devices(&self, device_group_id: impl Into) -> get_devices::RequestBuilder { - get_devices::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - maxpagesize: 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::DeviceGroupCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) filter: Option, - pub(crate) maxpagesize: Option, - pub(crate) orderby: Option, - } - impl RequestBuilder { - #[doc = "An expression on the resource type that selects the resources to be returned."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - self - } - #[doc = "An expression that specify the order of the returned resources."] - 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, "2022-10-31-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(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("filter", filter); - } - if let Some(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.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!("{}/deviceGroups", 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, "2022-10-31-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::DeviceGroup = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_group_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!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::DeviceGroup = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_group_id: String, - pub(crate) body: models::DeviceGroup, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::DeviceGroup = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_group_id: String, - pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, - } - impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()), - ); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) device_group_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!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_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-31-preview"); - } - Ok(url) - } - } - } - pub mod get_devices { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceGroupDeviceCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_group_id: String, - pub(crate) maxpagesize: Option, - } - impl RequestBuilder { - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - 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-31-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(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.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!( - "{}/deviceGroups/{}/devices", - self.client.endpoint(), - &self.device_group_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-31-preview"); - } - Ok(url) - } - } - } -} -pub mod device_templates { - 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 = "Get the list of device templates in an application with basic ODATA support (maxpagesize, filter, orderby), [more details](https://aka.ms/iotcentralodatasupport)."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - filter: None, - maxpagesize: None, - orderby: None, - } - } - #[doc = "Get a device template by ID"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] - pub fn get(&self, device_template_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - device_template_id: device_template_id.into(), - } - } - #[doc = "Publish a new device template. Default views will be automatically generated for new device templates created this way."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] - #[doc = "* `body`: Device template body."] - pub fn create(&self, device_template_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - device_template_id: device_template_id.into(), - body: body.into(), - } - } - #[doc = "Update the cloud properties and overrides of an existing device template via patch."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] - #[doc = "* `body`: Device template patch body."] - pub fn update(&self, device_template_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - device_template_id: device_template_id.into(), - body: body.into(), - if_match: None, - } - } - #[doc = "Delete a device template"] - #[doc = "Delete an existing device template by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] - pub fn remove(&self, device_template_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { - client: self.0.clone(), - device_template_id: device_template_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::DeviceTemplateCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) filter: Option, - pub(crate) maxpagesize: Option, - pub(crate) orderby: Option, - } - impl RequestBuilder { - #[doc = "An expression on the resource type that selects the resources to be returned."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - self - } - #[doc = "An expression that specify the order of the returned resources."] - 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, "2022-10-31-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(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("filter", filter); - } - if let Some(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.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!("{}/deviceTemplates", 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, "2022-10-31-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::DeviceTemplate = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_template_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!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::DeviceTemplate = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_template_id: String, - pub(crate) body: models::DeviceTemplate, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::DeviceTemplate = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_template_id: String, - pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, - } - impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()), - ); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) device_template_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!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-31-preview"); - } - Ok(url) - } - } - } -} -pub mod devices { - 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 = "Get the list of devices in an application with basic ODATA support (maxpagesize, filter, orderby), [more details](https://aka.ms/iotcentralodatasupport)."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - filter: None, - maxpagesize: None, - orderby: None, - expand: None, - } - } - #[doc = "Get a device by ID"] - #[doc = "Get details about an existing device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn get(&self, device_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - expand: None, - } - } - #[doc = "Create or update a device"] - #[doc = "Create a new device."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Device body."] - pub fn create(&self, device_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - expand: None, - } - } - #[doc = "Update a device via patch"] - #[doc = "Update an existing device by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Device patch body."] - pub fn update(&self, device_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - expand: None, - if_match: None, - } - } - #[doc = "Delete a device"] - #[doc = "Delete an existing device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn remove(&self, device_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - expand: None, - } - } - #[doc = "Apply a deployment manifest to an edge device."] - #[doc = "Apply a deployment manifest to an edge device."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Deployment Manifest data."] - pub fn apply_manifest( - &self, - device_id: impl Into, - body: impl Into, - ) -> apply_manifest::RequestBuilder { - apply_manifest::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - } - } - #[doc = "Get device attestation"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn get_attestation(&self, device_id: impl Into) -> get_attestation::RequestBuilder { - get_attestation::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Create an individual device attestation"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Individual device attestation body."] - pub fn create_attestation( - &self, - device_id: impl Into, - body: impl Into, - ) -> create_attestation::RequestBuilder { - create_attestation::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - } - } - #[doc = "Update an individual device attestation via patch"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Individual device attestation patch body."] - pub fn update_attestation( - &self, - device_id: impl Into, - body: impl Into, - ) -> update_attestation::RequestBuilder { - update_attestation::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - } - } - #[doc = "Remove an individual device attestation"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn remove_attestation(&self, device_id: impl Into) -> remove_attestation::RequestBuilder { - remove_attestation::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Get device command history"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `command_name`: Name of this device command."] - pub fn get_command_history( - &self, - device_id: impl Into, - command_name: impl Into, - ) -> get_command_history::RequestBuilder { - get_command_history::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - command_name: command_name.into(), - } - } - #[doc = "Run a device command"] - #[doc = "Run a command on a device."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `command_name`: Name of this device command."] - #[doc = "* `body`: Device command body."] - pub fn run_command( - &self, - device_id: impl Into, - command_name: impl Into, - body: impl Into, - ) -> run_command::RequestBuilder { - run_command::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - command_name: command_name.into(), - body: body.into(), - } - } - #[doc = "List the components present in a device"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn list_components(&self, device_id: impl Into) -> list_components::RequestBuilder { - list_components::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Get component command history"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `command_name`: Name of this device command."] - pub fn get_component_command_history( - &self, - device_id: impl Into, - component_name: impl Into, - command_name: impl Into, - ) -> get_component_command_history::RequestBuilder { - get_component_command_history::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - command_name: command_name.into(), - } - } - #[doc = "Run a component command"] - #[doc = "Run a command on a component."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `command_name`: Name of this device command."] - #[doc = "* `body`: Device command body."] - pub fn run_component_command( - &self, - device_id: impl Into, - component_name: impl Into, - command_name: impl Into, - body: impl Into, - ) -> run_component_command::RequestBuilder { - run_component_command::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - command_name: command_name.into(), - body: body.into(), - } - } - #[doc = "Get device properties for a specific component"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - pub fn get_component_properties( - &self, - device_id: impl Into, - component_name: impl Into, - ) -> get_component_properties::RequestBuilder { - get_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - unmodeled: None, - } - } - #[doc = "Replace device properties for a specific component"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `body`: Device properties."] - pub fn replace_component_properties( - &self, - device_id: impl Into, - component_name: impl Into, - body: impl Into, - ) -> replace_component_properties::RequestBuilder { - replace_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - body: body.into(), - unmodeled: None, - } - } - #[doc = "Update device properties for a specific component via patch"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `body`: Device properties patch."] - pub fn update_component_properties( - &self, - device_id: impl Into, - component_name: impl Into, - body: impl Into, - ) -> update_component_properties::RequestBuilder { - update_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - body: body.into(), - unmodeled: None, - } - } - #[doc = "Get component telemetry value"] - #[doc = "Get the last telemetry value from a component."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `telemetry_name`: Name of this device telemetry."] - pub fn get_component_telemetry_value( - &self, - device_id: impl Into, - component_name: impl Into, - telemetry_name: impl Into, - ) -> get_component_telemetry_value::RequestBuilder { - get_component_telemetry_value::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - telemetry_name: telemetry_name.into(), - } - } - #[doc = "Get device credentials"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn get_credentials(&self, device_id: impl Into) -> get_credentials::RequestBuilder { - get_credentials::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "List the modules present in a device"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn list_modules(&self, device_id: impl Into) -> list_modules::RequestBuilder { - list_modules::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Get module command history"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `command_name`: Name of this device command."] - pub fn get_module_command_history( - &self, - device_id: impl Into, - module_name: impl Into, - command_name: impl Into, - ) -> get_module_command_history::RequestBuilder { - get_module_command_history::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - command_name: command_name.into(), - } - } - #[doc = "Run a module command"] - #[doc = "Run a command on a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `command_name`: Name of this device command."] - #[doc = "* `body`: Device command body."] - pub fn run_module_command( - &self, - device_id: impl Into, - module_name: impl Into, - command_name: impl Into, - body: impl Into, - ) -> run_module_command::RequestBuilder { - run_module_command::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - command_name: command_name.into(), - body: body.into(), - } - } - #[doc = "List the components present in a module"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - pub fn list_module_components( - &self, - device_id: impl Into, - module_name: impl Into, - ) -> list_module_components::RequestBuilder { - list_module_components::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - } - } - #[doc = "Get module component command history"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `command_name`: Name of this device command."] - pub fn get_module_component_command_history( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - command_name: impl Into, - ) -> get_module_component_command_history::RequestBuilder { - get_module_component_command_history::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - command_name: command_name.into(), - } - } - #[doc = "Run a module component command"] - #[doc = "Run a command on a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `command_name`: Name of this device command."] - #[doc = "* `body`: Device command body."] - pub fn run_module_component_command( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - command_name: impl Into, - body: impl Into, - ) -> run_module_component_command::RequestBuilder { - run_module_component_command::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - command_name: command_name.into(), - body: body.into(), - } - } - #[doc = "Get module properties for a specific component"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - pub fn get_module_component_properties( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - ) -> get_module_component_properties::RequestBuilder { - get_module_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - } - } - #[doc = "Replace module properties for a specific component"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `body`: Module properties."] - pub fn replace_module_component_properties( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - body: impl Into, - ) -> replace_module_component_properties::RequestBuilder { - replace_module_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - body: body.into(), - } - } - #[doc = "Update module properties for a specific component via patch"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `body`: Module properties patch."] - pub fn update_module_component_properties( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - body: impl Into, - ) -> update_module_component_properties::RequestBuilder { - update_module_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - body: body.into(), - } - } - #[doc = "Get module component telemetry value"] - #[doc = "Get the last telemetry value from a module component."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `telemetry_name`: Name of this device telemetry."] - pub fn get_module_component_telemetry_value( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - telemetry_name: impl Into, - ) -> get_module_component_telemetry_value::RequestBuilder { - get_module_component_telemetry_value::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - telemetry_name: telemetry_name.into(), - } - } - #[doc = "Get module properties"] - #[doc = "Get all property values of a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - pub fn get_module_properties( - &self, - device_id: impl Into, - module_name: impl Into, - ) -> get_module_properties::RequestBuilder { - get_module_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - } - } - #[doc = "Replace module properties"] - #[doc = "Replace all property values of a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `body`: Module properties."] - pub fn replace_module_properties( - &self, - device_id: impl Into, - module_name: impl Into, - body: impl Into, - ) -> replace_module_properties::RequestBuilder { - replace_module_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - body: body.into(), - } - } - #[doc = "Update module properties via patch"] - #[doc = "Update property values of a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `body`: Module properties patch."] - pub fn update_module_properties( - &self, - device_id: impl Into, - module_name: impl Into, - body: impl Into, - ) -> update_module_properties::RequestBuilder { - update_module_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - body: body.into(), - } - } - #[doc = "Get module telemetry value"] - #[doc = "Get the last telemetry value from a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `telemetry_name`: Name of this device telemetry."] - pub fn get_module_telemetry_value( - &self, - device_id: impl Into, - module_name: impl Into, - telemetry_name: impl Into, - ) -> get_module_telemetry_value::RequestBuilder { - get_module_telemetry_value::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - telemetry_name: telemetry_name.into(), - } - } - #[doc = "Get device properties"] - #[doc = "Get all property values of a device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn get_properties(&self, device_id: impl Into) -> get_properties::RequestBuilder { - get_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - unmodeled: None, - } - } - #[doc = "Replace device properties"] - #[doc = "Replace all property values of a device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Device properties."] - pub fn replace_properties( - &self, - device_id: impl Into, - body: impl Into, - ) -> replace_properties::RequestBuilder { - replace_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - unmodeled: None, - } - } - #[doc = "Update device properties via patch"] - #[doc = "Update property values of a device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Device properties patch."] - pub fn update_properties( - &self, - device_id: impl Into, - body: impl Into, - ) -> update_properties::RequestBuilder { - update_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - unmodeled: None, - } - } - #[doc = "Given the ID for an upstream device, will return the upstream and the downstream relationships associated with that gateway. These downstream relationships are only those associated with the direct downstream level (they don’t work recursively)."] - #[doc = "List all relationships based on device ID"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn list_relationships(&self, device_id: impl Into) -> list_relationships::RequestBuilder { - list_relationships::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - maxpagesize: None, - } - } - #[doc = "Given the ID for a device and a relationship ID associated with this device, get the details of the relationship."] - #[doc = "Get device relationship by ID"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] - pub fn get_relationship( - &self, - device_id: impl Into, - relationship_id: impl Into, - ) -> get_relationship::RequestBuilder { - get_relationship::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - relationship_id: relationship_id.into(), - } - } - #[doc = "Given the ID for a device and a relationship ID associated with this device, create a new relationship for between the given device and a second device specified in the body."] - #[doc = "Create a device relationship"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] - #[doc = "* `body`: Device relationship body."] - pub fn create_relationship( - &self, - device_id: impl Into, - relationship_id: impl Into, - body: impl Into, - ) -> create_relationship::RequestBuilder { - create_relationship::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - relationship_id: relationship_id.into(), - body: body.into(), - } - } - #[doc = "Patch a given relationship given the relationship ID and a given device ID."] - #[doc = "Update device relationship"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] - #[doc = "* `body`: Device relationship patch body."] - pub fn update_relationship( - &self, - device_id: impl Into, - relationship_id: impl Into, - body: impl Into, - ) -> update_relationship::RequestBuilder { - update_relationship::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - relationship_id: relationship_id.into(), - body: body.into(), - } - } - #[doc = "Given the ID for a device and an associated relationship ID, delete the relationship. The given device ID can be that of the upstream or downstream device."] - #[doc = "Delete a device relationship"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] - pub fn remove_relationship( - &self, - device_id: impl Into, - relationship_id: impl Into, - ) -> remove_relationship::RequestBuilder { - remove_relationship::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - relationship_id: relationship_id.into(), - } - } - #[doc = "Get device telemetry value"] - #[doc = "Get the last telemetry value from a device."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `telemetry_name`: Name of this device telemetry."] - pub fn get_telemetry_value( - &self, - device_id: impl Into, - telemetry_name: impl Into, - ) -> get_telemetry_value::RequestBuilder { - get_telemetry_value::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - telemetry_name: telemetry_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::DeviceCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) filter: Option, - pub(crate) maxpagesize: Option, - pub(crate) orderby: Option, - pub(crate) expand: Option, - } - impl RequestBuilder { - #[doc = "An expression on the resource type that selects the resources to be returned."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - self - } - #[doc = "An expression that specify the order of the returned resources."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self - } - #[doc = "The query parameter for including requested entities in response."] - pub fn expand(mut self, expand: impl Into) -> Self { - self.expand = Some(expand.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-31-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(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("filter", filter); - } - if let Some(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.to_string()); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("orderby", orderby); - } - if let Some(expand) = &this.expand { - req.url_mut().query_pairs_mut().append_pair("expand", expand); - } - 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!("{}/devices", 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, "2022-10-31-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::Device = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) expand: Option, - } - impl RequestBuilder { - #[doc = "The query parameter for including requested entities in response."] - pub fn expand(mut self, expand: impl Into) -> Self { - self.expand = Some(expand.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(expand) = &this.expand { - req.url_mut().query_pairs_mut().append_pair("expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::Device = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) body: models::Device, - pub(crate) expand: Option, - } - impl RequestBuilder { - #[doc = "The query parameter for including requested entities in response."] - pub fn expand(mut self, expand: impl Into) -> Self { - self.expand = Some(expand.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()), - ); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(expand) = &this.expand { - req.url_mut().query_pairs_mut().append_pair("expand", expand); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::Device = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) body: serde_json::Value, - pub(crate) expand: Option, - pub(crate) if_match: Option, - } - impl RequestBuilder { - #[doc = "The query parameter for including requested entities in response."] - pub fn expand(mut self, expand: impl Into) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()), - ); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(expand) = &this.expand { - req.url_mut().query_pairs_mut().append_pair("expand", expand); - } - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) device_id: String, - pub(crate) expand: Option, - } - impl RequestBuilder { - #[doc = "The query parameter for including requested entities in response."] - pub fn expand(mut self, expand: impl Into) -> Self { - self.expand = Some(expand.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::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(expand) = &this.expand { - req.url_mut().query_pairs_mut().append_pair("expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - } - pub mod apply_manifest { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentManifest = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) body: models::DeploymentManifest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!( - "{}/devices/{}/applyDeploymentManifest", - self.client.endpoint(), - &self.device_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_attestation { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Attestation = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_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!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_attestation { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Attestation = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) body: models::Attestation, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_attestation { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Attestation = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) body: serde_json::Value, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_attestation { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) device_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!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - } - pub mod get_command_history { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) command_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, "2022-10-31-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!( - "{}/devices/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.command_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); - } - Ok(url) - } - } - } - pub mod run_command { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) command_name: String, - pub(crate) body: models::DeviceCommand, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!( - "{}/devices/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.command_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_components { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Collection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_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!("{}/devices/{}/components", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_component_command_history { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) command_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, "2022-10-31-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!( - "{}/devices/{}/components/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.component_name, - &self.command_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); - } - Ok(url) - } - } - } - pub mod run_component_command { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) command_name: String, - pub(crate) body: models::DeviceCommand, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!( - "{}/devices/{}/components/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.component_name, - &self.command_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); - } - Ok(url) + #[doc = "Get device credentials"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn get_credentials(&self, device_id: impl Into) -> get_credentials::RequestBuilder { + get_credentials::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/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 = "List the modules present in a device"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn list_modules(&self, device_id: impl Into) -> list_modules::RequestBuilder { + list_modules::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } } - } - pub mod get_component_properties { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; - Ok(body) + #[doc = "Get module command history"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `command_name`: Name of this device command."] + pub fn get_module_command_history( + &self, + device_id: impl Into, + module_name: impl Into, + command_name: impl Into, + ) -> get_module_command_history::RequestBuilder { + get_module_command_history::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + command_name: command_name.into(), } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + } + #[doc = "Run a module command"] + #[doc = "Run a command on a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `command_name`: Name of this device command."] + #[doc = "* `body`: Device command body."] + pub fn run_module_command( + &self, + device_id: impl Into, + module_name: impl Into, + command_name: impl Into, + body: impl Into, + ) -> run_module_command::RequestBuilder { + run_module_command::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + command_name: command_name.into(), + body: body.into(), } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + } + #[doc = "List the components present in a module"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + pub fn list_module_components( + &self, + device_id: impl Into, + module_name: impl Into, + ) -> list_module_components::RequestBuilder { + list_module_components::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Get module component command history"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `command_name`: Name of this device command."] + pub fn get_module_component_command_history( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + command_name: impl Into, + ) -> get_module_component_command_history::RequestBuilder { + get_module_component_command_history::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + command_name: command_name.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Run a module component command"] + #[doc = "Run a command on a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `command_name`: Name of this device command."] + #[doc = "* `body`: Device command body."] + pub fn run_module_component_command( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + command_name: impl Into, + body: impl Into, + ) -> run_module_component_command::RequestBuilder { + run_module_component_command::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + command_name: command_name.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" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) unmodeled: Option, + #[doc = "Get module properties for a specific component"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + pub fn get_module_component_properties( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + ) -> get_module_component_properties::RequestBuilder { + get_module_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + } } - impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - self + #[doc = "Replace module properties for a specific component"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `body`: Module properties."] + pub fn replace_module_component_properties( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + body: impl Into, + ) -> replace_module_component_properties::RequestBuilder { + replace_module_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + body: body.into(), } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + } + #[doc = "Update module properties for a specific component via patch"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `body`: Module properties patch."] + pub fn update_module_component_properties( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + body: impl Into, + ) -> update_module_component_properties::RequestBuilder { + update_module_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + body: body.into(), + } + } + #[doc = "Get module component telemetry value"] + #[doc = "Get the last telemetry value from a module component."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `telemetry_name`: Name of this device telemetry."] + pub fn get_module_component_telemetry_value( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + telemetry_name: impl Into, + ) -> get_module_component_telemetry_value::RequestBuilder { + get_module_component_telemetry_value::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + telemetry_name: telemetry_name.into(), } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/components/{}/properties", - self.client.endpoint(), - &self.device_id, - &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-31-preview"); - } - Ok(url) + } + #[doc = "Get module properties"] + #[doc = "Get all property values of a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + pub fn get_module_properties( + &self, + device_id: impl Into, + module_name: impl Into, + ) -> get_module_properties::RequestBuilder { + get_module_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_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 sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/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 = "Replace module properties"] + #[doc = "Replace all property values of a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `body`: Module properties."] + pub fn replace_module_properties( + &self, + device_id: impl Into, + module_name: impl Into, + body: impl Into, + ) -> replace_module_properties::RequestBuilder { + replace_module_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + body: body.into(), } } - } - pub mod replace_component_properties { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; - Ok(body) + #[doc = "Update module properties via patch"] + #[doc = "Update property values of a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `body`: Module properties patch."] + pub fn update_module_properties( + &self, + device_id: impl Into, + module_name: impl Into, + body: impl Into, + ) -> update_module_properties::RequestBuilder { + update_module_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + body: body.into(), } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + } + #[doc = "Get module telemetry value"] + #[doc = "Get the last telemetry value from a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `telemetry_name`: Name of this device telemetry."] + pub fn get_module_telemetry_value( + &self, + device_id: impl Into, + module_name: impl Into, + telemetry_name: impl Into, + ) -> get_module_telemetry_value::RequestBuilder { + get_module_telemetry_value::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + telemetry_name: telemetry_name.into(), } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + } + #[doc = "Get device properties"] + #[doc = "Get all property values of a device by device ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn get_properties(&self, device_id: impl Into) -> get_properties::RequestBuilder { + get_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Replace device properties"] + #[doc = "Replace all property values of a device by device ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Device properties."] + pub fn replace_properties( + &self, + device_id: impl Into, + body: impl Into, + ) -> replace_properties::RequestBuilder { + replace_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + body: body.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Update device properties via patch"] + #[doc = "Update property values of a device by device ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Device properties patch."] + pub fn update_properties( + &self, + device_id: impl Into, + body: impl Into, + ) -> update_properties::RequestBuilder { + update_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.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" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) body: models::DeviceProperties, - pub(crate) unmodeled: Option, + #[doc = "Given the ID for an upstream device, will return the upstream and the downstream relationships associated with that gateway. These downstream relationships are only those associated with the direct downstream level (they don’t work recursively)."] + #[doc = "List all relationships based on device ID"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn list_relationships(&self, device_id: impl Into) -> list_relationships::RequestBuilder { + list_relationships::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + } } - impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - self + #[doc = "Given the ID for a device and a relationship ID associated with this device, get the details of the relationship."] + #[doc = "Get device relationship by ID"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] + pub fn get_relationship( + &self, + device_id: impl Into, + relationship_id: impl Into, + ) -> get_relationship::RequestBuilder { + get_relationship::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + relationship_id: relationship_id.into(), } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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)?; - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.to_string()); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + } + #[doc = "Given the ID for a device and a relationship ID associated with this device, create a new relationship for between the given device and a second device specified in the body."] + #[doc = "Create a device relationship"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] + #[doc = "* `body`: Device relationship body."] + pub fn create_relationship( + &self, + device_id: impl Into, + relationship_id: impl Into, + body: impl Into, + ) -> create_relationship::RequestBuilder { + create_relationship::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + relationship_id: relationship_id.into(), + body: body.into(), } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/components/{}/properties", - self.client.endpoint(), - &self.device_id, - &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-31-preview"); - } - Ok(url) + } + #[doc = "Patch a given relationship given the relationship ID and a given device ID."] + #[doc = "Update device relationship"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] + #[doc = "* `body`: Device relationship patch body."] + pub fn update_relationship( + &self, + device_id: impl Into, + relationship_id: impl Into, + body: impl Into, + ) -> update_relationship::RequestBuilder { + update_relationship::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + relationship_id: relationship_id.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 sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/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 = "Given the ID for a device and an associated relationship ID, delete the relationship. The given device ID can be that of the upstream or downstream device."] + #[doc = "Delete a device relationship"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] + pub fn remove_relationship( + &self, + device_id: impl Into, + relationship_id: impl Into, + ) -> remove_relationship::RequestBuilder { + remove_relationship::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + relationship_id: relationship_id.into(), + } + } + #[doc = "Get device telemetry value"] + #[doc = "Get the last telemetry value from a device."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `telemetry_name`: Name of this device telemetry."] + pub fn get_telemetry_value( + &self, + device_id: impl Into, + telemetry_name: impl Into, + ) -> get_telemetry_value::RequestBuilder { + get_telemetry_value::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + telemetry_name: telemetry_name.into(), } } } - pub mod update_component_properties { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7238,9 +3447,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7281,72 +3490,99 @@ pub mod devices { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) body: serde_json::Value, - pub(crate) unmodeled: Option, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) orderby: Option, } impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); + #[doc = "Filter string for results."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.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({ + #[doc = "Page size of returned results."] + pub fn top(mut self, top: i64) -> Self { + self.top = Some(top); + self + } + #[doc = "The order by string for results."] + 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 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)?; - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.to_string()); - } - 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, "1.1-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(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.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!( - "{}/devices/{}/components/{}/properties", - self.client.endpoint(), - &self.device_id, - &self.component_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_component_telemetry_value { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7355,9 +3591,9 @@ pub mod devices { #[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::DeviceTelemetry = serde_json::from_slice(&bytes)?; + let body: models::Device = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7399,8 +3635,6 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) telemetry_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7426,24 +3660,18 @@ pub mod devices { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/components/{}/telemetry/{}", - self.client.endpoint(), - &self.device_id, - &self.component_name, - &self.telemetry_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -7454,7 +3682,7 @@ pub mod devices { } } } - pub mod get_credentials { + pub mod create { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7463,9 +3691,9 @@ pub mod devices { #[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::DeviceCredentials = serde_json::from_slice(&bytes)?; + let body: models::Device = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7507,6 +3735,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, + pub(crate) body: models::Device, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7518,32 +3747,33 @@ pub mod devices { 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!("{}/devices/{}/credentials", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -7554,7 +3784,7 @@ pub mod devices { } } } - pub mod list_modules { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7563,9 +3793,9 @@ pub mod devices { #[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::Collection = serde_json::from_slice(&bytes)?; + let body: models::Device = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7607,6 +3837,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7618,32 +3849,33 @@ pub mod devices { 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!("{}/devices/{}/modules", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -7654,20 +3886,15 @@ pub mod devices { } } } - pub mod get_module_command_history { + pub mod remove { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -7707,80 +3934,42 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) command_name: String, } impl RequestBuilder { - 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-31-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 + 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!( - "{}/devices/{}/modules/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.command_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } - pub mod run_module_command { + pub mod get_attestation { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7789,9 +3978,9 @@ pub mod devices { #[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::DeviceCommand = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7833,9 +4022,6 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) command_name: String, - pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7847,39 +4033,32 @@ pub mod devices { 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!( - "{}/devices/{}/modules/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.command_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -7890,7 +4069,7 @@ pub mod devices { } } } - pub mod list_module_components { + pub mod create_attestation { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7899,9 +4078,9 @@ pub mod devices { #[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::Collection = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7943,7 +4122,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, + pub(crate) body: models::AttestationUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7955,37 +4134,33 @@ pub mod devices { 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!( - "{}/devices/{}/modules/{}/components", - self.client.endpoint(), - &self.device_id, - &self.module_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -7996,7 +4171,7 @@ pub mod devices { } } } - pub mod get_module_component_command_history { + pub mod update_attestation { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8005,9 +4180,9 @@ pub mod devices { #[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::DeviceCommandCollection = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8049,82 +4224,56 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, - pub(crate) command_name: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { - 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-31-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 + 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!( - "{}/devices/{}/modules/{}/components/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.component_name, - &self.command_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod run_module_component_command { + pub mod remove_attestation { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8133,11 +4282,6 @@ pub mod devices { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -8177,10 +4321,6 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, - pub(crate) command_name: String, - pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8192,51 +4332,31 @@ pub mod devices { 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( 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!( - "{}/devices/{}/modules/{}/components/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.component_name, - &self.command_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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, "1.1-preview"); + } + Ok(url) } } } - pub mod get_module_component_properties { + pub mod get_command_history { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8245,9 +4365,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8289,62 +4409,78 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, + pub(crate) command_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests 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::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", 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, "1.1-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!( - "{}/devices/{}/modules/{}/components/{}/properties", + "{}/devices/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.module_name, - &self.component_name + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod replace_module_component_properties { + pub mod run_command { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8353,9 +4489,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8397,9 +4533,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, - pub(crate) body: models::DeviceProperties, + pub(crate) command_name: String, + pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8411,7 +4546,7 @@ pub mod devices { 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( @@ -8427,23 +4562,22 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/components/{}/properties", + "{}/devices/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.module_name, - &self.component_name + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -8454,7 +4588,7 @@ pub mod devices { } } } - pub mod update_module_component_properties { + pub mod list_components { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8463,9 +4597,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::Collection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8507,9 +4641,6 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, - pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8521,39 +4652,32 @@ pub mod devices { 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::Get); let credential = this.client.token_credential(); 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!( - "{}/devices/{}/modules/{}/components/{}/properties", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.component_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/components", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -8564,7 +4688,7 @@ pub mod devices { } } } - pub mod get_module_component_telemetry_value { + pub mod get_component_command_history { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8573,9 +4697,9 @@ pub mod devices { #[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::DeviceTelemetry = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8617,64 +4741,80 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, pub(crate) component_name: String, - pub(crate) telemetry_name: String, + pub(crate) command_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests 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::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", 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, "1.1-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!( - "{}/devices/{}/modules/{}/components/{}/telemetry/{}", + "{}/devices/{}/components/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.module_name, &self.component_name, - &self.telemetry_name + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_module_properties { + pub mod run_component_command { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8683,9 +4823,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8727,7 +4867,9 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) command_name: String, + pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8739,14 +4881,15 @@ pub mod devices { 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?)) } @@ -8754,22 +4897,23 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/properties", + "{}/devices/{}/components/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.module_name + &self.component_name, + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -8780,7 +4924,7 @@ pub mod devices { } } } - pub mod replace_module_properties { + pub mod get_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8833,8 +4977,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) body: models::DeviceProperties, + 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."] @@ -8846,15 +4989,14 @@ pub mod devices { 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()), ); - 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?)) } @@ -8862,15 +5004,15 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/properties", + "{}/devices/{}/components/{}/properties", self.client.endpoint(), &self.device_id, - &self.module_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } @@ -8888,7 +5030,7 @@ pub mod devices { } } } - pub mod update_module_properties { + pub mod replace_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8941,8 +5083,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) body: serde_json::Value, + pub(crate) component_name: String, + pub(crate) body: models::DeviceProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8954,7 +5096,7 @@ pub mod devices { 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::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -8970,15 +5112,15 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/properties", + "{}/devices/{}/components/{}/properties", self.client.endpoint(), &self.device_id, - &self.module_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } @@ -8996,7 +5138,7 @@ pub mod devices { } } } - pub mod get_module_telemetry_value { + pub mod update_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9005,9 +5147,9 @@ pub mod devices { #[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::DeviceTelemetry = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9049,8 +5191,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) telemetry_name: String, + pub(crate) component_name: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9062,14 +5204,15 @@ pub mod devices { 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?)) } @@ -9077,23 +5220,22 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/telemetry/{}", + "{}/devices/{}/components/{}/properties", self.client.endpoint(), &self.device_id, - &self.module_name, - &self.telemetry_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -9104,7 +5246,7 @@ pub mod devices { } } } - pub mod get_properties { + pub mod get_component_telemetry_value { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9113,9 +5255,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceTelemetry = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9157,14 +5299,10 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) unmodeled: Option, + pub(crate) component_name: String, + pub(crate) telemetry_name: String, } impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - 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()`."] @@ -9181,9 +5319,6 @@ pub mod devices { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9191,18 +5326,24 @@ pub mod devices { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/devices/{}/properties", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/components/{}/telemetry/{}", + self.client.endpoint(), + &self.device_id, + &self.component_name, + &self.telemetry_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -9213,7 +5354,7 @@ pub mod devices { } } } - pub mod replace_properties { + pub mod get_credentials { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9222,9 +5363,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCredentials = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9266,15 +5407,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) body: models::DeviceProperties, - pub(crate) unmodeled: Option, } impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - 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()`."] @@ -9284,36 +5418,32 @@ pub mod devices { 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()), ); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.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!("{}/devices/{}/properties", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/credentials", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -9324,7 +5454,7 @@ pub mod devices { } } } - pub mod update_properties { + pub mod list_modules { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9333,9 +5463,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::Collection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9377,15 +5507,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) body: serde_json::Value, - pub(crate) unmodeled: Option, } impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - 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()`."] @@ -9395,36 +5518,32 @@ pub mod devices { 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::Get); let credential = this.client.token_credential(); 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)?; - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.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!("{}/devices/{}/properties", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/modules", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -9435,7 +5554,7 @@ pub mod devices { } } } - pub mod list_relationships { + pub mod get_module_command_history { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9444,9 +5563,9 @@ pub mod devices { #[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::DeviceRelationshipCollection = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9488,15 +5607,11 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) maxpagesize: Option, + pub(crate) module_name: String, + pub(crate) command_name: String, } impl RequestBuilder { - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - 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 { @@ -9517,7 +5632,7 @@ pub mod devices { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -9531,9 +5646,6 @@ pub mod devices { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -9551,124 +5663,24 @@ pub mod devices { }; azure_core::Pageable::new(make_request) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/devices/{}/relationships", self.client.endpoint(), &self.device_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-31-preview"); - } - Ok(url) - } - } - } - pub mod get_relationship { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceRelationship = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) relationship_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!( - "{}/devices/{}/relationships/{}", + "{}/devices/{}/modules/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.relationship_id + &self.module_name, + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_relationship { + pub mod run_module_command { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9677,9 +5689,9 @@ pub mod devices { #[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::DeviceRelationship = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9721,8 +5733,9 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) relationship_id: String, - pub(crate) body: models::DeviceRelationship, + pub(crate) module_name: String, + pub(crate) command_name: String, + pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9734,7 +5747,7 @@ pub mod devices { 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( @@ -9750,22 +5763,23 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/relationships/{}", + "{}/devices/{}/modules/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.relationship_id + &self.module_name, + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -9776,7 +5790,7 @@ pub mod devices { } } } - pub mod update_relationship { + pub mod list_module_components { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9785,9 +5799,9 @@ pub mod devices { #[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::DeviceRelationship = serde_json::from_slice(&bytes)?; + let body: models::Collection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9829,8 +5843,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) relationship_id: String, - pub(crate) body: serde_json::Value, + pub(crate) module_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9842,15 +5855,14 @@ pub mod devices { 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::Get); let credential = this.client.token_credential(); 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?)) } @@ -9858,22 +5870,22 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/relationships/{}", + "{}/devices/{}/modules/{}/components", self.client.endpoint(), &self.device_id, - &self.relationship_id + &self.module_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -9884,7 +5896,7 @@ pub mod devices { } } } - pub mod remove_relationship { + pub mod get_module_component_command_history { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9893,6 +5905,11 @@ pub mod devices { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -9932,48 +5949,82 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) relationship_id: String, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) command_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests 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, "1.1-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!( - "{}/devices/{}/relationships/{}", + "{}/devices/{}/modules/{}/components/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.relationship_id + &self.module_name, + &self.component_name, + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } - pub mod get_telemetry_value { + pub mod run_module_component_command { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9982,9 +6033,9 @@ pub mod devices { #[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::DeviceTelemetry = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10026,7 +6077,10 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) telemetry_name: String, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) command_name: String, + pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10038,14 +6092,15 @@ pub mod devices { 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?)) } @@ -10053,22 +6108,24 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/telemetry/{}", + "{}/devices/{}/modules/{}/components/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.telemetry_name + &self.module_name, + &self.component_name, + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -10079,153 +6136,7 @@ pub mod devices { } } } -} -pub mod enrollment_groups { - 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 = "Get the list of enrollment groups in an application"] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - #[doc = "Get an enrollment group by ID"] - #[doc = "Get details about an enrollment group by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - pub fn get(&self, enrollment_group_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - } - } - #[doc = "Create an enrollment group"] - #[doc = "Create an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `body`: Enrollment group body."] - pub fn create(&self, enrollment_group_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - body: body.into(), - } - } - #[doc = "Update an enrollment group"] - #[doc = "Update an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `body`: Enrollment group patch body."] - pub fn update(&self, enrollment_group_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - body: body.into(), - if_match: None, - } - } - #[doc = "Delete an enrollment group"] - #[doc = "Delete an enrollment group by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - pub fn remove(&self, enrollment_group_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - } - } - #[doc = "Get the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Get details about the primary or secondary x509 certificate of an enrollment group, if it exists."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - pub fn get_x509(&self, enrollment_group_id: impl Into, entry: impl Into) -> get_x509::RequestBuilder { - get_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.into(), - } - } - #[doc = "Sets the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Sets the primary or secondary x509 certificate of an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - #[doc = "* `body`: Certificate definition."] - pub fn create_x509( - &self, - enrollment_group_id: impl Into, - entry: impl Into, - body: impl Into, - ) -> create_x509::RequestBuilder { - create_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.into(), - body: body.into(), - } - } - #[doc = "Removes the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Removes the primary or secondary x509 certificate of an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - pub fn remove_x509(&self, enrollment_group_id: impl Into, entry: impl Into) -> remove_x509::RequestBuilder { - remove_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.into(), - } - } - #[doc = "Generate a verification code for the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Generate a verification code for the primary or secondary x509 certificate of an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - pub fn generate_verification_code_x509( - &self, - enrollment_group_id: impl Into, - entry: impl Into, - ) -> generate_verification_code_x509::RequestBuilder { - generate_verification_code_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.into(), - } - } - #[doc = "Verify the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Verify the primary or secondary x509 certificate of an enrollment group by providing a certificate with the signed verification code."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - #[doc = "* `body`: Certificate for the signed verification code."] - pub fn verify_x509( - &self, - enrollment_group_id: impl Into, - entry: impl Into, - body: impl Into, - ) -> verify_x509::RequestBuilder { - verify_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.into(), - body: body.into(), - } - } - } - pub mod list { + pub mod get_module_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10234,9 +6145,9 @@ pub mod enrollment_groups { #[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::EnrollmentGroupCollection = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10272,77 +6183,68 @@ pub mod enrollment_groups { #[doc = r""] #[doc = r" If you need lower-level access to the raw response details"] #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] 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 { - 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-31-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 + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) device_id: String, + pub(crate) module_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?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/enrollmentGroups", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/modules/{}/components/{}/properties", + self.client.endpoint(), + &self.device_id, + &self.module_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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 replace_module_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10351,9 +6253,9 @@ pub mod enrollment_groups { #[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::EnrollmentGroup = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10394,7 +6296,10 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) body: models::DeviceProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10406,14 +6311,15 @@ pub mod enrollment_groups { 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?)) } @@ -10421,21 +6327,23 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}", + "{}/devices/{}/modules/{}/components/{}/properties", self.client.endpoint(), - &self.enrollment_group_id + &self.device_id, + &self.module_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -10446,7 +6354,7 @@ pub mod enrollment_groups { } } } - pub mod create { + pub mod update_module_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10455,9 +6363,9 @@ pub mod enrollment_groups { #[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::EnrollmentGroup = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10498,8 +6406,10 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) body: models::EnrollmentGroup, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10511,7 +6421,7 @@ pub mod enrollment_groups { 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( @@ -10527,21 +6437,23 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}", + "{}/devices/{}/modules/{}/components/{}/properties", self.client.endpoint(), - &self.enrollment_group_id + &self.device_id, + &self.module_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -10552,7 +6464,7 @@ pub mod enrollment_groups { } } } - pub mod update { + pub mod get_module_component_telemetry_value { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10561,9 +6473,9 @@ pub mod enrollment_groups { #[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::EnrollmentGroup = serde_json::from_slice(&bytes)?; + let body: models::DeviceTelemetry = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10604,16 +6516,12 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) telemetry_name: String, } impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()`."] @@ -10623,18 +6531,14 @@ pub mod enrollment_groups { 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::Get); let credential = this.client.token_credential(); 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/merge-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -10642,21 +6546,24 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}", + "{}/devices/{}/modules/{}/components/{}/telemetry/{}", self.client.endpoint(), - &self.enrollment_group_id + &self.device_id, + &self.module_name, + &self.component_name, + &self.telemetry_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -10667,7 +6574,7 @@ pub mod enrollment_groups { } } } - pub mod remove { + pub mod get_module_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10676,6 +6583,11 @@ pub mod enrollment_groups { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -10714,7 +6626,8 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, + pub(crate) device_id: String, + pub(crate) module_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10726,7 +6639,7 @@ pub mod enrollment_groups { 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( @@ -10741,20 +6654,33 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}", + "{}/devices/{}/modules/{}/properties", self.client.endpoint(), - &self.enrollment_group_id + &self.device_id, + &self.module_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_x509 { + pub mod replace_module_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10763,9 +6689,9 @@ pub mod enrollment_groups { #[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::SigningX509Certificate = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10806,8 +6732,9 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) body: models::DeviceProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10819,14 +6746,15 @@ pub mod enrollment_groups { 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?)) } @@ -10834,22 +6762,22 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}/certificates/{}", + "{}/devices/{}/modules/{}/properties", self.client.endpoint(), - &self.enrollment_group_id, - &self.entry + &self.device_id, + &self.module_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -10860,7 +6788,7 @@ pub mod enrollment_groups { } } } - pub mod create_x509 { + pub mod update_module_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10869,9 +6797,9 @@ pub mod enrollment_groups { #[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::SigningX509Certificate = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10912,9 +6840,9 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, - pub(crate) body: models::SigningX509Certificate, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10926,7 +6854,7 @@ pub mod enrollment_groups { 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( @@ -10942,22 +6870,22 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}/certificates/{}", + "{}/devices/{}/modules/{}/properties", self.client.endpoint(), - &self.enrollment_group_id, - &self.entry + &self.device_id, + &self.module_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -10968,7 +6896,7 @@ pub mod enrollment_groups { } } } - pub mod remove_x509 { + pub mod get_module_telemetry_value { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10977,6 +6905,11 @@ pub mod enrollment_groups { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceTelemetry = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -11015,8 +6948,9 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) telemetry_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11028,7 +6962,7 @@ pub mod enrollment_groups { 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( @@ -11043,21 +6977,34 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}/certificates/{}", + "{}/devices/{}/modules/{}/telemetry/{}", self.client.endpoint(), - &self.enrollment_group_id, - &self.entry + &self.device_id, + &self.module_name, + &self.telemetry_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod generate_verification_code_x509 { + pub mod get_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11066,9 +7013,9 @@ pub mod enrollment_groups { #[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::X509VerificationCode = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11109,8 +7056,7 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, + pub(crate) device_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."] @@ -11122,7 +7068,7 @@ pub mod enrollment_groups { 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( @@ -11130,30 +7076,24 @@ pub mod enrollment_groups { 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!( - "{}/enrollmentGroups/{}/certificates/{}/generateVerificationCode", - self.client.endpoint(), - &self.enrollment_group_id, - &self.entry - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/properties", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -11164,7 +7104,7 @@ pub mod enrollment_groups { } } } - pub mod verify_x509 { + pub mod replace_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11173,6 +7113,11 @@ pub mod enrollment_groups { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -11211,9 +7156,8 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, - pub(crate) body: models::X509VerificationCertificate, + pub(crate) device_id: String, + pub(crate) body: models::DeviceProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11225,7 +7169,7 @@ pub mod enrollment_groups { 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( @@ -11240,61 +7184,29 @@ pub mod enrollment_groups { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}/certificates/{}/verify", - self.client.endpoint(), - &self.enrollment_group_id, - &self.entry - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); - } - Ok(url) - } - } - } -} -pub mod file_uploads { - 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 = "Get the file upload storage account configuration."] - pub fn get(&self) -> get::RequestBuilder { - get::RequestBuilder { client: self.0.clone() } - } - #[doc = "Create the file upload storage account configuration."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `body`: File upload storage account configuration body."] - pub fn create(&self, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - body: body.into(), - } - } - #[doc = "Update the file upload storage account configuration"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `body`: File upload storage account configuration body."] - pub fn update(&self, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - body: body.into(), - if_match: None, + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/properties", self.client.endpoint(), &self.device_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, "1.1-preview"); + } + Ok(url) } } - #[doc = "Delete the file upload storage configuration."] - pub fn remove(&self) -> remove::RequestBuilder { - remove::RequestBuilder { client: self.0.clone() } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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 update_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11303,9 +7215,9 @@ pub mod file_uploads { #[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::FileUpload = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11346,6 +7258,8 @@ pub mod file_uploads { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) device_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11357,32 +7271,33 @@ pub mod file_uploads { 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!("{}/fileUploads", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/properties", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -11393,7 +7308,7 @@ pub mod file_uploads { } } } - pub mod create { + pub mod list_relationships { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11402,9 +7317,9 @@ pub mod file_uploads { #[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::FileUpload = serde_json::from_slice(&bytes)?; + let body: models::DeviceRelationshipCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11445,7 +7360,7 @@ pub mod file_uploads { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) body: models::FileUpload, + pub(crate) device_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."] @@ -11457,33 +7372,32 @@ pub mod file_uploads { 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()), ); - 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!("{}/fileUploads", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/relationships/", self.client.endpoint(), &self.device_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -11494,7 +7408,7 @@ pub mod file_uploads { } } } - pub mod update { + pub mod get_relationship { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11503,9 +7417,9 @@ pub mod file_uploads { #[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::FileUpload = serde_json::from_slice(&bytes)?; + let body: models::DeviceRelationship = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11546,15 +7460,10 @@ pub mod file_uploads { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, + pub(crate) device_id: String, + pub(crate) relationship_id: String, } impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()`."] @@ -11564,36 +7473,37 @@ pub mod file_uploads { 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::Get); let credential = this.client.token_credential(); 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)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/fileUploads", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/relationships/{}", + self.client.endpoint(), + &self.device_id, + &self.relationship_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -11604,7 +7514,7 @@ pub mod file_uploads { } } } - pub mod remove { + pub mod create_relationship { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11613,6 +7523,11 @@ pub mod file_uploads { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceRelationship = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -11651,6 +7566,9 @@ pub mod file_uploads { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) device_id: String, + pub(crate) relationship_id: String, + pub(crate) body: models::DeviceRelationship, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11662,118 +7580,49 @@ pub mod file_uploads { 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!("{}/fileUploads", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/relationships/{}", + self.client.endpoint(), + &self.device_id, + &self.relationship_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-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 = "Get the list of jobs in an application"] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - maxpagesize: None, - } - } - #[doc = "Get a job by ID"] - #[doc = "Get details about a running or completed job by job ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - pub fn get(&self, job_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - } - } - #[doc = "Execute a new job"] - #[doc = "Create and execute a new job via its job definition."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - #[doc = "* `body`: Job definition."] - pub fn create(&self, job_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - body: body.into(), - } - } - #[doc = "Get device statuses"] - #[doc = "Get the list of individual device statuses by job ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - pub fn get_devices(&self, job_id: impl Into) -> get_devices::RequestBuilder { - get_devices::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - } - } - #[doc = "Rerun a job on failed devices"] - #[doc = "Execute a rerun of an existing job on all failed devices."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - #[doc = "* `rerun_id`: Unique ID of the job rerun."] - pub fn rerun(&self, job_id: impl Into, rerun_id: impl Into) -> rerun::RequestBuilder { - rerun::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - rerun_id: rerun_id.into(), - } - } - #[doc = "Resume a stopped job"] - #[doc = "Resume execution of an existing stopped job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - pub fn resume(&self, job_id: impl Into) -> resume::RequestBuilder { - resume::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - } - } - #[doc = "Stop a running job"] - #[doc = "Stop execution of a job that is currently running."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - pub fn stop(&self, job_id: impl Into) -> stop::RequestBuilder { - stop::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_relationship { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11782,9 +7631,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::JobCollection = serde_json::from_slice(&bytes)?; + let body: models::DeviceRelationship = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11825,81 +7674,63 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) maxpagesize: Option, + pub(crate) device_id: String, + pub(crate) relationship_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - 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-31-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(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.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 + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::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?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/jobs", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/relationships/{}", + self.client.endpoint(), + &self.device_id, + &self.relationship_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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 remove_relationship { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11908,11 +7739,6 @@ 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::Job = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -11951,7 +7777,8 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, + pub(crate) device_id: String, + pub(crate) relationship_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."] @@ -11963,7 +7790,7 @@ pub mod jobs { 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( @@ -11977,29 +7804,22 @@ pub mod jobs { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/jobs/{}", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/relationships/{}", + self.client.endpoint(), + &self.device_id, + &self.relationship_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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 { + pub mod get_telemetry_value { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12008,9 +7828,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::Job = serde_json::from_slice(&bytes)?; + let body: models::DeviceTelemetry = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12051,8 +7871,8 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, - pub(crate) body: models::Job, + pub(crate) device_id: String, + pub(crate) telemetry_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12064,33 +7884,37 @@ pub mod jobs { 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()), ); - 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!("{}/jobs/{}", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/telemetry/{}", + self.client.endpoint(), + &self.device_id, + &self.telemetry_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -12101,7 +7925,45 @@ pub mod jobs { } } } - pub mod get_devices { +} +pub mod file_uploads { + 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 = "Get the file upload storage account configuration."] + pub fn get(&self) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone() } + } + #[doc = "Create the file upload storage account configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `body`: File upload storage account configuration body."] + pub fn create(&self, body: impl Into) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + body: body.into(), + } + } + #[doc = "Update the file upload storage account configuration"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `body`: File upload storage account configuration body."] + pub fn update(&self, body: impl Into) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + body: body.into(), + } + } + #[doc = "Delete the file upload storage configuration."] + pub fn remove(&self) -> remove::RequestBuilder { + remove::RequestBuilder { client: self.0.clone() } + } + } + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12110,9 +7972,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::JobDeviceStatusCollection = serde_json::from_slice(&bytes)?; + let body: models::FileUpload = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12153,73 +8015,54 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, } impl RequestBuilder { - 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-31-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 + 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!("{}/jobs/{}/devices", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/fileUploads", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod rerun { + pub mod create { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12228,9 +8071,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::Job = serde_json::from_slice(&bytes)?; + let body: models::FileUpload = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12271,8 +8114,7 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, - pub(crate) rerun_id: String, + pub(crate) body: models::FileUpload, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12291,30 +8133,26 @@ pub mod jobs { 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!( - "{}/jobs/{}/rerun/{}", - self.client.endpoint(), - &self.job_id, - &self.rerun_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/fileUploads", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -12325,7 +8163,7 @@ pub mod jobs { } } } - pub mod resume { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12334,6 +8172,11 @@ 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::FileUpload = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -12372,7 +8215,7 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12384,32 +8227,44 @@ pub mod 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::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(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!("{}/jobs/{}/resume", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/fileUploads", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod stop { + pub mod remove { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12456,7 +8311,6 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_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."] @@ -12468,7 +8322,7 @@ pub mod 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( @@ -12476,25 +8330,24 @@ pub mod 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!("{}/jobs/{}/stop", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/fileUploads", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } } -pub mod organizations { +pub mod jobs { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12502,53 +8355,78 @@ pub mod organizations { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of organizations the user has access to in an application"] + #[doc = "Get the list of jobs in an application"] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } - #[doc = "Get an organization by ID"] + #[doc = "Get a job by ID"] + #[doc = "Get details about a running or completed job by job ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `organization_id`: Unique ID for the organization."] - pub fn get(&self, organization_id: impl Into) -> get::RequestBuilder { + #[doc = "* `job_id`: Unique ID of the job."] + pub fn get(&self, job_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - organization_id: organization_id.into(), + job_id: job_id.into(), } } - #[doc = "Create an organization in the application"] + #[doc = "Execute a new job"] + #[doc = "Create and execute a new job via its job definition."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `organization_id`: Unique ID for the organization."] - #[doc = "* `body`: Organization body."] - pub fn create(&self, organization_id: impl Into, body: impl Into) -> create::RequestBuilder { + #[doc = "* `job_id`: Unique ID of the job."] + #[doc = "* `body`: Job definition."] + pub fn create(&self, job_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - organization_id: organization_id.into(), + job_id: job_id.into(), body: body.into(), } } - #[doc = "Update an organization in the application via patch"] + #[doc = "Get device statuses"] + #[doc = "Get the list of individual device statuses by job ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `organization_id`: Unique ID for the organization."] - #[doc = "* `body`: Organization patch body."] - pub fn update(&self, organization_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { + #[doc = "* `job_id`: Unique ID of the job."] + pub fn get_devices(&self, job_id: impl Into) -> get_devices::RequestBuilder { + get_devices::RequestBuilder { client: self.0.clone(), - organization_id: organization_id.into(), - body: body.into(), - if_match: None, + job_id: job_id.into(), } } - #[doc = "Delete an organization"] + #[doc = "Rerun a job on failed devices"] + #[doc = "Execute a rerun of an existing job on all failed devices."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `organization_id`: Unique ID for the organization."] - pub fn remove(&self, organization_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { + #[doc = "* `job_id`: Unique ID of the job."] + #[doc = "* `rerun_id`: Unique ID of the job rerun."] + pub fn rerun(&self, job_id: impl Into, rerun_id: impl Into) -> rerun::RequestBuilder { + rerun::RequestBuilder { client: self.0.clone(), - organization_id: organization_id.into(), + job_id: job_id.into(), + rerun_id: rerun_id.into(), + } + } + #[doc = "Resume a stopped job"] + #[doc = "Resume execution of an existing stopped job."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `job_id`: Unique ID of the job."] + pub fn resume(&self, job_id: impl Into) -> resume::RequestBuilder { + resume::RequestBuilder { + client: self.0.clone(), + job_id: job_id.into(), + } + } + #[doc = "Stop a running job"] + #[doc = "Stop execution of a job that is currently running."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `job_id`: Unique ID of the job."] + pub fn stop(&self, job_id: impl Into) -> stop::RequestBuilder { + stop::RequestBuilder { + client: self.0.clone(), + job_id: job_id.into(), } } } @@ -12561,9 +8439,9 @@ pub mod organizations { #[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::OrganizationCollection = serde_json::from_slice(&bytes)?; + let body: models::JobCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12606,7 +8484,7 @@ pub mod organizations { pub(crate) client: super::super::Client, } impl RequestBuilder { - 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 { @@ -12627,7 +8505,7 @@ pub mod organizations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -12659,11 +8537,11 @@ pub mod organizations { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/organizations", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } @@ -12678,9 +8556,9 @@ pub mod organizations { #[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::Organization = serde_json::from_slice(&bytes)?; + let body: models::Job = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12721,7 +8599,7 @@ pub mod organizations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) organization_id: String, + pub(crate) job_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."] @@ -12747,18 +8625,18 @@ pub mod organizations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_id))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}", self.client.endpoint(), &self.job_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -12778,9 +8656,9 @@ pub mod organizations { #[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::Organization = serde_json::from_slice(&bytes)?; + let body: models::Job = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12821,8 +8699,8 @@ pub mod organizations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) organization_id: String, - pub(crate) body: models::Organization, + pub(crate) job_id: String, + pub(crate) body: models::Job, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12849,18 +8727,18 @@ pub mod organizations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_id))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}", self.client.endpoint(), &self.job_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -12871,7 +8749,7 @@ pub mod organizations { } } } - pub mod update { + pub mod get_devices { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12880,9 +8758,9 @@ pub mod organizations { #[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::Organization = serde_json::from_slice(&bytes)?; + let body: models::JobDeviceStatusCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12923,16 +8801,9 @@ pub mod organizations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) organization_id: String, - pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, + pub(crate) job_id: String, } impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()`."] @@ -12942,36 +8813,32 @@ pub mod organizations { 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::Get); let credential = this.client.token_credential(); 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)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_id))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}/devices", self.client.endpoint(), &self.job_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -12982,110 +8849,7 @@ pub mod organizations { } } } - pub mod remove { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) organization_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!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-31-preview"); - } - Ok(url) - } - } - } -} -pub mod query { - 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 = "Run a query and obtain the result"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `body`: query, more details on [IoT central query language](https://aka.ms/iotcql)."] - pub fn run(&self, body: impl Into) -> run::RequestBuilder { - run::RequestBuilder { - client: self.0.clone(), - body: body.into(), - } - } - } - pub mod run { + pub mod rerun { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13094,9 +8858,9 @@ pub mod query { #[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::QueryResponse = serde_json::from_slice(&bytes)?; + let body: models::Job = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13137,7 +8901,8 @@ pub mod query { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) body: models::QueryRequest, + pub(crate) job_id: String, + pub(crate) rerun_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."] @@ -13149,33 +8914,37 @@ pub mod query { 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()), ); - 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!("{}/query", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/jobs/{}/rerun/{}", + self.client.endpoint(), + &self.job_id, + &self.rerun_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -13186,31 +8955,7 @@ pub mod query { } } } -} -pub mod roles { - 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 = "Get the list of roles in an application."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - #[doc = "Get a role by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `role_id`: Unique ID for the role."] - pub fn get(&self, role_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - role_id: role_id.into(), - } - } - } - pub mod list { + pub mod resume { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13219,11 +8964,6 @@ pub mod roles { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RoleCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -13262,72 +9002,44 @@ pub mod roles { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) job_id: String, } impl RequestBuilder { - 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-31-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 + 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?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/roles", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}/resume", self.client.endpoint(), &self.job_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } } - pub mod get { + pub mod stop { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13336,11 +9048,6 @@ pub mod roles { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Role = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -13379,7 +9086,7 @@ pub mod roles { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) role_id: String, + pub(crate) job_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."] @@ -13391,7 +9098,7 @@ pub mod roles { 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( @@ -13399,36 +9106,25 @@ pub mod roles { 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!("{}/roles/{}", self.client.endpoint(), &self.role_id))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}/stop", self.client.endpoint(), &self.job_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod scheduled_jobs { +pub mod organizations { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13436,71 +9132,52 @@ pub mod scheduled_jobs { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of scheduled job definitions in an application"] + #[doc = "Get the list of organizations the user has access to in an application"] pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - maxpagesize: None, - } + list::RequestBuilder { client: self.0.clone() } } - #[doc = "Get a scheduled job by ID"] - #[doc = "Get details about a scheduled job by ID."] + #[doc = "Get an organization by ID"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - pub fn get(&self, scheduled_job_id: impl Into) -> get::RequestBuilder { + #[doc = "* `organization_id`: Unique ID of the organization."] + pub fn get(&self, organization_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), + organization_id: organization_id.into(), } } - #[doc = "Create or update a scheduled job"] - #[doc = "Create or update a scheduled job by ID."] + #[doc = "Create an organization in the application"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - #[doc = "* `body`: Scheduled job definition."] - pub fn create(&self, scheduled_job_id: impl Into, body: impl Into) -> create::RequestBuilder { + #[doc = "* `organization_id`: Unique ID of the organization."] + #[doc = "* `body`: Organization body."] + pub fn create(&self, organization_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), + organization_id: organization_id.into(), body: body.into(), } } - #[doc = "Update a scheduled job via patch"] - #[doc = "Update an existing scheduled job by ID."] + #[doc = "Update an organization in the application via patch"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - #[doc = "* `body`: Scheduled job patch."] - pub fn update(&self, scheduled_job_id: impl Into, body: impl Into) -> update::RequestBuilder { + #[doc = "* `organization_id`: Unique ID of the organization."] + #[doc = "* `body`: Organization patch body."] + pub fn update(&self, organization_id: impl Into, body: impl Into) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), + organization_id: organization_id.into(), body: body.into(), - if_match: None, } } - #[doc = "Delete a scheduled job"] - #[doc = "Delete an existing scheduled job by ID."] + #[doc = "Delete an organization"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - pub fn remove(&self, scheduled_job_id: impl Into) -> remove::RequestBuilder { + #[doc = "* `organization_id`: Unique ID of the organization."] + pub fn remove(&self, organization_id: impl Into) -> remove::RequestBuilder { remove::RequestBuilder { client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), - } - } - #[doc = "Get the list of jobs for a scheduled job definition"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - pub fn list_jobs(&self, scheduled_job_id: impl Into) -> list_jobs::RequestBuilder { - list_jobs::RequestBuilder { - client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), - maxpagesize: None, + organization_id: organization_id.into(), } } } @@ -13513,9 +9190,9 @@ pub mod scheduled_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::ScheduledJobCollection = serde_json::from_slice(&bytes)?; + let body: models::OrganizationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13556,15 +9233,9 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) maxpagesize: Option, } impl RequestBuilder { - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - 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 { @@ -13585,7 +9256,7 @@ pub mod scheduled_jobs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -13599,9 +9270,6 @@ pub mod scheduled_jobs { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -13616,21 +9284,121 @@ pub mod scheduled_jobs { }; rsp?.into_body().await } - }; - azure_core::Pageable::new(make_request) + }; + azure_core::Pageable::new(make_request) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!("{}/organizations", 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, "1.1-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::Organization = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization_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!("{}/scheduledJobs", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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 create { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13639,9 +9407,9 @@ pub mod scheduled_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::ScheduledJob = serde_json::from_slice(&bytes)?; + let body: models::Organization = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13682,7 +9450,8 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, + pub(crate) organization_id: String, + pub(crate) body: models::Organization, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13694,32 +9463,33 @@ pub mod scheduled_jobs { 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!("{}/scheduledJobs/{}", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -13730,7 +9500,7 @@ pub mod scheduled_jobs { } } } - pub mod create { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13739,9 +9509,9 @@ pub mod scheduled_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::ScheduledJob = serde_json::from_slice(&bytes)?; + let body: models::Organization = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13782,8 +9552,8 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, - pub(crate) body: models::ScheduledJob, + pub(crate) organization_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13795,7 +9565,7 @@ pub mod scheduled_jobs { 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( @@ -13810,18 +9580,18 @@ pub mod scheduled_jobs { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/scheduledJobs/{}", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -13832,7 +9602,7 @@ pub mod scheduled_jobs { } } } - pub mod update { + pub mod remove { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13841,11 +9611,6 @@ pub mod scheduled_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::ScheduledJob = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -13884,16 +9649,9 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, - pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, + pub(crate) organization_id: String, } impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()`."] @@ -13903,47 +9661,51 @@ pub mod scheduled_jobs { 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/merge-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/scheduledJobs/{}", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod query { + 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 = "Run a query and obtain the result"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `body`: query, more details in [IoT central query language](https://aka.ms/iotcql)"] + pub fn run(&self, body: impl Into) -> run::RequestBuilder { + run::RequestBuilder { + client: self.0.clone(), + body: body.into(), } } } - pub mod remove { + pub mod run { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13952,6 +9714,11 @@ pub mod scheduled_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::QueryResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -13990,7 +9757,7 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, + pub(crate) body: models::QueryRequest, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14002,31 +9769,68 @@ pub mod scheduled_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::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!("{}/scheduledJobs/{}", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/query", 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, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod roles { + 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 = "Get the list of roles in an application."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + #[doc = "Get a role by ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `role_id`: Unique ID for the role."] + pub fn get(&self, role_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + role_id: role_id.into(), + } + } } - pub mod list_jobs { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -14035,9 +9839,9 @@ pub mod scheduled_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::JobCollection = serde_json::from_slice(&bytes)?; + let body: models::RoleCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14078,16 +9882,9 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, - pub(crate) maxpagesize: Option, } impl RequestBuilder { - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - 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 { @@ -14108,7 +9905,7 @@ pub mod scheduled_jobs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14122,9 +9919,6 @@ pub mod scheduled_jobs { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -14143,15 +9937,115 @@ pub mod scheduled_jobs { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/scheduledJobs/{}/jobs", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/roles", 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, "1.1-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::Role = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) role_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!("{}/roles/{}", self.client.endpoint(), &self.role_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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } pub mod users { @@ -14164,15 +10058,12 @@ pub mod users { impl Client { #[doc = "Get the list of users in an application"] pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - maxpagesize: None, - } + list::RequestBuilder { client: self.0.clone() } } #[doc = "Get a user by ID"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `user_id`: Unique ID for the user."] + #[doc = "* `user_id`: Unique ID of the user."] pub fn get(&self, user_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -14182,9 +10073,9 @@ pub mod users { #[doc = "Create a user in the application"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `user_id`: Unique ID for the user."] + #[doc = "* `user_id`: Unique ID of the user."] #[doc = "* `body`: User body."] - pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { + pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), user_id: user_id.into(), @@ -14194,20 +10085,19 @@ pub mod users { #[doc = "Update a user in the application via patch"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `user_id`: Unique ID for the user."] + #[doc = "* `user_id`: Unique ID of the user."] #[doc = "* `body`: User patch body."] pub fn update(&self, user_id: impl Into, body: impl Into) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), user_id: user_id.into(), body: body.into(), - if_match: None, } } #[doc = "Delete a user"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `user_id`: Unique ID for the user."] + #[doc = "* `user_id`: Unique ID of the user."] pub fn remove(&self, user_id: impl Into) -> remove::RequestBuilder { remove::RequestBuilder { client: self.0.clone(), @@ -14267,14 +10157,8 @@ pub mod users { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) maxpagesize: Option, } impl RequestBuilder { - #[doc = "The maximum number of resources to return from one response."] - pub fn maxpagesize(mut self, maxpagesize: i32) -> Self { - self.maxpagesize = Some(maxpagesize); - self - } pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); @@ -14296,7 +10180,7 @@ pub mod users { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14310,9 +10194,6 @@ pub mod users { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(maxpagesize) = &this.maxpagesize { - req.url_mut().query_pairs_mut().append_pair("maxpagesize", &maxpagesize.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -14335,7 +10216,7 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } @@ -14350,9 +10231,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14423,14 +10304,14 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -14450,9 +10331,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14494,7 +10375,7 @@ pub mod users { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) user_id: String, - pub(crate) body: models::User, + pub(crate) body: models::UserUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14525,14 +10406,14 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -14552,9 +10433,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14597,14 +10478,8 @@ pub mod users { pub(crate) client: super::super::Client, pub(crate) user_id: String, pub(crate) body: serde_json::Value, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "Only perform the operation if the entity's etag matches one of the etags provided or * is provided."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.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()`."] @@ -14623,9 +10498,6 @@ pub mod users { ); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -14636,14 +10508,14 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } 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`."] @@ -14731,7 +10603,7 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == 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-31-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.1-preview"); } Ok(url) } diff --git a/services/svc/iotcentral/src/package_1_1_preview/models.rs b/services/svc/iotcentral/src/package_1_1_preview/models.rs new file mode 100644 index 0000000000..2ac63d4e9c --- /dev/null +++ b/services/svc/iotcentral/src/package_1_1_preview/models.rs @@ -0,0 +1,1607 @@ +#![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 AdGroupUser { + #[serde(flatten)] + pub user: User, + #[doc = "The AAD tenant ID of the AD Group."] + #[serde(rename = "tenantId")] + pub tenant_id: String, + #[doc = "The AAD object ID of the AD Group."] + #[serde(rename = "objectId")] + pub object_id: String, +} +impl AdGroupUser { + pub fn new(user: User, tenant_id: String, object_id: String) -> Self { + Self { + user, + tenant_id, + object_id, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ApiToken { + #[serde(flatten)] + pub permission: Permission, + #[doc = "Unique ID of the API token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Value of the API token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option, + #[doc = "String-formatted date representing the time when the token expires."] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub expiry: Option, +} +impl ApiToken { + pub fn new(permission: Permission) -> Self { + Self { + permission, + id: None, + token: None, + expiry: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ApiTokenCollection { + #[doc = "The collection of API tokens."] + pub value: Vec, + #[doc = "URL to get the next page of API tokens."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ApiTokenCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ApiTokenCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Attestation { + #[doc = "Type of the attestation."] + #[serde(rename = "type")] + pub type_: String, +} +impl Attestation { + pub fn new(type_: String) -> Self { + Self { type_ } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AttestationUnion { + #[serde(rename = "symmetricKey")] + SymmetricKey(SymmetricKeyAttestation), + #[serde(rename = "tpm")] + Tpm(TpmAttestation), + #[serde(rename = "x509")] + X509(X509Attestation), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BlobStorageV1Destination { + #[serde(flatten)] + pub destination: Destination, + pub authorization: BlobStorageV1DestinationAuthUnion, +} +impl BlobStorageV1Destination { + pub fn new(destination: Destination, authorization: BlobStorageV1DestinationAuthUnion) -> Self { + Self { + destination, + authorization, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BlobStorageV1DestinationAuth { + #[doc = "The kind of authentication to use."] + #[serde(rename = "type")] + pub type_: String, +} +impl BlobStorageV1DestinationAuth { + pub fn new(type_: String) -> Self { + Self { type_ } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum BlobStorageV1DestinationAuthUnion { + #[serde(rename = "connectionString")] + ConnectionString(BlobStorageV1DestinationConnectionStringAuth), + #[serde(rename = "systemAssignedManagedIdentity")] + SystemAssignedManagedIdentity(BlobStorageV1DestinationSystemAssignedManagedIdentityAuth), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BlobStorageV1DestinationConnectionStringAuth { + #[serde(flatten)] + pub blob_storage_v1_destination_auth: BlobStorageV1DestinationAuth, + #[doc = "The connection string for accessing the blob storage account."] + #[serde(rename = "connectionString")] + pub connection_string: String, + #[doc = "Name of the container where data should be written in the storage account."] + #[serde(rename = "containerName")] + pub container_name: String, +} +impl BlobStorageV1DestinationConnectionStringAuth { + pub fn new(blob_storage_v1_destination_auth: BlobStorageV1DestinationAuth, connection_string: String, container_name: String) -> Self { + Self { + blob_storage_v1_destination_auth, + connection_string, + container_name, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BlobStorageV1DestinationSystemAssignedManagedIdentityAuth { + #[serde(flatten)] + pub blob_storage_v1_destination_auth: BlobStorageV1DestinationAuth, + #[doc = "The storage account's blob service endpoint URL."] + #[serde(rename = "endpointUri")] + pub endpoint_uri: String, + #[doc = "Name of the container where data should be written in the storage account."] + #[serde(rename = "containerName")] + pub container_name: String, +} +impl BlobStorageV1DestinationSystemAssignedManagedIdentityAuth { + pub fn new(blob_storage_v1_destination_auth: BlobStorageV1DestinationAuth, endpoint_uri: String, container_name: String) -> Self { + Self { + blob_storage_v1_destination_auth, + endpoint_uri, + container_name, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CloudPropertyJobData { + #[serde(flatten)] + pub job_data: JobData, +} +impl CloudPropertyJobData { + pub fn new(job_data: JobData) -> Self { + Self { job_data } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Collection { + #[doc = "The collection of entities."] + pub value: Vec, + #[doc = "URL to get the next page of entities."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl Collection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CommandJobData { + #[serde(flatten)] + pub job_data: JobData, +} +impl CommandJobData { + pub fn new(job_data: JobData) -> Self { + Self { job_data } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExplorerV1Destination { + #[serde(flatten)] + pub destination: Destination, + #[doc = "The resource URI of the Data Explorer instance."] + #[serde(rename = "clusterUrl")] + pub cluster_url: String, + #[doc = "Name Data Explorer database where data should be written."] + pub database: String, + #[doc = "The table within the Data Explorer database that will receive the data."] + pub table: String, + pub authorization: DataExplorerV1DestinationAuthUnion, +} +impl DataExplorerV1Destination { + pub fn new( + destination: Destination, + cluster_url: String, + database: String, + table: String, + authorization: DataExplorerV1DestinationAuthUnion, + ) -> Self { + Self { + destination, + cluster_url, + database, + table, + authorization, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExplorerV1DestinationAuth { + #[doc = "The kind of authentication to use."] + #[serde(rename = "type")] + pub type_: String, +} +impl DataExplorerV1DestinationAuth { + pub fn new(type_: String) -> Self { + Self { type_ } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DataExplorerV1DestinationAuthUnion { + #[serde(rename = "servicePrincipal")] + ServicePrincipal(DataExplorerV1DestinationServicePrincipalAuth), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExplorerV1DestinationServicePrincipalAuth { + #[serde(flatten)] + pub data_explorer_v1_destination_auth: DataExplorerV1DestinationAuth, + #[doc = "Service Principal client ID."] + #[serde(rename = "clientId")] + pub client_id: String, + #[doc = "Service Principal tenant ID."] + #[serde(rename = "tenantId")] + pub tenant_id: String, + #[doc = "Service Principal client secret."] + #[serde(rename = "clientSecret")] + pub client_secret: String, +} +impl DataExplorerV1DestinationServicePrincipalAuth { + pub fn new( + data_explorer_v1_destination_auth: DataExplorerV1DestinationAuth, + client_id: String, + tenant_id: String, + client_secret: String, + ) -> Self { + Self { + data_explorer_v1_destination_auth, + client_id, + tenant_id, + client_secret, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DataExportError { + #[doc = "The code for the error that occurred."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The description of the error that occurred."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl DataExportError { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DataExportStatus { + #[doc = "Indication of the current health and operation of the export or destination."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Errors encountered by the export or destination."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub errors: Vec, + #[doc = "The timestamp of the last message that was sent to the export or destination."] + #[serde(rename = "lastExportTime", default, with = "azure_core::date::rfc3339::option")] + pub last_export_time: Option, +} +impl DataExportStatus { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Destination { + #[serde(flatten)] + pub data_export_status: DataExportStatus, + #[doc = "Unique ID of the destination."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Display name of the destination."] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "The type of destination configuration."] + #[serde(rename = "type")] + pub type_: String, +} +impl Destination { + pub fn new(display_name: String, type_: String) -> Self { + Self { + data_export_status: DataExportStatus::default(), + id: None, + display_name, + type_, + } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DestinationUnion { + #[serde(rename = "blobstorage@v1")] + BlobstorageV1(BlobStorageV1Destination), + #[serde(rename = "dataexplorer@v1")] + DataexplorerV1(DataExplorerV1Destination), + #[serde(rename = "eventhubs@v1")] + EventhubsV1(EventHubsV1Destination), + #[serde(rename = "servicebusqueue@v1")] + ServicebusqueueV1(ServiceBusQueueV1Destination), + #[serde(rename = "servicebustopic@v1")] + ServicebustopicV1(ServiceBusTopicV1Destination), + #[serde(rename = "webhook@v1")] + WebhookV1(WebhookV1Destination), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DestinationCollection { + #[doc = "The collection of destinations."] + pub value: Vec, + #[doc = "URL to get the next page of destinations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DestinationCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl DestinationCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DestinationReference { + #[doc = "The ID of the destination where data should be sent."] + pub id: String, + #[doc = "Query for transforming the message structure to a particular output."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub transform: Option, +} +impl DestinationReference { + pub fn new(id: String) -> Self { + Self { id, transform: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Device { + #[doc = "Unique ID of the device."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "ETag used to prevent conflict in device updates."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, + #[doc = "Display name of the device."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The device template definition for the device."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub template: Option, + #[doc = "Whether the device connection to IoT Central has been enabled."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "Whether resources have been allocated for the device."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provisioned: Option, + #[doc = "Whether the device is simulated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub simulated: Option, + #[doc = "List of organization IDs that the device is a part of."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub organizations: Vec, +} +impl Device { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceCollection { + #[doc = "The collection of devices."] + pub value: Vec, + #[doc = "URL to get the next page of devices."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DeviceCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl DeviceCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceCommand { + #[doc = "The request ID of the device command execution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Connection timeout in seconds to wait for a disconnected device to come online. Defaults to 0 seconds."] + #[serde(rename = "connectionTimeout", default, skip_serializing_if = "Option::is_none")] + pub connection_timeout: Option, + #[doc = "Response timeout in seconds to wait for a command completion on a device. Defaults to 30 seconds."] + #[serde(rename = "responseTimeout", default, skip_serializing_if = "Option::is_none")] + pub response_timeout: Option, + #[doc = "The payload for the device command."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request: Option, + #[doc = "The payload of the device command response."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub response: Option, + #[doc = "The status code of the device command response."] + #[serde(rename = "responseCode", default, skip_serializing_if = "Option::is_none")] + pub response_code: Option, +} +impl DeviceCommand { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceCommandCollection { + #[doc = "The collection of device command executions."] + pub value: Vec, + #[doc = "URL to get the next page of device command executions."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DeviceCommandCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl DeviceCommandCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceCredentials { + #[doc = "ID scope for connecting to the IoT Central application."] + #[serde(rename = "idScope")] + pub id_scope: String, + #[serde(rename = "symmetricKey", default, skip_serializing_if = "Option::is_none")] + pub symmetric_key: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub x509: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tpm: Option, +} +impl DeviceCredentials { + pub fn new(id_scope: String) -> Self { + Self { + id_scope, + symmetric_key: None, + x509: None, + tpm: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceGroup { + #[doc = "Unique ID of the device group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Display name of the device group."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "List of organization IDs of the device group."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub organizations: Vec, +} +impl DeviceGroup { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceGroupCollection { + #[doc = "The collection of device groups."] + pub value: Vec, + #[doc = "URL to get the next page of device groups."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DeviceGroupCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl DeviceGroupCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Property values associated with the device."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceProperties {} +impl DeviceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An object representing the relationship between an upstream and a downstream device."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceRelationship { + #[doc = "The unique identifier of this relationship."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name which describes this relationship between given devices from source device template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The device ID of the source (parent) device."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "The device ID of the target (child) device."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, +} +impl DeviceRelationship { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceRelationshipCollection { + #[doc = "The collection of device relationships."] + pub value: Vec, + #[doc = "URL to get the next page of device relationships."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl DeviceRelationshipCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceTelemetry { + #[doc = "The last known value of this device telemetry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "String-formatted date representing the time when the telemetry value was sent."] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub timestamp: Option, +} +impl DeviceTelemetry { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceTemplate { + #[doc = "Unique ID of the device template."] + #[serde(rename = "@id", default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The JSON-LD types of this device template."] + #[serde(rename = "@type")] + pub type_: Vec, + #[doc = "ETag used to prevent conflict in device template updates."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, + #[doc = "Display name of the device template."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Detailed description of the device template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The capability model utilized by this device template."] + #[serde(rename = "capabilityModel")] + pub capability_model: serde_json::Value, + #[doc = "Deployment manifest associated to this device template."] + #[serde(rename = "deploymentManifest", default, skip_serializing_if = "Option::is_none")] + pub deployment_manifest: Option, +} +impl DeviceTemplate { + pub fn new(type_: Vec, capability_model: serde_json::Value) -> Self { + Self { + id: None, + type_, + etag: None, + display_name: None, + description: None, + capability_model, + deployment_manifest: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceTemplateCollection { + #[doc = "The collection of device templates."] + pub value: Vec, + #[doc = "URL to get the next page of device templates."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DeviceTemplateCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl DeviceTemplateCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EmailUser { + #[serde(flatten)] + pub user: User, + #[doc = "Email address of the user."] + pub email: String, +} +impl EmailUser { + pub fn new(user: User, email: String) -> Self { + Self { user, email } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Enrichment { + #[doc = "The device template or interface which defines the target capability for the enrichment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The path to the target capability within the device template or the system property to use."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, + #[doc = "The raw value used for the enrichment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl Enrichment { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventHubsV1Destination { + #[serde(flatten)] + pub destination: Destination, + pub authorization: EventHubsV1DestinationAuthUnion, +} +impl EventHubsV1Destination { + pub fn new(destination: Destination, authorization: EventHubsV1DestinationAuthUnion) -> Self { + Self { + destination, + authorization, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventHubsV1DestinationAuth { + #[doc = "The kind of authentication to use."] + #[serde(rename = "type")] + pub type_: String, +} +impl EventHubsV1DestinationAuth { + pub fn new(type_: String) -> Self { + Self { type_ } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventHubsV1DestinationAuthUnion { + #[serde(rename = "connectionString")] + ConnectionString(EventHubsV1DestinationConnectionStringAuth), + #[serde(rename = "systemAssignedManagedIdentity")] + SystemAssignedManagedIdentity(EventHubsV1DestinationSystemAssignedManagedIdentityAuth), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventHubsV1DestinationConnectionStringAuth { + #[serde(flatten)] + pub event_hubs_v1_destination_auth: EventHubsV1DestinationAuth, + #[doc = "The connection string for accessing the Event Hubs namespace, including the `EntityPath` of the event hub."] + #[serde(rename = "connectionString")] + pub connection_string: String, +} +impl EventHubsV1DestinationConnectionStringAuth { + pub fn new(event_hubs_v1_destination_auth: EventHubsV1DestinationAuth, connection_string: String) -> Self { + Self { + event_hubs_v1_destination_auth, + connection_string, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventHubsV1DestinationSystemAssignedManagedIdentityAuth { + #[serde(flatten)] + pub event_hubs_v1_destination_auth: EventHubsV1DestinationAuth, + #[doc = "The host name of the Event Hubs namespace."] + #[serde(rename = "hostName")] + pub host_name: String, + #[doc = "The Event Hubs instance name."] + #[serde(rename = "eventHubName")] + pub event_hub_name: String, +} +impl EventHubsV1DestinationSystemAssignedManagedIdentityAuth { + pub fn new(event_hubs_v1_destination_auth: EventHubsV1DestinationAuth, host_name: String, event_hub_name: String) -> Self { + Self { + event_hubs_v1_destination_auth, + host_name, + event_hub_name, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Export { + #[serde(flatten)] + pub data_export_status: DataExportStatus, + #[doc = "Unique ID of the export."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Display name of the export."] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "Toggle to start/stop an export from sending data."] + pub enabled: bool, + #[doc = "The type of data to export."] + pub source: export::Source, + #[doc = "Query defining which events from the source should be exported."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option, + #[doc = "Additional pieces of information to include with each sent message. Data is represented as a set of key/value pairs, where the key is the name of the enrichment that will appear in the output message and the value identifies the data to send."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enrichments: Option, + #[doc = "The list of destinations to which the export should send data."] + pub destinations: Vec, +} +impl Export { + pub fn new(display_name: String, enabled: bool, source: export::Source, destinations: Vec) -> Self { + Self { + data_export_status: DataExportStatus::default(), + id: None, + display_name, + enabled, + source, + filter: None, + enrichments: None, + destinations, + } + } +} +pub mod export { + use super::*; + #[doc = "The type of data to export."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Source { + #[serde(rename = "telemetry")] + Telemetry, + #[serde(rename = "properties")] + Properties, + #[serde(rename = "deviceLifecycle")] + DeviceLifecycle, + #[serde(rename = "deviceTemplateLifecycle")] + DeviceTemplateLifecycle, + #[serde(rename = "deviceConnectivity")] + DeviceConnectivity, + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExportCollection { + #[doc = "The collection of exports."] + pub value: Vec, + #[doc = "URL to get the next page of exports."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ExportCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ExportCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FileUpload { + #[doc = "The storage account name where to upload the file to"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account: Option, + #[doc = "The connection string used to configure the storage account"] + #[serde(rename = "connectionString")] + pub connection_string: String, + #[doc = "The name of the container inside the storage account"] + pub container: String, + #[doc = "ISO 8601 duration standard, The amount of time the device’s request to upload a file is valid before it expires."] + #[serde(rename = "sasTtl", default, skip_serializing_if = "Option::is_none")] + pub sas_ttl: Option, + #[doc = "The state of the file upload configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "ETag used to prevent conflict with multiple uploads"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, +} +impl FileUpload { + pub fn new(connection_string: String, container: String) -> Self { + Self { + account: None, + connection_string, + container, + sas_ttl: None, + state: None, + etag: None, + } + } +} +pub mod file_upload { + use super::*; + #[doc = "The state of the file upload configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "updating")] + Updating, + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Job { + #[doc = "Unique ID of the job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Display name of the job."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Detailed description of the job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The ID of the device group on which to execute the job."] + pub group: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub batch: Option, + #[serde(rename = "cancellationThreshold", default, skip_serializing_if = "Option::is_none")] + pub cancellation_threshold: Option, + #[doc = "The capabilities being updated by the job and the values with which they are being updated."] + pub data: Vec, + #[doc = "Indicates whether the job is starting, running, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "List of organizations of the job."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub organizations: Vec, +} +impl Job { + pub fn new(group: String, data: Vec) -> Self { + Self { + id: None, + display_name: None, + description: None, + group, + batch: None, + cancellation_threshold: None, + data, + status: None, + organizations: Vec::new(), + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JobBatch { + #[doc = "Whether batching is done on a specified number of devices or a percentage of the total devices."] + #[serde(rename = "type")] + pub type_: job_batch::Type, + #[doc = "The number or percentage of devices on which batching is done."] + pub value: f64, +} +impl JobBatch { + pub fn new(type_: job_batch::Type, value: f64) -> Self { + Self { type_, value } + } +} +pub mod job_batch { + use super::*; + #[doc = "Whether batching is done on a specified number of devices or a percentage of the total devices."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "number")] + Number, + #[serde(rename = "percentage")] + Percentage, + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JobCancellationThreshold { + #[doc = "Whether the cancellation threshold is per a specified number of devices or a percentage of the total devices."] + #[serde(rename = "type")] + pub type_: job_cancellation_threshold::Type, + #[doc = "The number or percentage of devices on which the cancellation threshold is applied."] + pub value: f64, + #[doc = "Whether the cancellation threshold applies per-batch or to the overall job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub batch: Option, +} +impl JobCancellationThreshold { + pub fn new(type_: job_cancellation_threshold::Type, value: f64) -> Self { + Self { type_, value, batch: None } + } +} +pub mod job_cancellation_threshold { + use super::*; + #[doc = "Whether the cancellation threshold is per a specified number of devices or a percentage of the total devices."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "number")] + Number, + #[serde(rename = "percentage")] + Percentage, + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JobCollection { + #[doc = "The collection of jobs."] + pub value: Vec, + #[doc = "URL to get the next page of jobs."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for JobCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl JobCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JobData { + #[doc = "Type of the job data."] + #[serde(rename = "type")] + pub type_: String, + #[doc = "The device template which defines the target capability for the job."] + pub target: String, + #[doc = "The path to the target capability within the device template."] + pub path: String, + #[doc = "The value used to update the target capability, if any."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl JobData { + pub fn new(type_: String, target: String, path: String) -> Self { + Self { + type_, + target, + path, + value: None, + } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum JobDataUnion { + #[serde(rename = "cloudProperty")] + CloudProperty(CloudPropertyJobData), + #[serde(rename = "command")] + Command(CommandJobData), + #[serde(rename = "property")] + Property(PropertyJobData), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct JobDeviceStatus { + #[doc = "ID of the device whose job status is being provided."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Indicates whether the job is starting, running, etc. for the given device."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl JobDeviceStatus { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JobDeviceStatusCollection { + #[doc = "The collection of job device statuses."] + pub value: Vec, + #[doc = "URL to get the next page of job device statuses."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl JobDeviceStatusCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Organization { + #[doc = "Unique ID of the organization."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Display name of the organization."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "ID of the parent of the organization."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option, +} +impl Organization { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OrganizationCollection { + #[doc = "The collection of organizations."] + pub value: Vec, + #[doc = "URL to get the next page of organizations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OrganizationCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl OrganizationCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Permission { + #[doc = "List of role assignments that specify the permissions to access the application."] + pub roles: Vec, +} +impl Permission { + pub fn new(roles: Vec) -> Self { + Self { roles } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PropertyJobData { + #[serde(flatten)] + pub job_data: JobData, +} +impl PropertyJobData { + pub fn new(job_data: JobData) -> Self { + Self { job_data } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryRequest { + #[doc = "Query to be executed."] + pub query: String, +} +impl QueryRequest { + pub fn new(query: String) -> Self { + Self { query } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryResponse { + pub results: Vec, +} +impl QueryResponse { + pub fn new(results: Vec) -> Self { + Self { results } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Role { + #[doc = "Unique ID of the role."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Display name of the role."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, +} +impl Role { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleAssignment { + #[doc = "ID of the role for this role assignment."] + pub role: String, + #[doc = "ID of the organization for this role assignment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub organization: Option, +} +impl RoleAssignment { + pub fn new(role: String) -> Self { + Self { role, organization: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleCollection { + #[doc = "The collection of roles."] + pub value: Vec, + #[doc = "URL to get the next page of roles."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RoleCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl RoleCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusQueueV1Destination { + #[serde(flatten)] + pub destination: Destination, + pub authorization: ServiceBusQueueV1DestinationAuthUnion, +} +impl ServiceBusQueueV1Destination { + pub fn new(destination: Destination, authorization: ServiceBusQueueV1DestinationAuthUnion) -> Self { + Self { + destination, + authorization, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusQueueV1DestinationAuth { + #[doc = "The kind of authentication to use."] + #[serde(rename = "type")] + pub type_: String, +} +impl ServiceBusQueueV1DestinationAuth { + pub fn new(type_: String) -> Self { + Self { type_ } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServiceBusQueueV1DestinationAuthUnion { + #[serde(rename = "connectionString")] + ConnectionString(ServiceBusQueueV1DestinationConnectionStringAuth), + #[serde(rename = "systemAssignedManagedIdentity")] + SystemAssignedManagedIdentity(ServiceBusQueueV1DestinationSystemAssignedManagedIdentityAuth), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusQueueV1DestinationConnectionStringAuth { + #[serde(flatten)] + pub service_bus_queue_v1_destination_auth: ServiceBusQueueV1DestinationAuth, + #[doc = "The connection string for accessing the Service Bus namespace, including the `EntityPath` of the queue."] + #[serde(rename = "connectionString")] + pub connection_string: String, +} +impl ServiceBusQueueV1DestinationConnectionStringAuth { + pub fn new(service_bus_queue_v1_destination_auth: ServiceBusQueueV1DestinationAuth, connection_string: String) -> Self { + Self { + service_bus_queue_v1_destination_auth, + connection_string, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusQueueV1DestinationSystemAssignedManagedIdentityAuth { + #[serde(flatten)] + pub service_bus_queue_v1_destination_auth: ServiceBusQueueV1DestinationAuth, + #[doc = "The host name of the Service Bus namespace."] + #[serde(rename = "hostName")] + pub host_name: String, + #[doc = "The Service Bus queue name."] + #[serde(rename = "queueName")] + pub queue_name: String, +} +impl ServiceBusQueueV1DestinationSystemAssignedManagedIdentityAuth { + pub fn new(service_bus_queue_v1_destination_auth: ServiceBusQueueV1DestinationAuth, host_name: String, queue_name: String) -> Self { + Self { + service_bus_queue_v1_destination_auth, + host_name, + queue_name, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusTopicV1Destination { + #[serde(flatten)] + pub destination: Destination, + pub authorization: ServiceBusTopicV1DestinationAuthUnion, +} +impl ServiceBusTopicV1Destination { + pub fn new(destination: Destination, authorization: ServiceBusTopicV1DestinationAuthUnion) -> Self { + Self { + destination, + authorization, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusTopicV1DestinationAuth { + #[doc = "The kind of authentication to use."] + #[serde(rename = "type")] + pub type_: String, +} +impl ServiceBusTopicV1DestinationAuth { + pub fn new(type_: String) -> Self { + Self { type_ } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServiceBusTopicV1DestinationAuthUnion { + #[serde(rename = "connectionString")] + ConnectionString(ServiceBusTopicV1DestinationConnectionStringAuth), + #[serde(rename = "systemAssignedManagedIdentity")] + SystemAssignedManagedIdentity(ServiceBusTopicV1DestinationSystemAssignedManagedIdentityAuth), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusTopicV1DestinationConnectionStringAuth { + #[serde(flatten)] + pub service_bus_topic_v1_destination_auth: ServiceBusTopicV1DestinationAuth, + #[doc = "The connection string for accessing the Service Bus namespace, including the `EntityPath` of the topic."] + #[serde(rename = "connectionString")] + pub connection_string: String, +} +impl ServiceBusTopicV1DestinationConnectionStringAuth { + pub fn new(service_bus_topic_v1_destination_auth: ServiceBusTopicV1DestinationAuth, connection_string: String) -> Self { + Self { + service_bus_topic_v1_destination_auth, + connection_string, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusTopicV1DestinationSystemAssignedManagedIdentityAuth { + #[serde(flatten)] + pub service_bus_topic_v1_destination_auth: ServiceBusTopicV1DestinationAuth, + #[doc = "The host name of the Service Bus namespace."] + #[serde(rename = "hostName")] + pub host_name: String, + #[doc = "The Service Bus topic name."] + #[serde(rename = "topicName")] + pub topic_name: String, +} +impl ServiceBusTopicV1DestinationSystemAssignedManagedIdentityAuth { + pub fn new(service_bus_topic_v1_destination_auth: ServiceBusTopicV1DestinationAuth, host_name: String, topic_name: String) -> Self { + Self { + service_bus_topic_v1_destination_auth, + host_name, + topic_name, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServicePrincipalUser { + #[serde(flatten)] + pub user: User, + #[doc = "The AAD tenant ID of the service principal."] + #[serde(rename = "tenantId")] + pub tenant_id: String, + #[doc = "The AAD object ID of the service principal."] + #[serde(rename = "objectId")] + pub object_id: String, +} +impl ServicePrincipalUser { + pub fn new(user: User, tenant_id: String, object_id: String) -> Self { + Self { + user, + tenant_id, + object_id, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SymmetricKey { + #[doc = "The primary key for this credential."] + #[serde(rename = "primaryKey")] + pub primary_key: String, + #[doc = "The secondary key for this credential."] + #[serde(rename = "secondaryKey")] + pub secondary_key: String, +} +impl SymmetricKey { + pub fn new(primary_key: String, secondary_key: String) -> Self { + Self { + primary_key, + secondary_key, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SymmetricKeyAttestation { + #[serde(flatten)] + pub attestation: Attestation, + #[serde(rename = "symmetricKey")] + pub symmetric_key: SymmetricKey, +} +impl SymmetricKeyAttestation { + pub fn new(attestation: Attestation, symmetric_key: SymmetricKey) -> Self { + Self { + attestation, + symmetric_key, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Tpm { + #[doc = "The TPM endorsement key for this credential."] + #[serde(rename = "endorsementKey")] + pub endorsement_key: String, +} +impl Tpm { + pub fn new(endorsement_key: String) -> Self { + Self { endorsement_key } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TpmAttestation { + #[serde(flatten)] + pub attestation: Attestation, + pub tpm: Tpm, +} +impl TpmAttestation { + pub fn new(attestation: Attestation, tpm: Tpm) -> Self { + Self { attestation, tpm } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct User { + #[serde(flatten)] + pub permission: Permission, + #[doc = "Unique ID of the user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Type of the user."] + #[serde(rename = "type")] + pub type_: String, +} +impl User { + pub fn new(permission: Permission, type_: String) -> Self { + Self { + permission, + id: None, + type_, + } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserUnion { + #[serde(rename = "adGroup")] + AdGroup(AdGroupUser), + #[serde(rename = "email")] + Email(EmailUser), + #[serde(rename = "servicePrincipal")] + ServicePrincipal(ServicePrincipalUser), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserCollection { + #[doc = "The collection of users."] + pub value: Vec, + #[doc = "URL to get the next page of users."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for UserCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl UserCollection { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookV1Destination { + #[serde(flatten)] + pub destination: Destination, + #[doc = "The URL to invoke when exporting data."] + pub url: String, + #[doc = "Additional query parameters that should be added to each request."] + #[serde(rename = "queryCustomizations", default, skip_serializing_if = "Option::is_none")] + pub query_customizations: Option, + #[doc = "Additional headers that should be added to each request."] + #[serde(rename = "headerCustomizations", default, skip_serializing_if = "Option::is_none")] + pub header_customizations: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorization: Option, +} +impl WebhookV1Destination { + pub fn new(destination: Destination, url: String) -> Self { + Self { + destination, + url, + query_customizations: None, + header_customizations: None, + authorization: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookV1DestinationAuth { + #[doc = "The kind of authentication to use."] + #[serde(rename = "type")] + pub type_: String, +} +impl WebhookV1DestinationAuth { + pub fn new(type_: String) -> Self { + Self { type_ } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum WebhookV1DestinationAuthUnion { + #[serde(rename = "header")] + Header(WebhookV1DestinationHeaderAuth), + #[serde(rename = "oauth")] + Oauth(WebhookV1DestinationOAuthAuth), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookV1DestinationCustomization { + #[doc = "The value to use for this webhook customization."] + pub value: String, + #[doc = "Whether to consider the value to be a secret and hide it when retrieving the destination configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secret: Option, +} +impl WebhookV1DestinationCustomization { + pub fn new(value: String) -> Self { + Self { value, secret: None } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookV1DestinationHeaderAuth { + #[serde(flatten)] + pub webhook_v1_destination_auth: WebhookV1DestinationAuth, + #[doc = "Value to use for the Authorization header when making requests."] + pub value: String, +} +impl WebhookV1DestinationHeaderAuth { + pub fn new(webhook_v1_destination_auth: WebhookV1DestinationAuth, value: String) -> Self { + Self { + webhook_v1_destination_auth, + value, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookV1DestinationOAuthAuth { + #[serde(flatten)] + pub webhook_v1_destination_auth: WebhookV1DestinationAuth, + #[doc = "URL where an access token can be retrieved."] + #[serde(rename = "tokenUrl")] + pub token_url: String, + #[doc = "OAuth2 client ID used when retrieving the token."] + #[serde(rename = "clientId")] + pub client_id: String, + #[doc = "OAuth2 client secret used to retrieve the token."] + #[serde(rename = "clientSecret")] + pub client_secret: String, + #[doc = "OAuth2 audience."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub audience: Option, + #[doc = "OAuth2 scope."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option, + #[doc = "Content-Type for the token request."] + #[serde(rename = "requestType", default, skip_serializing_if = "Option::is_none")] + pub request_type: Option, +} +impl WebhookV1DestinationOAuthAuth { + pub fn new(webhook_v1_destination_auth: WebhookV1DestinationAuth, token_url: String, client_id: String, client_secret: String) -> Self { + Self { + webhook_v1_destination_auth, + token_url, + client_id, + client_secret, + audience: None, + scope: None, + request_type: None, + } + } +} +pub mod webhook_v1_destination_o_auth_auth { + use super::*; + #[doc = "Content-Type for the token request."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum RequestType { + #[serde(rename = "auto")] + Auto, + #[serde(rename = "json")] + Json, + #[serde(rename = "urlencoded")] + Urlencoded, + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct X509 { + #[serde(rename = "clientCertificates", default, skip_serializing_if = "Option::is_none")] + pub client_certificates: Option, +} +impl X509 { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct X509Attestation { + #[serde(flatten)] + pub attestation: Attestation, + pub x509: X509, +} +impl X509Attestation { + pub fn new(attestation: Attestation, x509: X509) -> Self { + Self { attestation, x509 } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct X509Certificate { + #[doc = "The string representation of this certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub certificate: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl X509Certificate { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct X509CertificateInfo { + #[doc = "The SHA-1 hash value of the certificate."] + #[serde(rename = "sha1Thumbprint")] + pub sha1_thumbprint: String, +} +impl X509CertificateInfo { + pub fn new(sha1_thumbprint: String) -> Self { + Self { sha1_thumbprint } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct X509Certificates { + pub primary: X509Certificate, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secondary: Option, +} +impl X509Certificates { + pub fn new(primary: X509Certificate) -> Self { + Self { primary, secondary: None } + } +} diff --git a/services/svc/iotcentral/src/package_2022_06_30_preview/mod.rs b/services/svc/iotcentral/src/package_1_2_preview/mod.rs similarity index 79% rename from services/svc/iotcentral/src/package_2022_06_30_preview/mod.rs rename to services/svc/iotcentral/src/package_1_2_preview/mod.rs index 03ec7cc656..1f3cae4abb 100644 --- a/services/svc/iotcentral/src/package_2022_06_30_preview/mod.rs +++ b/services/svc/iotcentral/src/package_1_2_preview/mod.rs @@ -106,9 +106,6 @@ impl Client { pub fn api_tokens_client(&self) -> api_tokens::Client { api_tokens::Client(self.clone()) } - pub fn dashboards_client(&self) -> dashboards::Client { - dashboards::Client(self.clone()) - } pub fn destinations_client(&self) -> destinations::Client { destinations::Client(self.clone()) } @@ -121,9 +118,6 @@ impl Client { pub fn devices_client(&self) -> devices::Client { devices::Client(self.clone()) } - pub fn enrollment_groups_client(&self) -> enrollment_groups::Client { - enrollment_groups::Client(self.clone()) - } pub fn exports_client(&self) -> exports::Client { exports::Client(self.clone()) } @@ -142,9 +136,6 @@ impl Client { pub fn roles_client(&self) -> roles::Client { roles::Client(self.clone()) } - pub fn scheduled_jobs_client(&self) -> scheduled_jobs::Client { - scheduled_jobs::Client(self.clone()) - } pub fn users_client(&self) -> users::Client { users::Client(self.clone()) } @@ -269,7 +260,7 @@ pub mod api_tokens { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -305,7 +296,7 @@ pub mod api_tokens { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -393,7 +384,7 @@ pub mod api_tokens { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -495,7 +486,7 @@ pub mod api_tokens { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -590,14 +581,14 @@ pub mod api_tokens { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } } } -pub mod dashboards { +pub mod destinations { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -605,52 +596,64 @@ pub mod dashboards { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of dashboards in an application."] + #[doc = "Get the list of destinations in an application."] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } - #[doc = "Get a dashboard by ID."] + #[doc = "Get a destination by ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `dashboard_id`: Unique ID for the dashboard."] - pub fn get(&self, dashboard_id: impl Into) -> get::RequestBuilder { + #[doc = "* `destination_id`: Unique ID for the destination."] + pub fn get(&self, destination_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - dashboard_id: dashboard_id.into(), + destination_id: destination_id.into(), } } - #[doc = "Create a dashboard"] + #[doc = "Create or update a destination"] + #[doc = "Create or update a definition for where to send data."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `dashboard_id`: Unique ID for the dashboard."] - #[doc = "* `body`: Dashboard definition."] - pub fn create(&self, dashboard_id: impl Into, body: impl Into) -> create::RequestBuilder { + #[doc = "* `destination_id`: Unique ID for the destination."] + #[doc = "* `body`: Destination body."] + pub fn create(&self, destination_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - dashboard_id: dashboard_id.into(), + destination_id: destination_id.into(), body: body.into(), } } - #[doc = "Update a dashboard"] + #[doc = "Patch a destination."] + #[doc = "Perform an incremental update to a destination."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `dashboard_id`: Unique ID for the dashboard."] - #[doc = "* `body`: Dashboard definition."] - pub fn update(&self, dashboard_id: impl Into, body: impl Into) -> update::RequestBuilder { + #[doc = "* `destination_id`: Unique ID for the destination."] + #[doc = "* `body`: Destination patch body."] + pub fn update(&self, destination_id: impl Into, body: impl Into) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - dashboard_id: dashboard_id.into(), + destination_id: destination_id.into(), body: body.into(), } } - #[doc = "Delete a dashboard"] + #[doc = "Delete a destination."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `dashboard_id`: Unique ID for the dashboard."] - pub fn remove(&self, dashboard_id: impl Into) -> remove::RequestBuilder { + #[doc = "* `destination_id`: Unique ID for the destination."] + pub fn remove(&self, destination_id: impl Into) -> remove::RequestBuilder { remove::RequestBuilder { client: self.0.clone(), - dashboard_id: dashboard_id.into(), + destination_id: destination_id.into(), + } + } + #[doc = "List all exports connected to the given destination."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `destination_id`: Unique ID for the destination."] + pub fn list_exports(&self, destination_id: impl Into) -> list_exports::RequestBuilder { + list_exports::RequestBuilder { + client: self.0.clone(), + destination_id: destination_id.into(), } } } @@ -663,9 +666,9 @@ pub mod dashboards { #[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::DashboardCollection = serde_json::from_slice(&bytes)?; + let body: models::DestinationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -708,7 +711,7 @@ pub mod dashboards { pub(crate) client: super::super::Client, } impl RequestBuilder { - 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 { @@ -729,7 +732,7 @@ pub mod dashboards { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -761,11 +764,11 @@ pub mod dashboards { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/destinations", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -780,9 +783,9 @@ pub mod dashboards { #[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::Dashboard = serde_json::from_slice(&bytes)?; + let body: models::DestinationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -823,7 +826,7 @@ pub mod dashboards { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) dashboard_id: String, + pub(crate) destination_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."] @@ -849,18 +852,22 @@ pub mod dashboards { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards/{}", self.client.endpoint(), &self.dashboard_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/dataExport/destinations/{}", + self.client.endpoint(), + &self.destination_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -880,9 +887,9 @@ pub mod dashboards { #[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::Dashboard = serde_json::from_slice(&bytes)?; + let body: models::DestinationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -923,8 +930,8 @@ pub mod dashboards { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) dashboard_id: String, - pub(crate) body: models::Dashboard, + pub(crate) destination_id: String, + pub(crate) body: models::DestinationUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -951,18 +958,22 @@ pub mod dashboards { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards/{}", self.client.endpoint(), &self.dashboard_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/dataExport/destinations/{}", + self.client.endpoint(), + &self.destination_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -982,9 +993,9 @@ pub mod dashboards { #[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::Dashboard = serde_json::from_slice(&bytes)?; + let body: models::DestinationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1025,7 +1036,7 @@ pub mod dashboards { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) dashboard_id: String, + pub(crate) destination_id: String, pub(crate) body: serde_json::Value, } impl RequestBuilder { @@ -1053,18 +1064,22 @@ pub mod dashboards { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards/{}", self.client.endpoint(), &self.dashboard_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/dataExport/destinations/{}", + self.client.endpoint(), + &self.destination_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -1122,7 +1137,7 @@ pub mod dashboards { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) dashboard_id: String, + pub(crate) destination_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."] @@ -1148,18 +1163,144 @@ pub mod dashboards { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dashboards/{}", self.client.endpoint(), &self.dashboard_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/dataExport/destinations/{}", + self.client.endpoint(), + &self.destination_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, "1.2-preview"); + } + Ok(url) + } + } + } + pub mod list_exports { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExportCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) destination_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, "1.2-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!( + "{}/dataExport/destinations/{}/exports", + self.client.endpoint(), + &self.destination_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } } } -pub mod destinations { +pub mod exports { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -1167,64 +1308,64 @@ pub mod destinations { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of destinations in an application."] + #[doc = "Get the list of exports in an application."] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } - #[doc = "Get a destination by ID."] + #[doc = "Get an export by ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - pub fn get(&self, destination_id: impl Into) -> get::RequestBuilder { + #[doc = "* `export_id`: Unique ID for the export."] + pub fn get(&self, export_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - destination_id: destination_id.into(), + export_id: export_id.into(), } } - #[doc = "Create or update a destination"] - #[doc = "Create or update a definition for where to send data."] + #[doc = "Create or update an export"] + #[doc = "Create or update a definition for exporting data. Also used to connect or disconnect an export from destinations."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - #[doc = "* `body`: Destination body."] - pub fn create(&self, destination_id: impl Into, body: impl Into) -> create::RequestBuilder { + #[doc = "* `export_id`: Unique ID for the export."] + #[doc = "* `body`: Export body."] + pub fn create(&self, export_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - destination_id: destination_id.into(), + export_id: export_id.into(), body: body.into(), } } - #[doc = "Patch a destination."] - #[doc = "Perform an incremental update to a destination."] + #[doc = "Patch an export."] + #[doc = "Perform an incremental update to an export."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - #[doc = "* `body`: Destination patch body."] - pub fn update(&self, destination_id: impl Into, body: impl Into) -> update::RequestBuilder { + #[doc = "* `export_id`: Unique ID for the export."] + #[doc = "* `body`: Export patch body."] + pub fn update(&self, export_id: impl Into, body: impl Into) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - destination_id: destination_id.into(), + export_id: export_id.into(), body: body.into(), } } - #[doc = "Delete a destination."] + #[doc = "Delete an export."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - pub fn remove(&self, destination_id: impl Into) -> remove::RequestBuilder { + #[doc = "* `export_id`: Unique ID for the export."] + pub fn remove(&self, export_id: impl Into) -> remove::RequestBuilder { remove::RequestBuilder { client: self.0.clone(), - destination_id: destination_id.into(), + export_id: export_id.into(), } } - #[doc = "List all exports connected to the given destination."] + #[doc = "List all destinations connected to the given export."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `destination_id`: Unique ID for the destination."] - pub fn list_exports(&self, destination_id: impl Into) -> list_exports::RequestBuilder { - list_exports::RequestBuilder { + #[doc = "* `export_id`: Unique ID for the export."] + pub fn list_destinations(&self, export_id: impl Into) -> list_destinations::RequestBuilder { + list_destinations::RequestBuilder { client: self.0.clone(), - destination_id: destination_id.into(), + export_id: export_id.into(), } } } @@ -1237,9 +1378,9 @@ pub mod destinations { #[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::DestinationCollection = serde_json::from_slice(&bytes)?; + let body: models::ExportCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1282,7 +1423,7 @@ pub mod destinations { pub(crate) client: super::super::Client, } impl RequestBuilder { - 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 { @@ -1303,7 +1444,7 @@ pub mod destinations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1335,11 +1476,11 @@ pub mod destinations { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dataExport/destinations", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -1354,9 +1495,9 @@ pub mod destinations { #[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::Destination = serde_json::from_slice(&bytes)?; + let body: models::Export = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1397,7 +1538,7 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_id: String, + pub(crate) export_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."] @@ -1423,22 +1564,18 @@ pub mod destinations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}", - self.client.endpoint(), - &self.destination_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -1458,9 +1595,9 @@ pub mod destinations { #[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::Destination = serde_json::from_slice(&bytes)?; + let body: models::Export = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1501,8 +1638,8 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_id: String, - pub(crate) body: models::Destination, + pub(crate) export_id: String, + pub(crate) body: models::Export, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1529,22 +1666,18 @@ pub mod destinations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}", - self.client.endpoint(), - &self.destination_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -1564,9 +1697,9 @@ pub mod destinations { #[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::Destination = serde_json::from_slice(&bytes)?; + let body: models::Export = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1607,7 +1740,7 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_id: String, + pub(crate) export_id: String, pub(crate) body: serde_json::Value, } impl RequestBuilder { @@ -1635,22 +1768,18 @@ pub mod destinations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}", - self.client.endpoint(), - &self.destination_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -1708,7 +1837,7 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_id: String, + pub(crate) export_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."] @@ -1734,21 +1863,17 @@ pub mod destinations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}", - self.client.endpoint(), - &self.destination_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } } - pub mod list_exports { + pub mod list_destinations { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -1757,9 +1882,9 @@ pub mod destinations { #[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::ExportCollection = serde_json::from_slice(&bytes)?; + let body: models::DestinationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1800,10 +1925,10 @@ pub mod destinations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) destination_id: String, + pub(crate) export_id: String, } impl RequestBuilder { - 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 { @@ -1824,7 +1949,7 @@ pub mod destinations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1857,21 +1982,21 @@ pub mod destinations { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/dataExport/destinations/{}/exports", + "{}/dataExport/exports/{}/destinations", self.client.endpoint(), - &self.destination_id + &self.export_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } } } -pub mod exports { +pub mod device_groups { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -1879,64 +2004,59 @@ pub mod exports { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of exports in an application."] + #[doc = "Get the list of device groups in an application."] pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } + list::RequestBuilder { + client: self.0.clone(), + filter: None, + top: None, + orderby: None, + } } - #[doc = "Get an export by ID."] + #[doc = "Get the device group by ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - pub fn get(&self, export_id: impl Into) -> get::RequestBuilder { + #[doc = "* `device_group_id`: Unique ID for the device group."] + pub fn get(&self, device_group_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - export_id: export_id.into(), + device_group_id: device_group_id.into(), } } - #[doc = "Create or update an export"] - #[doc = "Create or update a definition for exporting data. Also used to connect or disconnect an export from destinations."] + #[doc = "Create or update a device group"] + #[doc = "Create or update a device group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - #[doc = "* `body`: Export body."] - pub fn create(&self, export_id: impl Into, body: impl Into) -> create::RequestBuilder { + #[doc = "* `device_group_id`: Unique ID for the device group."] + #[doc = "* `body`: Device group body."] + pub fn create(&self, device_group_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - export_id: export_id.into(), + device_group_id: device_group_id.into(), body: body.into(), } } - #[doc = "Patch an export."] - #[doc = "Perform an incremental update to an export."] + #[doc = "Update a device group via patch"] + #[doc = "Update an existing device group by ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - #[doc = "* `body`: Export patch body."] - pub fn update(&self, export_id: impl Into, body: impl Into) -> update::RequestBuilder { + #[doc = "* `device_group_id`: Unique ID for the device group."] + #[doc = "* `body`: Device group patch body."] + pub fn update(&self, device_group_id: impl Into, body: impl Into) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - export_id: export_id.into(), + device_group_id: device_group_id.into(), body: body.into(), } } - #[doc = "Delete an export."] + #[doc = "Delete a device group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - pub fn remove(&self, export_id: impl Into) -> remove::RequestBuilder { + #[doc = "* `device_group_id`: Unique ID for the device group."] + pub fn remove(&self, device_group_id: impl Into) -> remove::RequestBuilder { remove::RequestBuilder { client: self.0.clone(), - export_id: export_id.into(), - } - } - #[doc = "List all destinations connected to the given export."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `export_id`: Unique ID for the export."] - pub fn list_destinations(&self, export_id: impl Into) -> list_destinations::RequestBuilder { - list_destinations::RequestBuilder { - client: self.0.clone(), - export_id: export_id.into(), + device_group_id: device_group_id.into(), } } } @@ -1949,9 +2069,9 @@ pub mod exports { #[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::ExportCollection = serde_json::from_slice(&bytes)?; + let body: models::DeviceGroupCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1992,9 +2112,27 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) orderby: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "An expression on the resource type that selects the resources to be returned."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The maximum number of resources to return from the collection."] + pub fn top(mut self, top: i64) -> Self { + self.top = Some(top); + self + } + #[doc = "An expression that specify the order of the returned resources."] + 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 { @@ -2015,7 +2153,7 @@ pub mod exports { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2029,6 +2167,15 @@ pub mod exports { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.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? @@ -2047,11 +2194,11 @@ pub mod exports { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceGroups", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -2066,9 +2213,9 @@ pub mod exports { #[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::Export = serde_json::from_slice(&bytes)?; + let body: models::DeviceGroup = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2109,7 +2256,7 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) export_id: String, + pub(crate) device_group_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."] @@ -2135,18 +2282,18 @@ pub mod exports { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -2166,9 +2313,9 @@ pub mod exports { #[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::Export = serde_json::from_slice(&bytes)?; + let body: models::DeviceGroup = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2209,8 +2356,8 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) export_id: String, - pub(crate) body: models::Export, + pub(crate) device_group_id: String, + pub(crate) body: models::DeviceGroup, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2237,18 +2384,18 @@ pub mod exports { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -2268,9 +2415,9 @@ pub mod exports { #[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::Export = serde_json::from_slice(&bytes)?; + let body: models::DeviceGroup = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2311,7 +2458,7 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) export_id: String, + pub(crate) device_group_id: String, pub(crate) body: serde_json::Value, } impl RequestBuilder { @@ -2331,7 +2478,7 @@ pub mod exports { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - req.insert_header("content-type", "application/json"); + req.insert_header("content-type", "application/merge-patch+json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2339,18 +2486,18 @@ pub mod exports { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -2408,7 +2555,7 @@ pub mod exports { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) export_id: String, + pub(crate) device_group_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."] @@ -2434,17 +2581,81 @@ pub mod exports { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/dataExport/exports/{}", self.client.endpoint(), &self.export_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } } - pub mod list_destinations { +} +pub mod device_templates { + 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 = "Get the list of device templates in an application with basic ODATA support (top, filter, orderby), [more details](https://aka.ms/iotcentralodatasupport)."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + filter: None, + top: None, + orderby: None, + } + } + #[doc = "Get a device template by ID"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] + pub fn get(&self, device_template_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + device_template_id: device_template_id.into(), + } + } + #[doc = "Publish a new device template. Default views will be automatically generated for new device templates created this way."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] + #[doc = "* `body`: Device template body."] + pub fn create(&self, device_template_id: impl Into, body: impl Into) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + device_template_id: device_template_id.into(), + body: body.into(), + } + } + #[doc = "Update the cloud properties and overrides of an existing device template via patch."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] + #[doc = "* `body`: Device template patch body."] + pub fn update(&self, device_template_id: impl Into, body: impl Into) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + device_template_id: device_template_id.into(), + body: body.into(), + } + } + #[doc = "Delete a device template"] + #[doc = "Delete an existing device template by device ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] + pub fn remove(&self, device_template_id: impl Into) -> remove::RequestBuilder { + remove::RequestBuilder { + client: self.0.clone(), + device_template_id: device_template_id.into(), + } + } + } + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -2453,208 +2664,9 @@ pub mod exports { #[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::DestinationCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) export_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, "2022-06-30-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!( - "{}/dataExport/exports/{}/destinations", - self.client.endpoint(), - &self.export_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-06-30-preview"); - } - Ok(url) - } - } - } -} -pub mod device_groups { - 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 = "Get the list of device groups in an application."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - filter: None, - top: None, - orderby: None, - } - } - #[doc = "Get the device group by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - pub fn get(&self, device_group_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - } - } - #[doc = "Create or update a device group"] - #[doc = "Create or update a device group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - #[doc = "* `body`: Device group body."] - pub fn create(&self, device_group_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - body: body.into(), - } - } - #[doc = "Update a device group via patch"] - #[doc = "Update an existing device group by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - #[doc = "* `body`: Device group patch body."] - pub fn update(&self, device_group_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - body: body.into(), - } - } - #[doc = "Delete a device group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - pub fn remove(&self, device_group_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - } - } - #[doc = "Get the devices of a device group"] - #[doc = "Get the list of devices by device group ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_group_id`: Unique ID for the device group."] - pub fn get_devices(&self, device_group_id: impl Into) -> get_devices::RequestBuilder { - get_devices::RequestBuilder { - client: self.0.clone(), - device_group_id: device_group_id.into(), - top: 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::DeviceGroupCollection = serde_json::from_slice(&bytes)?; + let body: models::DeviceTemplateCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2715,7 +2727,7 @@ pub mod device_groups { self.orderby = Some(orderby.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 { @@ -2736,7 +2748,7 @@ pub mod device_groups { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2777,11 +2789,11 @@ pub mod device_groups { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/deviceGroups", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -2796,9 +2808,9 @@ pub mod device_groups { #[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::DeviceGroup = serde_json::from_slice(&bytes)?; + let body: models::DeviceTemplate = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2839,7 +2851,7 @@ pub mod device_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) device_group_id: String, + pub(crate) device_template_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."] @@ -2865,18 +2877,18 @@ pub mod device_groups { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -2896,9 +2908,9 @@ pub mod device_groups { #[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::DeviceGroup = serde_json::from_slice(&bytes)?; + let body: models::DeviceTemplate = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2939,8 +2951,8 @@ pub mod device_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) device_group_id: String, - pub(crate) body: models::DeviceGroup, + pub(crate) device_template_id: String, + pub(crate) body: models::DeviceTemplate, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2967,18 +2979,18 @@ pub mod device_groups { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -2998,9 +3010,9 @@ pub mod device_groups { #[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::DeviceGroup = serde_json::from_slice(&bytes)?; + let body: models::DeviceTemplate = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3041,7 +3053,7 @@ pub mod device_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) device_group_id: String, + pub(crate) device_template_id: String, pub(crate) body: serde_json::Value, } impl RequestBuilder { @@ -3069,18 +3081,18 @@ pub mod device_groups { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -3138,7 +3150,7 @@ pub mod device_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) device_group_id: String, + pub(crate) device_template_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."] @@ -3164,149 +3176,18 @@ pub mod device_groups { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/deviceGroups/{}", self.client.endpoint(), &self.device_group_id))?; + let mut url = azure_core::Url::parse(&format!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-06-30-preview"); - } - Ok(url) - } - } - } - pub mod get_devices { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceGroupDeviceCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_group_id: String, - pub(crate) top: Option, - } - impl RequestBuilder { - #[doc = "The maximum number of resources to return from the collection."] - pub fn top(mut self, top: i64) -> 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, "2022-06-30-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(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!( - "{}/deviceGroups/{}/devices", - self.client.endpoint(), - &self.device_group_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } } } -pub mod device_templates { +pub mod devices { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -3314,7 +3195,7 @@ pub mod device_templates { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of device templates in an application with basic ODATA support ($top, $filter, $orderby), [more details](https://aka.ms/iotcentralodatasupport)."] + #[doc = "Get the list of devices in an application with basic ODATA support (top, filter, orderby), [more details](https://aka.ms/iotcentralodatasupport)."] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), @@ -3323,3025 +3204,706 @@ pub mod device_templates { orderby: None, } } - #[doc = "Get a device template by ID"] + #[doc = "Get a device by ID"] + #[doc = "Get details about an existing device by device ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] - pub fn get(&self, device_template_id: impl Into) -> get::RequestBuilder { + #[doc = "* `device_id`: Unique ID of the device."] + pub fn get(&self, device_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - device_template_id: device_template_id.into(), + device_id: device_id.into(), } } - #[doc = "Publish a new device template. Default views will be automatically generated for new device templates created this way."] + #[doc = "Create or update a device"] + #[doc = "Create a new device."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] - #[doc = "* `body`: Device template body."] - pub fn create(&self, device_template_id: impl Into, body: impl Into) -> create::RequestBuilder { + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Device body."] + pub fn create(&self, device_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - device_template_id: device_template_id.into(), + device_id: device_id.into(), body: body.into(), } } - #[doc = "Update the cloud properties and overrides of an existing device template via patch."] + #[doc = "Update a device via patch"] + #[doc = "Update an existing device by ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] - #[doc = "* `body`: Device template patch body."] - pub fn update(&self, device_template_id: impl Into, body: impl Into) -> update::RequestBuilder { + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Device patch body."] + pub fn update(&self, device_id: impl Into, body: impl Into) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - device_template_id: device_template_id.into(), + device_id: device_id.into(), body: body.into(), } } - #[doc = "Delete a device template"] - #[doc = "Delete an existing device template by device ID."] + #[doc = "Delete a device"] + #[doc = "Delete an existing device by device ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `device_template_id`: Unique [Digital Twin Model Identifier](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier) of the device template."] - pub fn remove(&self, device_template_id: impl Into) -> remove::RequestBuilder { + #[doc = "* `device_id`: Unique ID of the device."] + pub fn remove(&self, device_id: impl Into) -> remove::RequestBuilder { remove::RequestBuilder { client: self.0.clone(), - device_template_id: device_template_id.into(), + device_id: device_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::DeviceTemplateCollection = serde_json::from_slice(&bytes)?; - Ok(body) + #[doc = "Get device attestation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn get_attestation(&self, device_id: impl Into) -> get_attestation::RequestBuilder { + get_attestation::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + } + #[doc = "Create an individual device attestation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Individual device attestation body."] + pub fn create_attestation( + &self, + device_id: impl Into, + body: impl Into, + ) -> create_attestation::RequestBuilder { + create_attestation::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + body: body.into(), } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + } + #[doc = "Update an individual device attestation via patch"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Individual device attestation patch body."] + pub fn update_attestation( + &self, + device_id: impl Into, + body: impl Into, + ) -> update_attestation::RequestBuilder { + update_attestation::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + body: body.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Remove an individual device attestation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn remove_attestation(&self, device_id: impl Into) -> remove_attestation::RequestBuilder { + remove_attestation::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Get device command history"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `command_name`: Name of this device command."] + pub fn get_command_history( + &self, + device_id: impl Into, + command_name: impl Into, + ) -> get_command_history::RequestBuilder { + get_command_history::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + command_name: command_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) filter: Option, - pub(crate) top: Option, - pub(crate) orderby: Option, - } - impl RequestBuilder { - #[doc = "An expression on the resource type that selects the resources to be returned."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "The maximum number of resources to return from the collection."] - pub fn top(mut self, top: i64) -> Self { - self.top = Some(top); - self - } - #[doc = "An expression that specify the order of the returned resources."] - 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, "2022-06-30-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(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.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!("{}/deviceTemplates", 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, "2022-06-30-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::DeviceTemplate = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_template_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!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::DeviceTemplate = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_template_id: String, - pub(crate) body: models::DeviceTemplate, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::DeviceTemplate = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_template_id: String, - pub(crate) body: serde_json::Value, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) device_template_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!("{}/deviceTemplates/{}", self.client.endpoint(), &self.device_template_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-06-30-preview"); - } - Ok(url) - } - } - } -} -pub mod devices { - 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 = "Get the list of devices in an application with basic ODATA support ($top, $filter, $orderby), [more details](https://aka.ms/iotcentralodatasupport)."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - filter: None, - top: None, - orderby: None, - } - } - #[doc = "Get a device by ID"] - #[doc = "Get details about an existing device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn get(&self, device_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Create or update a device"] - #[doc = "Create a new device."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Device body."] - pub fn create(&self, device_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - } - } - #[doc = "Update a device via patch"] - #[doc = "Update an existing device by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Device patch body."] - pub fn update(&self, device_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - } - } - #[doc = "Delete a device"] - #[doc = "Delete an existing device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn remove(&self, device_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Get device attestation"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn get_attestation(&self, device_id: impl Into) -> get_attestation::RequestBuilder { - get_attestation::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Create an individual device attestation"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Individual device attestation body."] - pub fn create_attestation( - &self, - device_id: impl Into, - body: impl Into, - ) -> create_attestation::RequestBuilder { - create_attestation::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - } - } - #[doc = "Update an individual device attestation via patch"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Individual device attestation patch body."] - pub fn update_attestation( - &self, - device_id: impl Into, - body: impl Into, - ) -> update_attestation::RequestBuilder { - update_attestation::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - } - } - #[doc = "Remove an individual device attestation"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn remove_attestation(&self, device_id: impl Into) -> remove_attestation::RequestBuilder { - remove_attestation::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Get device command history"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `command_name`: Name of this device command."] - pub fn get_command_history( - &self, - device_id: impl Into, - command_name: impl Into, - ) -> get_command_history::RequestBuilder { - get_command_history::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - command_name: command_name.into(), - } - } - #[doc = "Run a device command"] - #[doc = "Run a command on a device."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `command_name`: Name of this device command."] - #[doc = "* `body`: Device command body."] - pub fn run_command( - &self, - device_id: impl Into, - command_name: impl Into, - body: impl Into, - ) -> run_command::RequestBuilder { - run_command::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - command_name: command_name.into(), - body: body.into(), - } - } - #[doc = "List the components present in a device"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn list_components(&self, device_id: impl Into) -> list_components::RequestBuilder { - list_components::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Get component command history"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `command_name`: Name of this device command."] - pub fn get_component_command_history( - &self, - device_id: impl Into, - component_name: impl Into, - command_name: impl Into, - ) -> get_component_command_history::RequestBuilder { - get_component_command_history::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - command_name: command_name.into(), - } - } - #[doc = "Run a component command"] - #[doc = "Run a command on a component."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `command_name`: Name of this device command."] - #[doc = "* `body`: Device command body."] - pub fn run_component_command( - &self, - device_id: impl Into, - component_name: impl Into, - command_name: impl Into, - body: impl Into, - ) -> run_component_command::RequestBuilder { - run_component_command::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - command_name: command_name.into(), - body: body.into(), - } - } - #[doc = "Get device properties for a specific component"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - pub fn get_component_properties( - &self, - device_id: impl Into, - component_name: impl Into, - ) -> get_component_properties::RequestBuilder { - get_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - unmodeled: None, - } - } - #[doc = "Replace device properties for a specific component"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `body`: Device properties."] - pub fn replace_component_properties( - &self, - device_id: impl Into, - component_name: impl Into, - body: impl Into, - ) -> replace_component_properties::RequestBuilder { - replace_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - body: body.into(), - unmodeled: None, - } - } - #[doc = "Update device properties for a specific component via patch"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `body`: Device properties patch."] - pub fn update_component_properties( - &self, - device_id: impl Into, - component_name: impl Into, - body: impl Into, - ) -> update_component_properties::RequestBuilder { - update_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - body: body.into(), - unmodeled: None, - } - } - #[doc = "Get component telemetry value"] - #[doc = "Get the last telemetry value from a component."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `telemetry_name`: Name of this device telemetry."] - pub fn get_component_telemetry_value( - &self, - device_id: impl Into, - component_name: impl Into, - telemetry_name: impl Into, - ) -> get_component_telemetry_value::RequestBuilder { - get_component_telemetry_value::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - component_name: component_name.into(), - telemetry_name: telemetry_name.into(), - } - } - #[doc = "Get device credentials"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn get_credentials(&self, device_id: impl Into) -> get_credentials::RequestBuilder { - get_credentials::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "List the modules present in a device"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn list_modules(&self, device_id: impl Into) -> list_modules::RequestBuilder { - list_modules::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Get module command history"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `command_name`: Name of this device command."] - pub fn get_module_command_history( - &self, - device_id: impl Into, - module_name: impl Into, - command_name: impl Into, - ) -> get_module_command_history::RequestBuilder { - get_module_command_history::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - command_name: command_name.into(), - } - } - #[doc = "Run a module command"] - #[doc = "Run a command on a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `command_name`: Name of this device command."] - #[doc = "* `body`: Device command body."] - pub fn run_module_command( - &self, - device_id: impl Into, - module_name: impl Into, - command_name: impl Into, - body: impl Into, - ) -> run_module_command::RequestBuilder { - run_module_command::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - command_name: command_name.into(), - body: body.into(), - } - } - #[doc = "List the components present in a module"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - pub fn list_module_components( - &self, - device_id: impl Into, - module_name: impl Into, - ) -> list_module_components::RequestBuilder { - list_module_components::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - } - } - #[doc = "Get module component command history"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `command_name`: Name of this device command."] - pub fn get_module_component_command_history( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - command_name: impl Into, - ) -> get_module_component_command_history::RequestBuilder { - get_module_component_command_history::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - command_name: command_name.into(), - } - } - #[doc = "Run a module component command"] - #[doc = "Run a command on a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `command_name`: Name of this device command."] - #[doc = "* `body`: Device command body."] - pub fn run_module_component_command( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - command_name: impl Into, - body: impl Into, - ) -> run_module_component_command::RequestBuilder { - run_module_component_command::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - command_name: command_name.into(), - body: body.into(), - } - } - #[doc = "Get module properties for a specific component"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - pub fn get_module_component_properties( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - ) -> get_module_component_properties::RequestBuilder { - get_module_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - } - } - #[doc = "Replace module properties for a specific component"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `body`: Module properties."] - pub fn replace_module_component_properties( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - body: impl Into, - ) -> replace_module_component_properties::RequestBuilder { - replace_module_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - body: body.into(), - } - } - #[doc = "Update module properties for a specific component via patch"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `body`: Module properties patch."] - pub fn update_module_component_properties( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - body: impl Into, - ) -> update_module_component_properties::RequestBuilder { - update_module_component_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - body: body.into(), - } - } - #[doc = "Get module component telemetry value"] - #[doc = "Get the last telemetry value from a module component."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `component_name`: Name of the device component."] - #[doc = "* `telemetry_name`: Name of this device telemetry."] - pub fn get_module_component_telemetry_value( - &self, - device_id: impl Into, - module_name: impl Into, - component_name: impl Into, - telemetry_name: impl Into, - ) -> get_module_component_telemetry_value::RequestBuilder { - get_module_component_telemetry_value::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - component_name: component_name.into(), - telemetry_name: telemetry_name.into(), - } - } - #[doc = "Get module properties"] - #[doc = "Get all property values of a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - pub fn get_module_properties( - &self, - device_id: impl Into, - module_name: impl Into, - ) -> get_module_properties::RequestBuilder { - get_module_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - } - } - #[doc = "Replace module properties"] - #[doc = "Replace all property values of a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `body`: Module properties."] - pub fn replace_module_properties( - &self, - device_id: impl Into, - module_name: impl Into, - body: impl Into, - ) -> replace_module_properties::RequestBuilder { - replace_module_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - body: body.into(), - } - } - #[doc = "Update module properties via patch"] - #[doc = "Update property values of a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `body`: Module properties patch."] - pub fn update_module_properties( - &self, - device_id: impl Into, - module_name: impl Into, - body: impl Into, - ) -> update_module_properties::RequestBuilder { - update_module_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - body: body.into(), - } - } - #[doc = "Get module telemetry value"] - #[doc = "Get the last telemetry value from a module."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `module_name`: Name of the device module."] - #[doc = "* `telemetry_name`: Name of this device telemetry."] - pub fn get_module_telemetry_value( - &self, - device_id: impl Into, - module_name: impl Into, - telemetry_name: impl Into, - ) -> get_module_telemetry_value::RequestBuilder { - get_module_telemetry_value::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - module_name: module_name.into(), - telemetry_name: telemetry_name.into(), - } - } - #[doc = "Get device properties"] - #[doc = "Get all property values of a device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn get_properties(&self, device_id: impl Into) -> get_properties::RequestBuilder { - get_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - unmodeled: None, - } - } - #[doc = "Replace device properties"] - #[doc = "Replace all property values of a device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Device properties."] - pub fn replace_properties( - &self, - device_id: impl Into, - body: impl Into, - ) -> replace_properties::RequestBuilder { - replace_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - unmodeled: None, - } - } - #[doc = "Update device properties via patch"] - #[doc = "Update property values of a device by device ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `body`: Device properties patch."] - pub fn update_properties( - &self, - device_id: impl Into, - body: impl Into, - ) -> update_properties::RequestBuilder { - update_properties::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - body: body.into(), - unmodeled: None, - } - } - #[doc = "Given the ID for an upstream device, will return the upstream and the downstream relationships associated with that gateway. These downstream relationships are only those associated with the direct downstream level (they don’t work recursively)."] - #[doc = "List all relationships based on device ID"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - pub fn list_relationships(&self, device_id: impl Into) -> list_relationships::RequestBuilder { - list_relationships::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - } - } - #[doc = "Given the ID for a device and a relationship ID associated with this device, get the details of the relationship."] - #[doc = "Get device relationship by ID"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] - pub fn get_relationship( - &self, - device_id: impl Into, - relationship_id: impl Into, - ) -> get_relationship::RequestBuilder { - get_relationship::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - relationship_id: relationship_id.into(), - } - } - #[doc = "Given the ID for a device and a relationship ID associated with this device, create a new relationship for between the given device and a second device specified in the body."] - #[doc = "Create a device relationship"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] - #[doc = "* `body`: Device relationship body."] - pub fn create_relationship( - &self, - device_id: impl Into, - relationship_id: impl Into, - body: impl Into, - ) -> create_relationship::RequestBuilder { - create_relationship::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - relationship_id: relationship_id.into(), - body: body.into(), - } - } - #[doc = "Patch a given relationship given the relationship ID and a given device ID."] - #[doc = "Update device relationship"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] - #[doc = "* `body`: Device relationship patch body."] - pub fn update_relationship( - &self, - device_id: impl Into, - relationship_id: impl Into, - body: impl Into, - ) -> update_relationship::RequestBuilder { - update_relationship::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - relationship_id: relationship_id.into(), - body: body.into(), - } - } - #[doc = "Given the ID for a device and an associated relationship ID, delete the relationship. The given device ID can be that of the upstream or downstream device."] - #[doc = "Delete a device relationship"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] - pub fn remove_relationship( - &self, - device_id: impl Into, - relationship_id: impl Into, - ) -> remove_relationship::RequestBuilder { - remove_relationship::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - relationship_id: relationship_id.into(), - } - } - #[doc = "Get device telemetry value"] - #[doc = "Get the last telemetry value from a device."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `device_id`: Unique ID of the device."] - #[doc = "* `telemetry_name`: Name of this device telemetry."] - pub fn get_telemetry_value( - &self, - device_id: impl Into, - telemetry_name: impl Into, - ) -> get_telemetry_value::RequestBuilder { - get_telemetry_value::RequestBuilder { - client: self.0.clone(), - device_id: device_id.into(), - telemetry_name: telemetry_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::DeviceCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) orderby: Option, - } - impl RequestBuilder { - #[doc = "An expression on the resource type that selects the resources to be returned."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "The maximum number of resources to return from the collection."] - pub fn top(mut self, top: i64) -> Self { - self.top = Some(top); - self - } - #[doc = "An expression that specify the order of the returned resources."] - 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, "2022-06-30-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(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.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!("{}/devices", 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, "2022-06-30-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::Device = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_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!("{}/devices/{}", self.client.endpoint(), &self.device_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::Device = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) body: models::Device, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/devices/{}", self.client.endpoint(), &self.device_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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::Device = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) body: serde_json::Value, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/devices/{}", self.client.endpoint(), &self.device_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) device_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!("{}/devices/{}", self.client.endpoint(), &self.device_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-06-30-preview"); - } - Ok(url) - } - } - } - pub mod get_attestation { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Attestation = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_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!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_attestation { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Attestation = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) body: models::Attestation, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_attestation { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Attestation = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) body: serde_json::Value, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_attestation { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) device_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!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-06-30-preview"); - } - Ok(url) - } - } - } - pub mod get_command_history { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) command_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, "2022-06-30-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!( - "{}/devices/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.command_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); - } - Ok(url) - } - } - } - pub mod run_command { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) command_name: String, - pub(crate) body: models::DeviceCommand, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!( - "{}/devices/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.command_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_components { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Collection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_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!("{}/devices/{}/components", self.client.endpoint(), &self.device_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_component_command_history { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; - 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 = "Run a device command"] + #[doc = "Run a command on a device."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `command_name`: Name of this device command."] + #[doc = "* `body`: Device command body."] + pub fn run_command( + &self, + device_id: impl Into, + command_name: impl Into, + body: impl Into, + ) -> run_command::RequestBuilder { + run_command::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + command_name: command_name.into(), + body: body.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "List the components present in a device"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn list_components(&self, device_id: impl Into) -> list_components::RequestBuilder { + list_components::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Get component command history"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `command_name`: Name of this device command."] + pub fn get_component_command_history( + &self, + device_id: impl Into, + component_name: impl Into, + command_name: impl Into, + ) -> get_component_command_history::RequestBuilder { + get_component_command_history::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + command_name: command_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) device_id: String, - pub(crate) component_name: String, - pub(crate) command_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, "2022-06-30-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) + #[doc = "Run a component command"] + #[doc = "Run a command on a component."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `command_name`: Name of this device command."] + #[doc = "* `body`: Device command body."] + pub fn run_component_command( + &self, + device_id: impl Into, + component_name: impl Into, + command_name: impl Into, + body: impl Into, + ) -> run_component_command::RequestBuilder { + run_component_command::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + command_name: command_name.into(), + body: body.into(), } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/components/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.component_name, - &self.command_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); - } - Ok(url) + } + #[doc = "Get device properties for a specific component"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + pub fn get_component_properties( + &self, + device_id: impl Into, + component_name: impl Into, + ) -> get_component_properties::RequestBuilder { + get_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), } } - } - pub mod run_component_command { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; - Ok(body) + #[doc = "Replace device properties for a specific component"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `body`: Device properties."] + pub fn replace_component_properties( + &self, + device_id: impl Into, + component_name: impl Into, + body: impl Into, + ) -> replace_component_properties::RequestBuilder { + replace_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + body: body.into(), } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + } + #[doc = "Update device properties for a specific component via patch"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `body`: Device properties patch."] + pub fn update_component_properties( + &self, + device_id: impl Into, + component_name: impl Into, + body: impl Into, + ) -> update_component_properties::RequestBuilder { + update_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + body: body.into(), } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + } + #[doc = "Get component telemetry value"] + #[doc = "Get the last telemetry value from a component."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `telemetry_name`: Name of this device telemetry."] + pub fn get_component_telemetry_value( + &self, + device_id: impl Into, + component_name: impl Into, + telemetry_name: impl Into, + ) -> get_component_telemetry_value::RequestBuilder { + get_component_telemetry_value::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + component_name: component_name.into(), + telemetry_name: telemetry_name.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Get device credentials"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn get_credentials(&self, device_id: impl Into) -> get_credentials::RequestBuilder { + get_credentials::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "List the modules present in a device"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn list_modules(&self, device_id: impl Into) -> list_modules::RequestBuilder { + list_modules::RequestBuilder { + client: self.0.clone(), + device_id: device_id.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) device_id: String, - pub(crate) component_name: String, - pub(crate) command_name: String, - pub(crate) body: models::DeviceCommand, + #[doc = "Get module command history"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `command_name`: Name of this device command."] + pub fn get_module_command_history( + &self, + device_id: impl Into, + module_name: impl Into, + command_name: impl Into, + ) -> get_module_command_history::RequestBuilder { + get_module_command_history::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + command_name: command_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::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?)) - } - }) + #[doc = "Run a module command"] + #[doc = "Run a command on a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `command_name`: Name of this device command."] + #[doc = "* `body`: Device command body."] + pub fn run_module_command( + &self, + device_id: impl Into, + module_name: impl Into, + command_name: impl Into, + body: impl Into, + ) -> run_module_command::RequestBuilder { + run_module_command::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + command_name: command_name.into(), + body: body.into(), } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/components/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.component_name, - &self.command_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); - } - Ok(url) + } + #[doc = "List the components present in a module"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + pub fn list_module_components( + &self, + device_id: impl Into, + module_name: impl Into, + ) -> list_module_components::RequestBuilder { + list_module_components::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_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 sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/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 = "Get module component command history"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `command_name`: Name of this device command."] + pub fn get_module_component_command_history( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + command_name: impl Into, + ) -> get_module_component_command_history::RequestBuilder { + get_module_component_command_history::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + command_name: command_name.into(), } } - } - pub mod get_component_properties { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; - 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 = "Run a module component command"] + #[doc = "Run a command on a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `command_name`: Name of this device command."] + #[doc = "* `body`: Device command body."] + pub fn run_module_component_command( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + command_name: impl Into, + body: impl Into, + ) -> run_module_component_command::RequestBuilder { + run_module_component_command::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + command_name: command_name.into(), + body: body.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Get module properties for a specific component"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + pub fn get_module_component_properties( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + ) -> get_module_component_properties::RequestBuilder { + get_module_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Replace module properties for a specific component"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `body`: Module properties."] + pub fn replace_module_component_properties( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + body: impl Into, + ) -> replace_module_component_properties::RequestBuilder { + replace_module_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.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" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) unmodeled: Option, - } - impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - self + #[doc = "Update module properties for a specific component via patch"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `body`: Module properties patch."] + pub fn update_module_component_properties( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + body: impl Into, + ) -> update_module_component_properties::RequestBuilder { + update_module_component_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + body: body.into(), } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + } + #[doc = "Get module component telemetry value"] + #[doc = "Get the last telemetry value from a module component."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `component_name`: Name of the device component."] + #[doc = "* `telemetry_name`: Name of this device telemetry."] + pub fn get_module_component_telemetry_value( + &self, + device_id: impl Into, + module_name: impl Into, + component_name: impl Into, + telemetry_name: impl Into, + ) -> get_module_component_telemetry_value::RequestBuilder { + get_module_component_telemetry_value::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + component_name: component_name.into(), + telemetry_name: telemetry_name.into(), } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/components/{}/properties", - self.client.endpoint(), - &self.device_id, - &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-06-30-preview"); - } - Ok(url) + } + #[doc = "Get module properties"] + #[doc = "Get all property values of a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + pub fn get_module_properties( + &self, + device_id: impl Into, + module_name: impl Into, + ) -> get_module_properties::RequestBuilder { + get_module_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_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 sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/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 = "Replace module properties"] + #[doc = "Replace all property values of a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `body`: Module properties."] + pub fn replace_module_properties( + &self, + device_id: impl Into, + module_name: impl Into, + body: impl Into, + ) -> replace_module_properties::RequestBuilder { + replace_module_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + body: body.into(), } } - } - pub mod replace_component_properties { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; - Ok(body) + #[doc = "Update module properties via patch"] + #[doc = "Update property values of a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `body`: Module properties patch."] + pub fn update_module_properties( + &self, + device_id: impl Into, + module_name: impl Into, + body: impl Into, + ) -> update_module_properties::RequestBuilder { + update_module_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + body: body.into(), } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + } + #[doc = "Get module telemetry value"] + #[doc = "Get the last telemetry value from a module."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `module_name`: Name of the device module."] + #[doc = "* `telemetry_name`: Name of this device telemetry."] + pub fn get_module_telemetry_value( + &self, + device_id: impl Into, + module_name: impl Into, + telemetry_name: impl Into, + ) -> get_module_telemetry_value::RequestBuilder { + get_module_telemetry_value::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + module_name: module_name.into(), + telemetry_name: telemetry_name.into(), } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + } + #[doc = "Get device properties"] + #[doc = "Get all property values of a device by device ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn get_properties(&self, device_id: impl Into) -> get_properties::RequestBuilder { + get_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Replace device properties"] + #[doc = "Replace all property values of a device by device ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Device properties."] + pub fn replace_properties( + &self, + device_id: impl Into, + body: impl Into, + ) -> replace_properties::RequestBuilder { + replace_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + body: body.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Update device properties via patch"] + #[doc = "Update property values of a device by device ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `body`: Device properties patch."] + pub fn update_properties( + &self, + device_id: impl Into, + body: impl Into, + ) -> update_properties::RequestBuilder { + update_properties::RequestBuilder { + client: self.0.clone(), + device_id: device_id.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" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) body: models::DeviceProperties, - pub(crate) unmodeled: Option, + #[doc = "Given the ID for an upstream device, will return the upstream and the downstream relationships associated with that gateway. These downstream relationships are only those associated with the direct downstream level (they don’t work recursively)."] + #[doc = "List all relationships based on device ID"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + pub fn list_relationships(&self, device_id: impl Into) -> list_relationships::RequestBuilder { + list_relationships::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + } } - impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - self + #[doc = "Given the ID for a device and a relationship ID associated with this device, get the details of the relationship."] + #[doc = "Get device relationship by ID"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] + pub fn get_relationship( + &self, + device_id: impl Into, + relationship_id: impl Into, + ) -> get_relationship::RequestBuilder { + get_relationship::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + relationship_id: relationship_id.into(), } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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)?; - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.to_string()); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + } + #[doc = "Given the ID for a device and a relationship ID associated with this device, create a new relationship for between the given device and a second device specified in the body."] + #[doc = "Create a device relationship"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] + #[doc = "* `body`: Device relationship body."] + pub fn create_relationship( + &self, + device_id: impl Into, + relationship_id: impl Into, + body: impl Into, + ) -> create_relationship::RequestBuilder { + create_relationship::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + relationship_id: relationship_id.into(), + body: body.into(), } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/components/{}/properties", - self.client.endpoint(), - &self.device_id, - &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-06-30-preview"); - } - Ok(url) + } + #[doc = "Patch a given relationship given the relationship ID and a given device ID."] + #[doc = "Update device relationship"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] + #[doc = "* `body`: Device relationship patch body."] + pub fn update_relationship( + &self, + device_id: impl Into, + relationship_id: impl Into, + body: impl Into, + ) -> update_relationship::RequestBuilder { + update_relationship::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + relationship_id: relationship_id.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 sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/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 = "Given the ID for a device and an associated relationship ID, delete the relationship. The given device ID can be that of the upstream or downstream device."] + #[doc = "Delete a device relationship"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `relationship_id`: Unique ID of a relationship between devices."] + pub fn remove_relationship( + &self, + device_id: impl Into, + relationship_id: impl Into, + ) -> remove_relationship::RequestBuilder { + remove_relationship::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + relationship_id: relationship_id.into(), + } + } + #[doc = "Get device telemetry value"] + #[doc = "Get the last telemetry value from a device."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `device_id`: Unique ID of the device."] + #[doc = "* `telemetry_name`: Name of this device telemetry."] + pub fn get_telemetry_value( + &self, + device_id: impl Into, + telemetry_name: impl Into, + ) -> get_telemetry_value::RequestBuilder { + get_telemetry_value::RequestBuilder { + client: self.0.clone(), + device_id: device_id.into(), + telemetry_name: telemetry_name.into(), } } } - pub mod update_component_properties { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6350,9 +3912,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6393,72 +3955,99 @@ pub mod devices { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) body: serde_json::Value, - pub(crate) unmodeled: Option, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) orderby: Option, } impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); + #[doc = "An expression on the resource type that selects the resources to be returned."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.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({ + #[doc = "The maximum number of resources to return from the collection."] + pub fn top(mut self, top: i64) -> Self { + self.top = Some(top); + self + } + #[doc = "An expression that specify the order of the returned resources."] + 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 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)?; - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.to_string()); - } - 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, "1.2-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(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.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!( - "{}/devices/{}/components/{}/properties", - self.client.endpoint(), - &self.device_id, - &self.component_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_component_telemetry_value { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6467,9 +4056,9 @@ pub mod devices { #[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::DeviceTelemetry = serde_json::from_slice(&bytes)?; + let body: models::Device = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6511,8 +4100,6 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) component_name: String, - pub(crate) telemetry_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6538,24 +4125,18 @@ pub mod devices { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/components/{}/telemetry/{}", - self.client.endpoint(), - &self.device_id, - &self.component_name, - &self.telemetry_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -6566,7 +4147,7 @@ pub mod devices { } } } - pub mod get_credentials { + pub mod create { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6575,9 +4156,9 @@ pub mod devices { #[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::DeviceCredentials = serde_json::from_slice(&bytes)?; + let body: models::Device = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6619,6 +4200,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, + pub(crate) body: models::Device, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6630,32 +4212,33 @@ pub mod devices { 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!("{}/devices/{}/credentials", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -6666,7 +4249,7 @@ pub mod devices { } } } - pub mod list_modules { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6675,9 +4258,9 @@ pub mod devices { #[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::Collection = serde_json::from_slice(&bytes)?; + let body: models::Device = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6719,6 +4302,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6730,32 +4314,33 @@ pub mod devices { 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!("{}/devices/{}/modules", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -6766,7 +4351,7 @@ pub mod devices { } } } - pub mod get_module_command_history { + pub mod remove { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6775,11 +4360,6 @@ pub mod devices { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -6819,80 +4399,42 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) command_name: String, } impl RequestBuilder { - 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-06-30-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 + 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!( - "{}/devices/{}/modules/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.command_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } } - pub mod run_module_command { + pub mod get_attestation { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6901,9 +4443,9 @@ pub mod devices { #[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::DeviceCommand = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6945,9 +4487,6 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) command_name: String, - pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6959,39 +4498,32 @@ pub mod devices { 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!( - "{}/devices/{}/modules/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.command_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -7002,7 +4534,7 @@ pub mod devices { } } } - pub mod list_module_components { + pub mod create_attestation { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7011,9 +4543,9 @@ pub mod devices { #[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::Collection = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7055,7 +4587,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, + pub(crate) body: models::AttestationUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7067,37 +4599,33 @@ pub mod devices { 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!( - "{}/devices/{}/modules/{}/components", - self.client.endpoint(), - &self.device_id, - &self.module_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -7108,7 +4636,7 @@ pub mod devices { } } } - pub mod get_module_component_command_history { + pub mod update_attestation { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7117,9 +4645,9 @@ pub mod devices { #[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::DeviceCommandCollection = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7161,82 +4689,56 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, - pub(crate) command_name: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { - 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-06-30-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 + 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!( - "{}/devices/{}/modules/{}/components/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.component_name, - &self.command_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod run_module_component_command { + pub mod remove_attestation { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7245,11 +4747,6 @@ pub mod devices { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -7289,10 +4786,6 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, - pub(crate) command_name: String, - pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7304,51 +4797,31 @@ pub mod devices { 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( 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!( - "{}/devices/{}/modules/{}/components/{}/commands/{}", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.component_name, - &self.command_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/attestation", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_module_component_properties { + pub mod get_command_history { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7357,9 +4830,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7401,62 +4874,78 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, + pub(crate) command_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests 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::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", 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, "1.2-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!( - "{}/devices/{}/modules/{}/components/{}/properties", + "{}/devices/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.module_name, - &self.component_name + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod replace_module_component_properties { + pub mod run_command { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7465,9 +4954,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7509,9 +4998,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, - pub(crate) body: models::DeviceProperties, + pub(crate) command_name: String, + pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7523,7 +5011,7 @@ pub mod devices { 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( @@ -7539,23 +5027,22 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/components/{}/properties", + "{}/devices/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.module_name, - &self.component_name + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -7566,7 +5053,7 @@ pub mod devices { } } } - pub mod update_module_component_properties { + pub mod list_components { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7575,9 +5062,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::Collection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7619,9 +5106,6 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) component_name: String, - pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7633,39 +5117,32 @@ pub mod devices { 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::Get); let credential = this.client.token_credential(); 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!( - "{}/devices/{}/modules/{}/components/{}/properties", - self.client.endpoint(), - &self.device_id, - &self.module_name, - &self.component_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/components", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -7676,7 +5153,7 @@ pub mod devices { } } } - pub mod get_module_component_telemetry_value { + pub mod get_component_command_history { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7685,9 +5162,9 @@ pub mod devices { #[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::DeviceTelemetry = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7729,64 +5206,80 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, pub(crate) component_name: String, - pub(crate) telemetry_name: String, + pub(crate) command_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests 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::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", 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, "1.2-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!( - "{}/devices/{}/modules/{}/components/{}/telemetry/{}", + "{}/devices/{}/components/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.module_name, &self.component_name, - &self.telemetry_name + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_module_properties { + pub mod run_component_command { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7795,9 +5288,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7839,7 +5332,9 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) command_name: String, + pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7851,14 +5346,15 @@ pub mod devices { 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?)) } @@ -7866,22 +5362,23 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/properties", + "{}/devices/{}/components/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.module_name + &self.component_name, + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -7892,7 +5389,7 @@ pub mod devices { } } } - pub mod replace_module_properties { + pub mod get_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7945,8 +5442,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) body: models::DeviceProperties, + 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."] @@ -7958,15 +5454,14 @@ pub mod devices { 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()), ); - 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?)) } @@ -7974,15 +5469,15 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/properties", + "{}/devices/{}/components/{}/properties", self.client.endpoint(), &self.device_id, - &self.module_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -8000,7 +5495,7 @@ pub mod devices { } } } - pub mod update_module_properties { + pub mod replace_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8053,8 +5548,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) body: serde_json::Value, + pub(crate) component_name: String, + pub(crate) body: models::DeviceProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8066,7 +5561,7 @@ pub mod devices { 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::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -8082,15 +5577,15 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/properties", + "{}/devices/{}/components/{}/properties", self.client.endpoint(), &self.device_id, - &self.module_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -8108,7 +5603,7 @@ pub mod devices { } } } - pub mod get_module_telemetry_value { + pub mod update_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8117,9 +5612,9 @@ pub mod devices { #[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::DeviceTelemetry = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8161,8 +5656,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) module_name: String, - pub(crate) telemetry_name: String, + pub(crate) component_name: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8174,14 +5669,15 @@ pub mod devices { 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?)) } @@ -8189,23 +5685,22 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/modules/{}/telemetry/{}", + "{}/devices/{}/components/{}/properties", self.client.endpoint(), &self.device_id, - &self.module_name, - &self.telemetry_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -8216,7 +5711,7 @@ pub mod devices { } } } - pub mod get_properties { + pub mod get_component_telemetry_value { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8225,9 +5720,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceTelemetry = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8269,14 +5764,10 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) unmodeled: Option, + pub(crate) component_name: String, + pub(crate) telemetry_name: String, } impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - 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()`."] @@ -8293,9 +5784,6 @@ pub mod devices { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8303,18 +5791,24 @@ pub mod devices { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/devices/{}/properties", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/components/{}/telemetry/{}", + self.client.endpoint(), + &self.device_id, + &self.component_name, + &self.telemetry_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -8325,7 +5819,7 @@ pub mod devices { } } } - pub mod replace_properties { + pub mod get_credentials { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8334,9 +5828,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::DeviceCredentials = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8378,15 +5872,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) body: models::DeviceProperties, - pub(crate) unmodeled: Option, } impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - 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()`."] @@ -8396,36 +5883,32 @@ pub mod devices { 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()), ); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.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!("{}/devices/{}/properties", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/credentials", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -8436,7 +5919,7 @@ pub mod devices { } } } - pub mod update_properties { + pub mod list_modules { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8445,9 +5928,9 @@ pub mod devices { #[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::DeviceProperties = serde_json::from_slice(&bytes)?; + let body: models::Collection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8489,15 +5972,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) body: serde_json::Value, - pub(crate) unmodeled: Option, } impl RequestBuilder { - #[doc = "The query parameter for supporting unmodeled properties."] - pub fn unmodeled(mut self, unmodeled: bool) -> Self { - self.unmodeled = Some(unmodeled); - 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()`."] @@ -8507,36 +5983,32 @@ pub mod devices { 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::Get); let credential = this.client.token_credential(); 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)?; - if let Some(unmodeled) = &this.unmodeled { - req.url_mut().query_pairs_mut().append_pair("unmodeled", &unmodeled.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!("{}/devices/{}/properties", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/modules", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -8547,7 +6019,7 @@ pub mod devices { } } } - pub mod list_relationships { + pub mod get_module_command_history { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8556,9 +6028,9 @@ pub mod devices { #[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::DeviceRelationshipCollection = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8600,54 +6072,80 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) command_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests 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::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", 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, "1.2-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!("{}/devices/{}/relationships", self.client.endpoint(), &self.device_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/modules/{}/commands/{}", + self.client.endpoint(), + &self.device_id, + &self.module_name, + &self.command_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_relationship { + pub mod run_module_command { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8656,9 +6154,9 @@ pub mod devices { #[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::DeviceRelationship = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8700,7 +6198,9 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) relationship_id: String, + pub(crate) module_name: String, + pub(crate) command_name: String, + pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8712,14 +6212,15 @@ pub mod devices { 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?)) } @@ -8727,22 +6228,23 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/relationships/{}", + "{}/devices/{}/modules/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.relationship_id + &self.module_name, + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -8753,7 +6255,7 @@ pub mod devices { } } } - pub mod create_relationship { + pub mod list_module_components { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8762,9 +6264,9 @@ pub mod devices { #[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::DeviceRelationship = serde_json::from_slice(&bytes)?; + let body: models::Collection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8806,8 +6308,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) relationship_id: String, - pub(crate) body: models::DeviceRelationship, + pub(crate) module_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8819,15 +6320,14 @@ pub mod devices { 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()), ); - 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?)) } @@ -8835,22 +6335,22 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/relationships/{}", + "{}/devices/{}/modules/{}/components", self.client.endpoint(), &self.device_id, - &self.relationship_id + &self.module_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -8861,7 +6361,7 @@ pub mod devices { } } } - pub mod update_relationship { + pub mod get_module_component_command_history { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8870,9 +6370,9 @@ pub mod devices { #[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::DeviceRelationship = serde_json::from_slice(&bytes)?; + let body: models::DeviceCommandCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8914,62 +6414,82 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) relationship_id: String, - pub(crate) body: serde_json::Value, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) command_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests 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::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, "1.2-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!( - "{}/devices/{}/relationships/{}", + "{}/devices/{}/modules/{}/components/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.relationship_id + &self.module_name, + &self.component_name, + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod remove_relationship { + pub mod run_module_component_command { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8978,6 +6498,11 @@ pub mod devices { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceCommand = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -9017,7 +6542,10 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) relationship_id: String, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) command_name: String, + pub(crate) body: models::DeviceCommand, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9029,14 +6557,15 @@ pub mod devices { 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?)) } @@ -9044,21 +6573,35 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/relationships/{}", + "{}/devices/{}/modules/{}/components/{}/commands/{}", self.client.endpoint(), &self.device_id, - &self.relationship_id + &self.module_name, + &self.component_name, + &self.command_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_telemetry_value { + pub mod get_module_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9067,9 +6610,9 @@ pub mod devices { #[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::DeviceTelemetry = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9111,7 +6654,8 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) telemetry_name: String, + pub(crate) module_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."] @@ -9138,22 +6682,23 @@ pub mod devices { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/devices/{}/telemetry/{}", + "{}/devices/{}/modules/{}/components/{}/properties", self.client.endpoint(), &self.device_id, - &self.telemetry_name + &self.module_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -9164,269 +6709,7 @@ pub mod devices { } } } -} -pub mod enrollment_groups { - 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 = "Get the list of enrollment groups in an application"] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - #[doc = "Get an enrollment group by ID"] - #[doc = "Get details about an enrollment group by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - pub fn get(&self, enrollment_group_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - } - } - #[doc = "Create an enrollment group"] - #[doc = "Create an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `body`: Enrollment group body."] - pub fn create(&self, enrollment_group_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - body: body.into(), - } - } - #[doc = "Update an enrollment group"] - #[doc = "Update an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `body`: Enrollment group patch body."] - pub fn update(&self, enrollment_group_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - body: body.into(), - } - } - #[doc = "Delete an enrollment group"] - #[doc = "Delete an enrollment group by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - pub fn remove(&self, enrollment_group_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - } - } - #[doc = "Get the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Get details about the primary or secondary x509 certificate of an enrollment group, if it exists."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - pub fn get_x509(&self, enrollment_group_id: impl Into, entry: impl Into) -> get_x509::RequestBuilder { - get_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.into(), - } - } - #[doc = "Sets the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Sets the primary or secondary x509 certificate of an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - #[doc = "* `body`: Certificate definition."] - pub fn create_x509( - &self, - enrollment_group_id: impl Into, - entry: impl Into, - body: impl Into, - ) -> create_x509::RequestBuilder { - create_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.into(), - body: body.into(), - } - } - #[doc = "Removes the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Removes the primary or secondary x509 certificate of an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - pub fn remove_x509(&self, enrollment_group_id: impl Into, entry: impl Into) -> remove_x509::RequestBuilder { - remove_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.into(), - } - } - #[doc = "Generate a verification code for the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Generate a verification code for the primary or secondary x509 certificate of an enrollment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - pub fn generate_verification_code_x509( - &self, - enrollment_group_id: impl Into, - entry: impl Into, - ) -> generate_verification_code_x509::RequestBuilder { - generate_verification_code_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.into(), - } - } - #[doc = "Verify the primary or secondary x509 certificate of an enrollment group"] - #[doc = "Verify the primary or secondary x509 certificate of an enrollment group by providing a certificate with the signed verification code."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `enrollment_group_id`: Unique ID of the enrollment group."] - #[doc = "* `entry`: Entry of certificate only support primary and secondary."] - #[doc = "* `body`: Certificate for the signed verification code."] - pub fn verify_x509( - &self, - enrollment_group_id: impl Into, - entry: impl Into, - body: impl Into, - ) -> verify_x509::RequestBuilder { - verify_x509::RequestBuilder { - client: self.0.clone(), - enrollment_group_id: enrollment_group_id.into(), - entry: entry.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::EnrollmentGroupCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] 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 { - 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-06-30-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!("{}/enrollmentGroups", 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, "2022-06-30-preview"); - } - Ok(url) - } - } - } - pub mod get { + pub mod replace_module_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9435,9 +6718,9 @@ pub mod enrollment_groups { #[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::EnrollmentGroup = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9478,7 +6761,10 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) body: models::DeviceProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9490,14 +6776,15 @@ pub mod enrollment_groups { 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?)) } @@ -9505,21 +6792,23 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}", + "{}/devices/{}/modules/{}/components/{}/properties", self.client.endpoint(), - &self.enrollment_group_id + &self.device_id, + &self.module_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -9530,7 +6819,7 @@ pub mod enrollment_groups { } } } - pub mod create { + pub mod update_module_component_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9539,9 +6828,9 @@ pub mod enrollment_groups { #[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::EnrollmentGroup = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9582,8 +6871,10 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) body: models::EnrollmentGroup, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9595,7 +6886,7 @@ pub mod enrollment_groups { 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( @@ -9611,21 +6902,23 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}", + "{}/devices/{}/modules/{}/components/{}/properties", self.client.endpoint(), - &self.enrollment_group_id + &self.device_id, + &self.module_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -9636,7 +6929,7 @@ pub mod enrollment_groups { } } } - pub mod update { + pub mod get_module_component_telemetry_value { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9645,9 +6938,9 @@ pub mod enrollment_groups { #[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::EnrollmentGroup = serde_json::from_slice(&bytes)?; + let body: models::DeviceTelemetry = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9688,8 +6981,10 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) body: serde_json::Value, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) component_name: String, + pub(crate) telemetry_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9701,15 +6996,14 @@ pub mod enrollment_groups { 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::Get); let credential = this.client.token_credential(); 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/merge-patch+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?)) } @@ -9717,21 +7011,24 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}", + "{}/devices/{}/modules/{}/components/{}/telemetry/{}", self.client.endpoint(), - &self.enrollment_group_id + &self.device_id, + &self.module_name, + &self.component_name, + &self.telemetry_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -9742,7 +7039,7 @@ pub mod enrollment_groups { } } } - pub mod remove { + pub mod get_module_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9751,6 +7048,11 @@ pub mod enrollment_groups { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -9789,7 +7091,8 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, + pub(crate) device_id: String, + pub(crate) module_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9801,7 +7104,7 @@ pub mod enrollment_groups { 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( @@ -9816,20 +7119,33 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}", + "{}/devices/{}/modules/{}/properties", self.client.endpoint(), - &self.enrollment_group_id + &self.device_id, + &self.module_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_x509 { + pub mod replace_module_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9838,9 +7154,9 @@ pub mod enrollment_groups { #[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::SigningX509Certificate = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9881,8 +7197,9 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) body: models::DeviceProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9894,14 +7211,15 @@ pub mod enrollment_groups { 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?)) } @@ -9909,22 +7227,22 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}/certificates/{}", + "{}/devices/{}/modules/{}/properties", self.client.endpoint(), - &self.enrollment_group_id, - &self.entry + &self.device_id, + &self.module_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -9935,7 +7253,7 @@ pub mod enrollment_groups { } } } - pub mod create_x509 { + pub mod update_module_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9944,9 +7262,9 @@ pub mod enrollment_groups { #[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::SigningX509Certificate = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9987,9 +7305,9 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, - pub(crate) body: models::SigningX509Certificate, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10001,7 +7319,7 @@ pub mod enrollment_groups { 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( @@ -10017,22 +7335,22 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}/certificates/{}", + "{}/devices/{}/modules/{}/properties", self.client.endpoint(), - &self.enrollment_group_id, - &self.entry + &self.device_id, + &self.module_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -10043,7 +7361,7 @@ pub mod enrollment_groups { } } } - pub mod remove_x509 { + pub mod get_module_telemetry_value { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10052,6 +7370,11 @@ pub mod enrollment_groups { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceTelemetry = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -10090,8 +7413,9 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, + pub(crate) device_id: String, + pub(crate) module_name: String, + pub(crate) telemetry_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10103,7 +7427,7 @@ pub mod enrollment_groups { 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( @@ -10118,21 +7442,34 @@ pub mod enrollment_groups { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}/certificates/{}", + "{}/devices/{}/modules/{}/telemetry/{}", self.client.endpoint(), - &self.enrollment_group_id, - &self.entry + &self.device_id, + &self.module_name, + &self.telemetry_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod generate_verification_code_x509 { + pub mod get_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10141,9 +7478,9 @@ pub mod enrollment_groups { #[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::X509VerificationCode = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10184,8 +7521,7 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, + pub(crate) device_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."] @@ -10197,7 +7533,7 @@ pub mod enrollment_groups { 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( @@ -10205,30 +7541,24 @@ pub mod enrollment_groups { 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!( - "{}/enrollmentGroups/{}/certificates/{}/generateVerificationCode", - self.client.endpoint(), - &self.enrollment_group_id, - &self.entry - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/properties", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -10239,7 +7569,7 @@ pub mod enrollment_groups { } } } - pub mod verify_x509 { + pub mod replace_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10248,6 +7578,11 @@ pub mod enrollment_groups { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -10286,9 +7621,8 @@ pub mod enrollment_groups { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) enrollment_group_id: String, - pub(crate) entry: String, - pub(crate) body: models::X509VerificationCertificate, + pub(crate) device_id: String, + pub(crate) body: models::DeviceProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10300,7 +7634,7 @@ pub mod enrollment_groups { 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( @@ -10315,60 +7649,29 @@ pub mod enrollment_groups { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/enrollmentGroups/{}/certificates/{}/verify", - self.client.endpoint(), - &self.enrollment_group_id, - &self.entry - ))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/properties", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - } -} -pub mod file_uploads { - 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 = "Get the file upload storage account configuration."] - pub fn get(&self) -> get::RequestBuilder { - get::RequestBuilder { client: self.0.clone() } - } - #[doc = "Create the file upload storage account configuration."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `body`: File upload storage account configuration body."] - pub fn create(&self, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - body: body.into(), - } - } - #[doc = "Update the file upload storage account configuration"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `body`: File upload storage account configuration body."] - pub fn update(&self, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - 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 sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/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 = "Delete the file upload storage configuration."] - pub fn remove(&self) -> remove::RequestBuilder { - remove::RequestBuilder { client: self.0.clone() } - } } - pub mod get { + pub mod update_properties { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10377,9 +7680,9 @@ pub mod file_uploads { #[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::FileUpload = serde_json::from_slice(&bytes)?; + let body: models::DeviceProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10420,6 +7723,8 @@ pub mod file_uploads { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) device_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10431,32 +7736,33 @@ pub mod file_uploads { 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!("{}/fileUploads", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/properties", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -10467,7 +7773,7 @@ pub mod file_uploads { } } } - pub mod create { + pub mod list_relationships { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10476,9 +7782,9 @@ pub mod file_uploads { #[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::FileUpload = serde_json::from_slice(&bytes)?; + let body: models::DeviceRelationshipCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10519,7 +7825,7 @@ pub mod file_uploads { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) body: models::FileUpload, + pub(crate) device_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."] @@ -10531,33 +7837,32 @@ pub mod file_uploads { 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()), ); - 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!("{}/fileUploads", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/devices/{}/relationships", self.client.endpoint(), &self.device_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -10568,7 +7873,7 @@ pub mod file_uploads { } } } - pub mod update { + pub mod get_relationship { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10577,9 +7882,9 @@ pub mod file_uploads { #[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::FileUpload = serde_json::from_slice(&bytes)?; + let body: models::DeviceRelationship = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10620,7 +7925,8 @@ pub mod file_uploads { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) body: serde_json::Value, + pub(crate) device_id: String, + pub(crate) relationship_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."] @@ -10632,33 +7938,37 @@ pub mod file_uploads { 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::Get); let credential = this.client.token_credential(); 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!("{}/fileUploads", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/relationships/{}", + self.client.endpoint(), + &self.device_id, + &self.relationship_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -10669,7 +7979,7 @@ pub mod file_uploads { } } } - pub mod remove { + pub mod create_relationship { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10678,6 +7988,11 @@ pub mod file_uploads { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceRelationship = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -10716,6 +8031,9 @@ pub mod file_uploads { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) device_id: String, + pub(crate) relationship_id: String, + pub(crate) body: models::DeviceRelationship, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10727,115 +8045,49 @@ pub mod file_uploads { 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!("{}/fileUploads", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/relationships/{}", + self.client.endpoint(), + &self.device_id, + &self.relationship_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-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 = "Get the list of jobs in an application"] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - #[doc = "Get a job by ID"] - #[doc = "Get details about a running or completed job by job ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - pub fn get(&self, job_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - } - } - #[doc = "Execute a new job"] - #[doc = "Create and execute a new job via its job definition."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - #[doc = "* `body`: Job definition."] - pub fn create(&self, job_id: impl Into, body: impl Into) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - body: body.into(), - } - } - #[doc = "Get device statuses"] - #[doc = "Get the list of individual device statuses by job ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - pub fn get_devices(&self, job_id: impl Into) -> get_devices::RequestBuilder { - get_devices::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - } - } - #[doc = "Rerun a job on failed devices"] - #[doc = "Execute a rerun of an existing job on all failed devices."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - #[doc = "* `rerun_id`: Unique ID of the job rerun."] - pub fn rerun(&self, job_id: impl Into, rerun_id: impl Into) -> rerun::RequestBuilder { - rerun::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - rerun_id: rerun_id.into(), - } - } - #[doc = "Resume a stopped job"] - #[doc = "Resume execution of an existing stopped job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - pub fn resume(&self, job_id: impl Into) -> resume::RequestBuilder { - resume::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), - } - } - #[doc = "Stop a running job"] - #[doc = "Stop execution of a job that is currently running."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `job_id`: Unique ID of the job."] - pub fn stop(&self, job_id: impl Into) -> stop::RequestBuilder { - stop::RequestBuilder { - client: self.0.clone(), - job_id: job_id.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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_relationship { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10844,9 +8096,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::JobCollection = serde_json::from_slice(&bytes)?; + let body: models::DeviceRelationship = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10887,72 +8139,63 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) device_id: String, + pub(crate) relationship_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { - 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-06-30-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 + 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!("{}/jobs", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/relationships/{}", + self.client.endpoint(), + &self.device_id, + &self.relationship_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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 remove_relationship { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10961,11 +8204,6 @@ 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::Job = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -11004,7 +8242,8 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, + pub(crate) device_id: String, + pub(crate) relationship_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."] @@ -11016,7 +8255,7 @@ pub mod jobs { 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( @@ -11030,29 +8269,22 @@ pub mod jobs { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/jobs/{}", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/relationships/{}", + self.client.endpoint(), + &self.device_id, + &self.relationship_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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 { + pub mod get_telemetry_value { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11061,9 +8293,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::Job = serde_json::from_slice(&bytes)?; + let body: models::DeviceTelemetry = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11104,8 +8336,8 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, - pub(crate) body: models::Job, + pub(crate) device_id: String, + pub(crate) telemetry_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11117,33 +8349,37 @@ pub mod jobs { 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()), ); - 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!("{}/jobs/{}", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!( + "{}/devices/{}/telemetry/{}", + self.client.endpoint(), + &self.device_id, + &self.telemetry_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -11154,7 +8390,45 @@ pub mod jobs { } } } - pub mod get_devices { +} +pub mod file_uploads { + 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 = "Get the file upload storage account configuration."] + pub fn get(&self) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone() } + } + #[doc = "Create the file upload storage account configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `body`: File upload storage account configuration body."] + pub fn create(&self, body: impl Into) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + body: body.into(), + } + } + #[doc = "Update the file upload storage account configuration"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `body`: File upload storage account configuration body."] + pub fn update(&self, body: impl Into) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + body: body.into(), + } + } + #[doc = "Delete the file upload storage configuration."] + pub fn remove(&self) -> remove::RequestBuilder { + remove::RequestBuilder { client: self.0.clone() } + } + } + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11163,9 +8437,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::JobDeviceStatusCollection = serde_json::from_slice(&bytes)?; + let body: models::FileUpload = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11206,73 +8480,54 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, } impl RequestBuilder { - 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-06-30-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 + 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!("{}/jobs/{}/devices", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/fileUploads", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod rerun { + pub mod create { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11281,9 +8536,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::Job = serde_json::from_slice(&bytes)?; + let body: models::FileUpload = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11324,8 +8579,7 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, - pub(crate) rerun_id: String, + pub(crate) body: models::FileUpload, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11344,30 +8598,26 @@ pub mod jobs { 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!( - "{}/jobs/{}/rerun/{}", - self.client.endpoint(), - &self.job_id, - &self.rerun_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/fileUploads", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -11378,7 +8628,7 @@ pub mod jobs { } } } - pub mod resume { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11387,6 +8637,11 @@ 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::FileUpload = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -11425,7 +8680,7 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11437,32 +8692,44 @@ pub mod 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::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(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!("{}/jobs/{}/resume", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/fileUploads", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod stop { + pub mod remove { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11509,7 +8776,6 @@ pub mod jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) job_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."] @@ -11521,7 +8787,7 @@ pub mod 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( @@ -11529,25 +8795,24 @@ pub mod 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!("{}/jobs/{}/stop", self.client.endpoint(), &self.job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/fileUploads", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } } } -pub mod organizations { +pub mod jobs { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11555,52 +8820,78 @@ pub mod organizations { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of organizations the user has access to in an application"] + #[doc = "Get the list of jobs in an application"] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } - #[doc = "Get an organization by ID"] + #[doc = "Get a job by ID"] + #[doc = "Get details about a running or completed job by job ID."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `organization_id`: Unique ID of the organization."] - pub fn get(&self, organization_id: impl Into) -> get::RequestBuilder { + #[doc = "* `job_id`: Unique ID of the job."] + pub fn get(&self, job_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - organization_id: organization_id.into(), + job_id: job_id.into(), } } - #[doc = "Create an organization in the application"] + #[doc = "Execute a new job"] + #[doc = "Create and execute a new job via its job definition."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `organization_id`: Unique ID of the organization."] - #[doc = "* `body`: Organization body."] - pub fn create(&self, organization_id: impl Into, body: impl Into) -> create::RequestBuilder { + #[doc = "* `job_id`: Unique ID of the job."] + #[doc = "* `body`: Job definition."] + pub fn create(&self, job_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - organization_id: organization_id.into(), + job_id: job_id.into(), body: body.into(), } } - #[doc = "Update an organization in the application via patch"] + #[doc = "Get device statuses"] + #[doc = "Get the list of individual device statuses by job ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `job_id`: Unique ID of the job."] + pub fn get_devices(&self, job_id: impl Into) -> get_devices::RequestBuilder { + get_devices::RequestBuilder { + client: self.0.clone(), + job_id: job_id.into(), + } + } + #[doc = "Rerun a job on failed devices"] + #[doc = "Execute a rerun of an existing job on all failed devices."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `job_id`: Unique ID of the job."] + #[doc = "* `rerun_id`: Unique ID of the job rerun."] + pub fn rerun(&self, job_id: impl Into, rerun_id: impl Into) -> rerun::RequestBuilder { + rerun::RequestBuilder { + client: self.0.clone(), + job_id: job_id.into(), + rerun_id: rerun_id.into(), + } + } + #[doc = "Resume a stopped job"] + #[doc = "Resume execution of an existing stopped job."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `organization_id`: Unique ID of the organization."] - #[doc = "* `body`: Organization patch body."] - pub fn update(&self, organization_id: impl Into, body: impl Into) -> update::RequestBuilder { - update::RequestBuilder { + #[doc = "* `job_id`: Unique ID of the job."] + pub fn resume(&self, job_id: impl Into) -> resume::RequestBuilder { + resume::RequestBuilder { client: self.0.clone(), - organization_id: organization_id.into(), - body: body.into(), + job_id: job_id.into(), } } - #[doc = "Delete an organization"] + #[doc = "Stop a running job"] + #[doc = "Stop execution of a job that is currently running."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `organization_id`: Unique ID of the organization."] - pub fn remove(&self, organization_id: impl Into) -> remove::RequestBuilder { - remove::RequestBuilder { + #[doc = "* `job_id`: Unique ID of the job."] + pub fn stop(&self, job_id: impl Into) -> stop::RequestBuilder { + stop::RequestBuilder { client: self.0.clone(), - organization_id: organization_id.into(), + job_id: job_id.into(), } } } @@ -11613,9 +8904,9 @@ pub mod organizations { #[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::OrganizationCollection = serde_json::from_slice(&bytes)?; + let body: models::JobCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11658,7 +8949,7 @@ pub mod organizations { pub(crate) client: super::super::Client, } impl RequestBuilder { - 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 { @@ -11679,7 +8970,7 @@ pub mod organizations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -11711,11 +9002,11 @@ pub mod organizations { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/organizations", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -11730,9 +9021,9 @@ pub mod organizations { #[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::Organization = serde_json::from_slice(&bytes)?; + let body: models::Job = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11773,7 +9064,7 @@ pub mod organizations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) organization_id: String, + pub(crate) job_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."] @@ -11799,18 +9090,18 @@ pub mod organizations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_id))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}", self.client.endpoint(), &self.job_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -11830,9 +9121,9 @@ pub mod organizations { #[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::Organization = serde_json::from_slice(&bytes)?; + let body: models::Job = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11873,8 +9164,8 @@ pub mod organizations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) organization_id: String, - pub(crate) body: models::Organization, + pub(crate) job_id: String, + pub(crate) body: models::Job, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11901,18 +9192,18 @@ pub mod organizations { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_id))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}", self.client.endpoint(), &self.job_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -11923,7 +9214,7 @@ pub mod organizations { } } } - pub mod update { + pub mod get_devices { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11932,9 +9223,9 @@ pub mod organizations { #[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::Organization = serde_json::from_slice(&bytes)?; + let body: models::JobDeviceStatusCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11975,160 +9266,73 @@ pub mod organizations { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) organization_id: String, - pub(crate) body: serde_json::Value, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::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!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-06-30-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use 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) organization_id: String, + pub(crate) job_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({ + 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, "1.2-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 } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-06-30-preview"); - } - Ok(url) - } - } - } -} -pub mod query { - 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 = "Run a query and obtain the result"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `body`: query, more details on [IoT central query language](https://aka.ms/iotcql)."] - pub fn run(&self, body: impl Into) -> run::RequestBuilder { - run::RequestBuilder { - client: self.0.clone(), - body: body.into(), + }; + azure_core::Pageable::new(make_request) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}/devices", self.client.endpoint(), &self.job_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, "1.2-preview"); + } + Ok(url) } } } - pub mod run { + pub mod rerun { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12137,9 +9341,9 @@ pub mod query { #[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::QueryResponse = serde_json::from_slice(&bytes)?; + let body: models::Job = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12180,7 +9384,8 @@ pub mod query { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) body: models::QueryRequest, + pub(crate) job_id: String, + pub(crate) rerun_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."] @@ -12192,33 +9397,37 @@ pub mod query { 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()), ); - 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!("{}/query", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/jobs/{}/rerun/{}", + self.client.endpoint(), + &self.job_id, + &self.rerun_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -12229,31 +9438,7 @@ pub mod query { } } } -} -pub mod roles { - 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 = "Get the list of roles in an application."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - #[doc = "Get a role by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `role_id`: Unique ID for the role."] - pub fn get(&self, role_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - role_id: role_id.into(), - } - } - } - pub mod list { + pub mod resume { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12262,11 +9447,6 @@ pub mod roles { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RoleCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -12305,72 +9485,44 @@ pub mod roles { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) job_id: String, } impl RequestBuilder { - 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-06-30-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 + 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?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/roles", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}/resume", self.client.endpoint(), &self.job_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } } - pub mod get { + pub mod stop { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12379,11 +9531,6 @@ pub mod roles { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Role = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -12422,7 +9569,7 @@ pub mod roles { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) role_id: String, + pub(crate) job_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."] @@ -12434,7 +9581,7 @@ pub mod roles { 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( @@ -12442,36 +9589,25 @@ pub mod roles { 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!("{}/roles/{}", self.client.endpoint(), &self.role_id))?; + let mut url = azure_core::Url::parse(&format!("{}/jobs/{}/stop", self.client.endpoint(), &self.job_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod scheduled_jobs { +pub mod organizations { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12479,66 +9615,52 @@ pub mod scheduled_jobs { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of scheduled job definitions in an application"] + #[doc = "Get the list of organizations the user has access to in an application"] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } - #[doc = "Get a scheduled job by ID"] - #[doc = "Get details about a scheduled job by ID."] + #[doc = "Get an organization by ID"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - pub fn get(&self, scheduled_job_id: impl Into) -> get::RequestBuilder { + #[doc = "* `organization_id`: Unique ID of the organization."] + pub fn get(&self, organization_id: impl Into) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), + organization_id: organization_id.into(), } } - #[doc = "Create or update a scheduled job"] - #[doc = "Create or update a scheduled job by ID."] + #[doc = "Create an organization in the application"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - #[doc = "* `body`: Scheduled job definition."] - pub fn create(&self, scheduled_job_id: impl Into, body: impl Into) -> create::RequestBuilder { + #[doc = "* `organization_id`: Unique ID of the organization."] + #[doc = "* `body`: Organization body."] + pub fn create(&self, organization_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), + organization_id: organization_id.into(), body: body.into(), } } - #[doc = "Update a scheduled job via patch"] - #[doc = "Update an existing scheduled job by ID."] + #[doc = "Update an organization in the application via patch"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - #[doc = "* `body`: Scheduled job patch."] - pub fn update(&self, scheduled_job_id: impl Into, body: impl Into) -> update::RequestBuilder { + #[doc = "* `organization_id`: Unique ID of the organization."] + #[doc = "* `body`: Organization patch body."] + pub fn update(&self, organization_id: impl Into, body: impl Into) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), + organization_id: organization_id.into(), body: body.into(), } } - #[doc = "Delete a scheduled job"] - #[doc = "Delete an existing scheduled job by ID."] + #[doc = "Delete an organization"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - pub fn remove(&self, scheduled_job_id: impl Into) -> remove::RequestBuilder { + #[doc = "* `organization_id`: Unique ID of the organization."] + pub fn remove(&self, organization_id: impl Into) -> remove::RequestBuilder { remove::RequestBuilder { client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), - } - } - #[doc = "Get the list of jobs for a scheduled job definition"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scheduled_job_id`: Unique ID of the scheduled job."] - pub fn list_jobs(&self, scheduled_job_id: impl Into) -> list_jobs::RequestBuilder { - list_jobs::RequestBuilder { - client: self.0.clone(), - scheduled_job_id: scheduled_job_id.into(), + organization_id: organization_id.into(), } } } @@ -12551,9 +9673,9 @@ pub mod scheduled_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::ScheduledJobCollection = serde_json::from_slice(&bytes)?; + let body: models::OrganizationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12596,7 +9718,7 @@ pub mod scheduled_jobs { pub(crate) client: super::super::Client, } impl RequestBuilder { - 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 { @@ -12617,7 +9739,7 @@ pub mod scheduled_jobs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -12645,21 +9767,121 @@ pub mod scheduled_jobs { }; rsp?.into_body().await } - }; - azure_core::Pageable::new(make_request) + }; + azure_core::Pageable::new(make_request) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!("{}/organizations", 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, "1.2-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::Organization = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization_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!("{}/scheduledJobs", self.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/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 create { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12668,9 +9890,9 @@ pub mod scheduled_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::ScheduledJob = serde_json::from_slice(&bytes)?; + let body: models::Organization = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12711,7 +9933,8 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, + pub(crate) organization_id: String, + pub(crate) body: models::Organization, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12723,32 +9946,33 @@ pub mod scheduled_jobs { 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!("{}/scheduledJobs/{}", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -12759,7 +9983,7 @@ pub mod scheduled_jobs { } } } - pub mod create { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12768,9 +9992,9 @@ pub mod scheduled_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::ScheduledJob = serde_json::from_slice(&bytes)?; + let body: models::Organization = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12811,8 +10035,8 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, - pub(crate) body: models::ScheduledJob, + pub(crate) organization_id: String, + pub(crate) body: serde_json::Value, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12824,7 +10048,7 @@ pub mod scheduled_jobs { 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( @@ -12839,18 +10063,18 @@ pub mod scheduled_jobs { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/scheduledJobs/{}", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -12861,7 +10085,7 @@ pub mod scheduled_jobs { } } } - pub mod update { + pub mod remove { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12870,11 +10094,6 @@ pub mod scheduled_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::ScheduledJob = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -12913,8 +10132,7 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, - pub(crate) body: serde_json::Value, + pub(crate) organization_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."] @@ -12926,44 +10144,51 @@ pub mod scheduled_jobs { 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/merge-patch+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!("{}/scheduledJobs/{}", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/organizations/{}", self.client.endpoint(), &self.organization_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod query { + 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 = "Run a query and obtain the result"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `body`: query, more details on [IoT central query language](https://aka.ms/iotcql)."] + pub fn run(&self, body: impl Into) -> run::RequestBuilder { + run::RequestBuilder { + client: self.0.clone(), + body: body.into(), } } } - pub mod remove { + pub mod run { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12972,6 +10197,11 @@ pub mod scheduled_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::QueryResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -13010,7 +10240,7 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, + pub(crate) body: models::QueryRequest, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13022,31 +10252,68 @@ pub mod scheduled_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::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!("{}/scheduledJobs/{}", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/query", 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, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod roles { + 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 = "Get the list of roles in an application."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + #[doc = "Get a role by ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `role_id`: Unique ID for the role."] + pub fn get(&self, role_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + role_id: role_id.into(), + } + } } - pub mod list_jobs { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13055,9 +10322,9 @@ pub mod scheduled_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::JobCollection = serde_json::from_slice(&bytes)?; + let body: models::RoleCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13098,10 +10365,9 @@ pub mod scheduled_jobs { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) scheduled_job_id: String, } impl RequestBuilder { - 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 { @@ -13122,7 +10388,7 @@ pub mod scheduled_jobs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -13154,15 +10420,115 @@ pub mod scheduled_jobs { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!("{}/scheduledJobs/{}/jobs", self.client.endpoint(), &self.scheduled_job_id))?; + let mut url = azure_core::Url::parse(&format!("{}/roles", 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, "1.2-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::Role = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) role_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!("{}/roles/{}", self.client.endpoint(), &self.role_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-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } pub mod users { @@ -13192,7 +10558,7 @@ pub mod users { #[doc = "Arguments:"] #[doc = "* `user_id`: Unique ID of the user."] #[doc = "* `body`: User body."] - pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { + pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), user_id: user_id.into(), @@ -13297,7 +10663,7 @@ pub mod users { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -13333,7 +10699,7 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } @@ -13348,9 +10714,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13421,14 +10787,14 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -13448,9 +10814,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13492,7 +10858,7 @@ pub mod users { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) user_id: String, - pub(crate) body: models::User, + pub(crate) body: models::UserUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13523,14 +10889,14 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -13550,9 +10916,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13625,14 +10991,14 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } 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`."] @@ -13720,7 +11086,7 @@ pub mod users { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-06-30-preview"); + .append_pair(azure_core::query_param::API_VERSION, "1.2-preview"); } Ok(url) } diff --git a/services/svc/iotcentral/src/package_2022_06_30_preview/models.rs b/services/svc/iotcentral/src/package_1_2_preview/models.rs similarity index 53% rename from services/svc/iotcentral/src/package_2022_06_30_preview/models.rs rename to services/svc/iotcentral/src/package_1_2_preview/models.rs index f03351f63a..d08d4e071b 100644 --- a/services/svc/iotcentral/src/package_2022_06_30_preview/models.rs +++ b/services/svc/iotcentral/src/package_1_2_preview/models.rs @@ -32,7 +32,7 @@ impl AnyValue { Self::default() } } -#[doc = "The access token definition."] +#[doc = "The access token definition for public API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiToken { #[serde(flatten)] @@ -57,7 +57,6 @@ impl ApiToken { } } } -#[doc = "The paged results of API tokens."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiTokenCollection { #[doc = "The collection of API tokens."] @@ -77,7 +76,7 @@ impl ApiTokenCollection { Self { value, next_link: None } } } -#[doc = "The attestation definition."] +#[doc = "The device attestation information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Attestation { #[doc = "Type of the attestation."] @@ -89,54 +88,33 @@ impl Attestation { Self { type_ } } } -#[doc = "Configuration specifying options for a bar chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BarChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying formatting options for a chart tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, -} -impl BarChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - format: None, - query_range, - } - } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AttestationUnion { + #[serde(rename = "symmetricKey")] + SymmetricKey(SymmetricKeyAttestation), + #[serde(rename = "tpm")] + Tpm(TpmAttestation), + #[serde(rename = "x509")] + X509(X509Attestation), } -#[doc = "The blob storage destination definition."] +#[doc = "The blob storage destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BlobStorageV1Destination { #[serde(flatten)] pub destination: Destination, - #[doc = "The authentication definition for blob storage destination."] - pub authorization: BlobStorageV1DestinationAuth, + #[doc = "The authentication definition of blob storage destination."] + pub authorization: BlobStorageV1DestinationAuthUnion, } impl BlobStorageV1Destination { - pub fn new(destination: Destination, authorization: BlobStorageV1DestinationAuth) -> Self { + pub fn new(destination: Destination, authorization: BlobStorageV1DestinationAuthUnion) -> Self { Self { destination, authorization, } } } -#[doc = "The authentication definition for blob storage destination."] +#[doc = "The authentication definition of blob storage destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BlobStorageV1DestinationAuth { #[doc = "The kind of authentication to use."] @@ -148,7 +126,15 @@ impl BlobStorageV1DestinationAuth { Self { type_ } } } -#[doc = "The authentication definition with connection string for blob storage destination."] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum BlobStorageV1DestinationAuthUnion { + #[serde(rename = "connectionString")] + ConnectionString(BlobStorageV1DestinationConnectionStringAuth), + #[serde(rename = "systemAssignedManagedIdentity")] + SystemAssignedManagedIdentity(BlobStorageV1DestinationSystemAssignedManagedIdentityAuth), +} +#[doc = "The authentication definition with connection string of blob storage destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BlobStorageV1DestinationConnectionStringAuth { #[serde(flatten)] @@ -169,7 +155,7 @@ impl BlobStorageV1DestinationConnectionStringAuth { } } } -#[doc = "The authentication definition with system assigned managed identity for blob storage destination."] +#[doc = "The authentication definition with system assigned managed identity of blob storage destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BlobStorageV1DestinationSystemAssignedManagedIdentityAuth { #[serde(flatten)] @@ -190,25 +176,6 @@ impl BlobStorageV1DestinationSystemAssignedManagedIdentityAuth { } } } -#[doc = "The type of aggregation to be applied on capability data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub enum CapabilityAggregateFunctionType { - #[serde(rename = "sum")] - Sum, - #[serde(rename = "count")] - Count, - #[serde(rename = "max")] - Max, - #[serde(rename = "min")] - Min, - #[serde(rename = "avg")] - Avg, -} -impl Default for CapabilityAggregateFunctionType { - fn default() -> Self { - Self::Count - } -} #[doc = "The capability job data definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CapabilityJobData { @@ -225,25 +192,7 @@ impl CapabilityJobData { Self { target, path, value: None } } } -#[doc = "Configuration specifying formatting options for a chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ChartFormatConfiguration { - #[doc = "Whether to display the x-axis"] - #[serde(rename = "xAxisEnabled", default, skip_serializing_if = "Option::is_none")] - pub x_axis_enabled: Option, - #[doc = "Whether to display the y-axis"] - #[serde(rename = "yAxisEnabled", default, skip_serializing_if = "Option::is_none")] - pub y_axis_enabled: Option, - #[doc = "Whether to display the legend"] - #[serde(rename = "legendEnabled", default, skip_serializing_if = "Option::is_none")] - pub legend_enabled: Option, -} -impl ChartFormatConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The cloud property job data."] +#[doc = "The cloud property job data definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CloudPropertyJobData { #[serde(flatten)] @@ -259,7 +208,6 @@ impl CloudPropertyJobData { } } } -#[doc = "The collection of entities."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Collection { #[doc = "The collection of entities."] @@ -273,25 +221,6 @@ impl Collection { Self { value, next_link: None } } } -#[doc = "Configuration specifying options for a command tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommandConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The device id that the command is associated with"] - pub device: String, - #[doc = "The command id to associate the tile to"] - pub command: String, -} -impl CommandConfiguration { - pub fn new(tile_configuration: TileConfiguration, device: String, command: String) -> Self { - Self { - tile_configuration, - device, - command, - } - } -} #[doc = "The command job data definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CommandJobData { @@ -308,131 +237,7 @@ impl CommandJobData { } } } -#[doc = "Configuration specifying options for a command tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommandTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The ID of the device group to display"] - pub group: String, - #[doc = "The command to reference in the tile"] - pub command: String, - #[doc = "The device to reference in the tile"] - pub device: serde_json::Value, -} -impl CommandTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, group: String, command: String, device: serde_json::Value) -> Self { - Self { - tile_configuration, - group, - command, - device, - } - } -} -#[doc = "Configuration specifying the number of data points to query for a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CountQueryRangeConfiguration { - #[serde(flatten)] - pub query_range_configuration: QueryRangeConfiguration, - #[doc = "The maximum number of data points to query for."] - pub count: i64, -} -impl CountQueryRangeConfiguration { - pub fn new(query_range_configuration: QueryRangeConfiguration, count: i64) -> Self { - Self { - query_range_configuration, - count, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Dashboard { - #[doc = "Unique ID of the dashboard."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the dashboard."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "The tiles displayed by the dashboard."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub tiles: Vec, - #[doc = "Whether the dashboard is personal and can only be viewed by the current user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub personal: Option, - #[doc = "Whether the dashboard is favorited or not"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub favorite: Option, - #[doc = "Etag to prevent conflict when updating the dashboard."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "The organization the dashboard belongs to. If not present, the dashboard is root-level or personal. only one organization is supported today, multiple organizations will be supported soon."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub organizations: Vec, -} -impl Dashboard { - pub fn new(display_name: String) -> Self { - Self { - id: None, - display_name, - tiles: Vec::new(), - personal: None, - favorite: None, - etag: None, - organizations: Vec::new(), - } - } -} -#[doc = "The paged results of dashboards."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DashboardCollection { - #[doc = "The collection of dashboards."] - pub value: Vec, - #[doc = "URL to get the next page of dashboards."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DashboardCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DashboardCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "Configuration specifying options for an image tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataExplorerTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "The id of the Data Explorer query to show in the tile"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option, -} -impl DataExplorerTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, query_range: TimeQueryRangeConfiguration) -> Self { - Self { - tile_configuration, - query_range, - query: None, - } - } -} -#[doc = "The azure data explorer destination definition."] +#[doc = "The azure data explorer destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataExplorerV1Destination { #[serde(flatten)] @@ -444,8 +249,8 @@ pub struct DataExplorerV1Destination { pub database: String, #[doc = "The table within the Data Explorer database that will receive the data."] pub table: String, - #[doc = "The authentication definition for azure data explorer destination."] - pub authorization: DataExplorerV1DestinationAuth, + #[doc = "The authentication definition of azure data explorer destination."] + pub authorization: DataExplorerV1DestinationAuthUnion, } impl DataExplorerV1Destination { pub fn new( @@ -453,7 +258,7 @@ impl DataExplorerV1Destination { cluster_url: String, database: String, table: String, - authorization: DataExplorerV1DestinationAuth, + authorization: DataExplorerV1DestinationAuthUnion, ) -> Self { Self { destination, @@ -464,7 +269,7 @@ impl DataExplorerV1Destination { } } } -#[doc = "The authentication definition for azure data explorer destination."] +#[doc = "The authentication definition of azure data explorer destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataExplorerV1DestinationAuth { #[doc = "The kind of authentication to use."] @@ -476,7 +281,15 @@ impl DataExplorerV1DestinationAuth { Self { type_ } } } -#[doc = "The authentication definition with service principal for azure data explorer destination."] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DataExplorerV1DestinationAuthUnion { + #[serde(rename = "servicePrincipal")] + ServicePrincipal(DataExplorerV1DestinationServicePrincipalAuth), + #[serde(rename = "systemAssignedManagedIdentity")] + SystemAssignedManagedIdentity(DataExplorerV1DestinationSystemAssignedManagedIdentityAuth), +} +#[doc = "The authentication definition with service principal of azure data explorer destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataExplorerV1DestinationServicePrincipalAuth { #[serde(flatten)] @@ -506,7 +319,7 @@ impl DataExplorerV1DestinationServicePrincipalAuth { } } } -#[doc = "The authentication definition with system assigned managed identity for azure data explorer destination."] +#[doc = "The authentication definition with system assigned managed identity of azure data explorer destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataExplorerV1DestinationSystemAssignedManagedIdentityAuth { #[serde(flatten)] @@ -519,7 +332,6 @@ impl DataExplorerV1DestinationSystemAssignedManagedIdentityAuth { } } } -#[doc = "The data export error definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataExportError { #[doc = "The code for the error that occurred."] @@ -556,19 +368,6 @@ impl DataExportStatus { Self::default() } } -#[doc = "The date based end definition of job schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DateJobScheduleEnd { - #[serde(flatten)] - pub job_schedule_end: JobScheduleEnd, - #[doc = "The date when to end the scheduled job."] - pub date: String, -} -impl DateJobScheduleEnd { - pub fn new(job_schedule_end: JobScheduleEnd, date: String) -> Self { - Self { job_schedule_end, date } - } -} #[doc = "The destination definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Destination { @@ -594,11 +393,26 @@ impl Destination { } } } -#[doc = "The paged results of destinations."] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum DestinationUnion { + #[serde(rename = "blobstorage@v1")] + BlobstorageV1(BlobStorageV1Destination), + #[serde(rename = "dataexplorer@v1")] + DataexplorerV1(DataExplorerV1Destination), + #[serde(rename = "eventhubs@v1")] + EventhubsV1(EventHubsV1Destination), + #[serde(rename = "servicebusqueue@v1")] + ServicebusqueueV1(ServiceBusQueueV1Destination), + #[serde(rename = "servicebustopic@v1")] + ServicebustopicV1(ServiceBusTopicV1Destination), + #[serde(rename = "webhook@v1")] + WebhookV1(WebhookV1Destination), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DestinationCollection { #[doc = "The collection of destinations."] - pub value: Vec, + pub value: Vec, #[doc = "URL to get the next page of destinations."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -610,7 +424,7 @@ impl azure_core::Continuable for DestinationCollection { } } impl DestinationCollection { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value, next_link: None } } } @@ -666,7 +480,7 @@ pub struct Device { #[doc = "Whether the device is simulated."] #[serde(default, skip_serializing_if = "Option::is_none")] pub simulated: Option, - #[doc = "List of organization IDs that the device is a part of, only one organization is supported today, multiple organizations will be supported soon."] + #[doc = "List of organization IDs that the device is a part of."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", @@ -679,7 +493,6 @@ impl Device { Self::default() } } -#[doc = "The paged results of devices."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceCollection { #[doc = "The collection of devices."] @@ -711,10 +524,10 @@ pub struct DeviceCommand { #[doc = "Response timeout in seconds to wait for a command completion on a device. Defaults to 30 seconds."] #[serde(rename = "responseTimeout", default, skip_serializing_if = "Option::is_none")] pub response_timeout: Option, - #[doc = "The payload for the device command, support any primitive types or object."] + #[doc = "The payload for the device command."] #[serde(default, skip_serializing_if = "Option::is_none")] pub request: Option, - #[doc = "The payload of the device command response, support any primitive types or object."] + #[doc = "The payload of the device command response."] #[serde(default, skip_serializing_if = "Option::is_none")] pub response: Option, #[doc = "The status code of the device command response."] @@ -726,7 +539,6 @@ impl DeviceCommand { Self::default() } } -#[doc = "The paged results of device command executions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceCommandCollection { #[doc = "The collection of device command executions."] @@ -746,27 +558,6 @@ impl DeviceCommandCollection { Self { value, next_link: None } } } -#[doc = "Configuration specifying options for a device count tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceCountTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The ID of the device group to display"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group: Option, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl DeviceCountTileConfiguration { - pub fn new(tile_configuration: TileConfiguration) -> Self { - Self { - tile_configuration, - group: None, - format: None, - } - } -} #[doc = "The device credentials definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceCredentials { @@ -810,7 +601,7 @@ pub struct DeviceGroup { #[doc = "ETag used to prevent conflict in device group updates."] #[serde(default, skip_serializing_if = "Option::is_none")] pub etag: Option, - #[doc = "List of organization IDs of the device group, only one organization is supported today, multiple organizations will be supported soon."] + #[doc = "List of organization IDs of the device group."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", @@ -830,7 +621,6 @@ impl DeviceGroup { } } } -#[doc = "The paged results of device groups."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceGroupCollection { #[doc = "The collection of device groups."] @@ -850,26 +640,6 @@ impl DeviceGroupCollection { Self { value, next_link: None } } } -#[doc = "The paged results of devices belonging to the device group."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceGroupDeviceCollection { - #[doc = "The collection of devices belonging to the device group."] - pub value: Vec, - #[doc = "URL to get the next page of devices in the group."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DeviceGroupDeviceCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DeviceGroupDeviceCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} #[doc = "Property values associated with the device."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeviceProperties {} @@ -884,6 +654,9 @@ pub struct DeviceRelationship { #[doc = "The unique identifier of this relationship."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, + #[doc = "The name which describes this relationship between given devices from source device template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, #[doc = "The device ID of the source (parent) device."] #[serde(default, skip_serializing_if = "Option::is_none")] pub source: Option, @@ -896,7 +669,6 @@ impl DeviceRelationship { Self::default() } } -#[doc = "The paged results of device relationships."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceRelationshipCollection { #[doc = "The collection of device relationships."] @@ -963,7 +735,6 @@ impl DeviceTemplate { } } } -#[doc = "The paged results of device templates."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceTemplateCollection { #[doc = "The collection of device templates."] @@ -1027,75 +798,12 @@ impl Enrichment { Self::default() } } -#[doc = "The enrollment group definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnrollmentGroup { - #[doc = "Unique ID of the enrollment group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the enrollment group."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "Whether the devices using the group are allowed to connect to IoT Central."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "Type of devices that connect through the group."] - #[serde(rename = "type")] - pub type_: enrollment_group::Type, - #[doc = "The attestation definition for an enrollment group."] - pub attestation: GroupAttestation, - #[doc = "ETag used to prevent conflict in enrollment group updates."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, -} -impl EnrollmentGroup { - pub fn new(display_name: String, type_: enrollment_group::Type, attestation: GroupAttestation) -> Self { - Self { - id: None, - display_name, - enabled: None, - type_, - attestation, - etag: None, - } - } -} -pub mod enrollment_group { - use super::*; - #[doc = "Type of devices that connect through the group."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "iot")] - Iot, - #[serde(rename = "iotEdge")] - IotEdge, - } -} -#[doc = "The paged results of enrollment groups."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnrollmentGroupCollection { - #[doc = "The collection of enrollment groups."] - pub value: Vec, - #[doc = "URL to get the next page of enrollment groups."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for EnrollmentGroupCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl EnrollmentGroupCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The response error definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[doc = "The error model definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Error { - #[doc = "The detail information of the error."] - pub error: ErrorDetails, + #[doc = "The error details definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, } impl azure_core::Continuable for Error { type Continuation = String; @@ -1104,102 +812,41 @@ impl azure_core::Continuable for Error { } } impl Error { - pub fn new(error: ErrorDetails) -> Self { - Self { error } + pub fn new() -> Self { + Self::default() } } -#[doc = "The detail information of the error."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[doc = "The error details definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ErrorDetails { #[doc = "Error code."] - pub code: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, #[doc = "Error message details."] - pub message: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, #[doc = "Correlation Id for current request."] #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] pub request_id: Option, - #[doc = "The time that error request failed."] - #[serde(default, with = "azure_core::date::rfc1123::option")] - pub time: Option, -} -impl ErrorDetails { - pub fn new(code: String, message: String) -> Self { - Self { - code, - message, - request_id: None, - time: None, - } - } -} -#[doc = "Configuration specifying options for a event chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, -} -impl EventChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - } - } -} -#[doc = "Configuration specifying options for a event history chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventHistoryChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a text based tile."] + #[doc = "The time that request failed."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, + pub time: Option, } -impl EventHistoryChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } +impl ErrorDetails { + pub fn new() -> Self { + Self::default() } } -#[doc = "the event hub destination definition."] +#[doc = "The event hub destination definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventHubsV1Destination { #[serde(flatten)] pub destination: Destination, #[doc = "The authentication definition for event hub destination."] - pub authorization: EventHubsV1DestinationAuth, + pub authorization: EventHubsV1DestinationAuthUnion, } impl EventHubsV1Destination { - pub fn new(destination: Destination, authorization: EventHubsV1DestinationAuth) -> Self { + pub fn new(destination: Destination, authorization: EventHubsV1DestinationAuthUnion) -> Self { Self { destination, authorization, @@ -1218,6 +865,14 @@ impl EventHubsV1DestinationAuth { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EventHubsV1DestinationAuthUnion { + #[serde(rename = "connectionString")] + ConnectionString(EventHubsV1DestinationConnectionStringAuth), + #[serde(rename = "systemAssignedManagedIdentity")] + SystemAssignedManagedIdentity(EventHubsV1DestinationSystemAssignedManagedIdentityAuth), +} #[doc = "The authentication definition with connection string for event hub destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventHubsV1DestinationConnectionStringAuth { @@ -1311,7 +966,6 @@ pub mod export { DeviceConnectivity, } } -#[doc = "The paged results of exports."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExportCollection { #[doc = "The collection of exports."] @@ -1348,24 +1002,7 @@ impl ExportDestination { } } } -#[doc = "Configuration specifying options for an external content tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExternalContentTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "URL of the website to render inside the tile. Must be a valid HTTPS URL."] - #[serde(rename = "sourceUrl")] - pub source_url: String, -} -impl ExternalContentTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, source_url: String) -> Self { - Self { - tile_configuration, - source_url, - } - } -} -#[doc = "The file upload configuration definition."] +#[doc = "The file upload configuration for application."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FileUpload { #[doc = "The storage account name where to upload the file to"] @@ -1415,230 +1052,55 @@ pub mod file_upload { Failed, } } -#[doc = "The attestation definition for an enrollment group."] +#[doc = "The job definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupAttestation { - #[doc = "Type of the attestation."] - #[serde(rename = "type")] - pub type_: String, +pub struct Job { + #[doc = "Unique ID of the job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Display name of the job."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Detailed description of the job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The ID of the device group on which to execute the job."] + pub group: String, + #[doc = "The job batch definition for job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub batch: Option, + #[doc = "The job cancellation threshold definition for job."] + #[serde(rename = "cancellationThreshold", default, skip_serializing_if = "Option::is_none")] + pub cancellation_threshold: Option, + #[doc = "The capabilities being updated by the job and the values with which they are being updated."] + pub data: Vec, + #[doc = "Indicates whether the job is starting, running, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "List of organizations of the job."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub organizations: Vec, } -impl GroupAttestation { - pub fn new(type_: String) -> Self { - Self { type_ } +impl Job { + pub fn new(group: String, data: Vec) -> Self { + Self { + id: None, + display_name: None, + description: None, + group, + batch: None, + cancellation_threshold: None, + data, + status: None, + organizations: Vec::new(), + } } } -#[doc = "The symmetric key attestation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupSymmetricKeyAttestation { - #[serde(flatten)] - pub group_attestation: GroupAttestation, - #[doc = "The symmetric key definition."] - #[serde(rename = "symmetricKey", default, skip_serializing_if = "Option::is_none")] - pub symmetric_key: Option, -} -impl GroupSymmetricKeyAttestation { - pub fn new(group_attestation: GroupAttestation) -> Self { - Self { - group_attestation, - symmetric_key: None, - } - } -} -#[doc = "Configuration specifying a set of devices to display data for in a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupTileConfiguration { - #[doc = "The ID of the device group to display"] - pub group: String, - #[doc = "The list of associated devices to display"] - pub devices: Vec, -} -impl GroupTileConfiguration { - pub fn new(group: String, devices: Vec) -> Self { - Self { group, devices } - } -} -#[doc = "The X509 attestation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupX509Attestation { - #[serde(flatten)] - pub group_attestation: GroupAttestation, - #[doc = "The X509 definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub x509: Option, -} -impl GroupX509Attestation { - pub fn new(group_attestation: GroupAttestation) -> Self { - Self { - group_attestation, - x509: None, - } - } -} -#[doc = "Configuration specifying options for a heat map tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HeatMapConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a chart tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl HeatMapConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} -#[doc = "Configuration specifying options for an image tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The asset id of the image to display"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, - #[doc = "The URL the tile links to when clicked"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub href: Option, - #[doc = "Format options for the image tile"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl ImageTileConfiguration { - pub fn new(tile_configuration: TileConfiguration) -> Self { - Self { - tile_configuration, - image: None, - href: None, - format: None, - } - } -} -pub mod image_tile_configuration { - use super::*; - #[doc = "Format options for the image tile"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Format { - #[doc = "The background color to show behind the image"] - #[serde(rename = "backgroundColor", default, skip_serializing_if = "Option::is_none")] - pub background_color: Option, - #[doc = "Whether to stretch the image to fit the aspect ratio of the tile or display in the image's native aspect ratio"] - #[serde(rename = "fitImage", default, skip_serializing_if = "Option::is_none")] - pub fit_image: Option, - #[doc = "The color of the text in the tile"] - #[serde(rename = "textColor", default, skip_serializing_if = "Option::is_none")] - pub text_color: Option, - #[doc = "Size of the test in the tile"] - #[serde(rename = "textSize", default, skip_serializing_if = "Option::is_none")] - pub text_size: Option, - #[doc = "The unit of size for the text in the tile"] - #[serde(rename = "textSizeUnit", default, skip_serializing_if = "Option::is_none")] - pub text_size_unit: Option, - #[doc = "Whether or not to show the display name text on the tile"] - #[serde(rename = "showTitle", default, skip_serializing_if = "Option::is_none")] - pub show_title: Option, - } - impl Format { - pub fn new() -> Self { - Self::default() - } - } - pub mod format { - use super::*; - #[doc = "The unit of size for the text in the tile"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TextSizeUnit { - #[serde(rename = "px")] - Px, - } - impl Default for TextSizeUnit { - fn default() -> Self { - Self::Px - } - } - } -} -#[doc = "The job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Job { - #[doc = "Unique ID of the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Id of the scheduled job definition that created this job."] - #[serde(rename = "scheduledJobId", default, skip_serializing_if = "Option::is_none")] - pub scheduled_job_id: Option, - #[doc = "Display name of the job."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Detailed description of the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The ID of the device group on which to execute the job."] - pub group: String, - #[doc = "The job batch definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub batch: Option, - #[doc = "The job cancellation threshold definition."] - #[serde(rename = "cancellationThreshold", default, skip_serializing_if = "Option::is_none")] - pub cancellation_threshold: Option, - #[doc = "The capabilities being updated by the job and the values with which they are being updated."] - pub data: Vec, - #[doc = "The start time of the job"] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub start: Option, - #[doc = "The end time of the job"] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub end: Option, - #[doc = "progress summary for a scheduled job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub progress: Option, - #[doc = "Indicates whether the job is starting, running, etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "List of organizations of the job, only one organization is supported today, multiple organizations will be supported soon."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub organizations: Vec, -} -impl Job { - pub fn new(group: String, data: Vec) -> Self { - Self { - id: None, - scheduled_job_id: None, - display_name: None, - description: None, - group, - batch: None, - cancellation_threshold: None, - data, - start: None, - end: None, - progress: None, - status: None, - organizations: Vec::new(), - } - } -} -#[doc = "The job batch definition."] +#[doc = "The job batch definition for job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobBatch { #[doc = "Whether batching is done on a specified number of devices or a percentage of the total devices."] @@ -1663,7 +1125,7 @@ pub mod job_batch { Percentage, } } -#[doc = "The job cancellation threshold definition."] +#[doc = "The job cancellation threshold definition for job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobCancellationThreshold { #[doc = "Whether the cancellation threshold is per a specified number of devices or a percentage of the total devices."] @@ -1691,7 +1153,6 @@ pub mod job_cancellation_threshold { Percentage, } } -#[doc = "The paged results of jobs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobCollection { #[doc = "The collection of jobs."] @@ -1723,7 +1184,19 @@ impl JobData { Self { type_ } } } -#[doc = "The job device status definition."] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum JobDataUnion { + #[serde(rename = "cloudProperty")] + CloudProperty(CloudPropertyJobData), + #[serde(rename = "command")] + Command(CommandJobData), + #[serde(rename = "deviceTemplateMigration")] + DeviceTemplateMigration(DeviceTemplateMigrationJobData), + #[serde(rename = "property")] + Property(PropertyJobData), +} +#[doc = "The job status definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobDeviceStatus { #[doc = "ID of the device whose job status is being provided."] @@ -1738,7 +1211,6 @@ impl JobDeviceStatus { Self::default() } } -#[doc = "The paged results of job device statuses."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JobDeviceStatusCollection { #[doc = "The collection of job device statuses."] @@ -1758,295 +1230,6 @@ impl JobDeviceStatusCollection { Self { value, next_link: None } } } -#[doc = "progress summary for a scheduled job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobProgress { - #[doc = "The total number of entities targeted by the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option, - #[doc = "The number of entities for which the job is not yet running."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pending: Option, - #[doc = "The number of entities for which the job has completed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub completed: Option, - #[doc = "The number of entities for which the job has failed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub failed: Option, -} -impl JobProgress { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The schedule definition of job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobSchedule { - #[doc = "The recurrence of the scheduled job. If not provided, the job will run once at the specified start time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub recurrence: Option, - #[doc = "The start time for the scheduled job"] - #[serde(with = "azure_core::date::rfc3339")] - pub start: time::OffsetDateTime, - #[doc = "The end definition of job schedule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option, -} -impl JobSchedule { - pub fn new(start: time::OffsetDateTime) -> Self { - Self { - recurrence: None, - start, - end: None, - } - } -} -pub mod job_schedule { - use super::*; - #[doc = "The recurrence of the scheduled job. If not provided, the job will run once at the specified start time."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Recurrence { - #[serde(rename = "daily")] - Daily, - #[serde(rename = "weekly")] - Weekly, - #[serde(rename = "monthly")] - Monthly, - } -} -#[doc = "The end definition of job schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobScheduleEnd { - #[doc = "Type of the job schedule end."] - #[serde(rename = "type")] - pub type_: String, -} -impl JobScheduleEnd { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "Configuration specifying options for kpi tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KpiTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl KpiTileConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} -#[doc = "Configuration specifying options for a label tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The text to display in the tile"] - pub text: String, - #[doc = "The font size of the text being displayed"] - #[serde(rename = "textSize", default, skip_serializing_if = "Option::is_none")] - pub text_size: Option, - #[doc = "The unit of size for the text in the tile"] - #[serde(rename = "textSizeUnit", default, skip_serializing_if = "Option::is_none")] - pub text_size_unit: Option, - #[doc = "Whether to wrap the text being displayed"] - #[serde(rename = "wordWrap", default, skip_serializing_if = "Option::is_none")] - pub word_wrap: Option, -} -impl LabelTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, text: String) -> Self { - Self { - tile_configuration, - text, - text_size: None, - text_size_unit: None, - word_wrap: None, - } - } -} -#[doc = "Configuration specifying options for a line chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LineChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying how much data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: QueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a chart tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl LineChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: QueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} -#[doc = "Configuration specifying options for a last known value tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LkvTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Show the trend between the last known value and the value before that"] - #[serde(rename = "showTrend", default, skip_serializing_if = "Option::is_none")] - pub show_trend: Option, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl LkvTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, group_tile_configuration: GroupTileConfiguration) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - show_trend: None, - format: None, - } - } -} -#[doc = "Configuration specifying formatting options for a map tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MapFormatConfiguration { - #[doc = "The zoom level of the map"] - #[serde(rename = "zoomLevel", default, skip_serializing_if = "Option::is_none")] - pub zoom_level: Option, -} -impl MapFormatConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration specifying options for a map property tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MapPropertyConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub map_tile_configuration: MapTileConfiguration, -} -impl MapPropertyConfiguration { - pub fn new(tile_configuration: TileConfiguration, map_tile_configuration: MapTileConfiguration) -> Self { - Self { - tile_configuration, - map_tile_configuration, - } - } -} -#[doc = "Configuration specifying options for a map telemetry tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MapTelemetryConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub map_tile_configuration: MapTileConfiguration, -} -impl MapTelemetryConfiguration { - pub fn new(tile_configuration: TileConfiguration, map_tile_configuration: MapTileConfiguration) -> Self { - Self { - tile_configuration, - map_tile_configuration, - } - } -} -#[doc = "Configuration specifying options for a map tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MapTileConfiguration { - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "The zoom level of the map"] - #[serde(rename = "zoomLevel", default, skip_serializing_if = "Option::is_none")] - pub zoom_level: Option, -} -impl MapTileConfiguration { - pub fn new(group_tile_configuration: GroupTileConfiguration) -> Self { - Self { - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - zoom_level: None, - } - } -} -#[doc = "Configuration specifying options for a markdown tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MarkdownTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "Link to visit when tile is clicked"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub href: Option, - #[doc = "Markdown string to render inside the tile"] - pub description: String, - #[doc = "Base64 encoded"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, -} -impl MarkdownTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, description: String) -> Self { - Self { - tile_configuration, - href: None, - description, - image: None, - } - } -} -#[doc = "The occurences based end definition of job schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OccurrencesJobScheduleEnd { - #[serde(flatten)] - pub job_schedule_end: JobScheduleEnd, - #[doc = "The number of occurrences after which to end the scheduled job."] - pub occurrences: i64, -} -impl OccurrencesJobScheduleEnd { - pub fn new(job_schedule_end: JobScheduleEnd, occurrences: i64) -> Self { - Self { - job_schedule_end, - occurrences, - } - } -} #[doc = "The organization definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Organization { @@ -2056,7 +1239,7 @@ pub struct Organization { #[doc = "Display name of the organization."] #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] pub display_name: Option, - #[doc = "ID of the parent of the organization."] + #[doc = "ID of the parent of the organization, for creation of top level organizations, this field is not required."] #[serde(default, skip_serializing_if = "Option::is_none")] pub parent: Option, } @@ -2065,7 +1248,6 @@ impl Organization { Self::default() } } -#[doc = "The paged results of organizations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationCollection { #[doc = "The collection of organizations."] @@ -2096,37 +1278,6 @@ impl Permission { Self { roles } } } -#[doc = "Configuration specifying options for a pie chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PieChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a chart tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl PieChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} #[doc = "The property job data definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PropertyJobData { @@ -2143,41 +1294,6 @@ impl PropertyJobData { } } } -#[doc = "Configuration specifying options for a property tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PropertyTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl PropertyTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, group_tile_configuration: GroupTileConfiguration) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - format: None, - } - } -} -#[doc = "Configuration specifying how much data to return for a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct QueryRangeConfiguration { - #[doc = "The type of time range - 'count' or 'time'."] - #[serde(rename = "type")] - pub type_: String, -} -impl QueryRangeConfiguration { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} #[doc = "The query request payload definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct QueryRequest { @@ -2199,7 +1315,7 @@ impl QueryResponse { Self { results } } } -#[doc = "The role definition."] +#[doc = "The user role definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Role { #[doc = "Unique ID of the role."] @@ -2214,7 +1330,7 @@ impl Role { Self::default() } } -#[doc = "The role assignment definition."] +#[doc = "The user role assignment definition associated with user."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RoleAssignment { #[doc = "ID of the role for this role assignment."] @@ -2228,7 +1344,6 @@ impl RoleAssignment { Self { role, organization: None } } } -#[doc = "The paged results of roles."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RoleCollection { #[doc = "The collection of roles."] @@ -2248,102 +1363,23 @@ impl RoleCollection { Self { value, next_link: None } } } -#[doc = "The scheduled job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduledJob { - #[doc = "ETag used to prevent conflict in scheduled job updates."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "Unique ID of the scheduled job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the scheduled job."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Detailed description of the scheduled job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The ID of the device group on which to execute the scheduled job."] - pub group: String, - #[doc = "The job batch definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub batch: Option, - #[doc = "The job cancellation threshold definition."] - #[serde(rename = "cancellationThreshold", default, skip_serializing_if = "Option::is_none")] - pub cancellation_threshold: Option, - #[doc = "Data related to the operation being performed by this job. All entries must be of the same type."] - pub data: Vec, - #[doc = "List of organizations of the job, only one organization is supported today, multiple organizations will be supported soon."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub organizations: Vec, - #[doc = "The schedule definition of job."] - pub schedule: JobSchedule, - #[doc = "Whether the scheduled job is enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "Whether the scheduled job has completed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub completed: Option, -} -impl ScheduledJob { - pub fn new(group: String, data: Vec, schedule: JobSchedule) -> Self { - Self { - etag: None, - id: None, - display_name: None, - description: None, - group, - batch: None, - cancellation_threshold: None, - data, - organizations: Vec::new(), - schedule, - enabled: None, - completed: None, - } - } -} -#[doc = "The paged results of scheduled job definitions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduledJobCollection { - #[doc = "The collection of scheduled jobs."] - pub value: Vec, - #[doc = "URL to get the next page of scheduled jobs."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ScheduledJobCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ScheduledJobCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} #[doc = "The service bus queue destination definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceBusQueueV1Destination { #[serde(flatten)] pub destination: Destination, - #[doc = "The authentication definition for service bus queue definition."] - pub authorization: ServiceBusQueueV1DestinationAuth, + #[doc = "The authentication definition for service bus queue destination."] + pub authorization: ServiceBusQueueV1DestinationAuthUnion, } impl ServiceBusQueueV1Destination { - pub fn new(destination: Destination, authorization: ServiceBusQueueV1DestinationAuth) -> Self { + pub fn new(destination: Destination, authorization: ServiceBusQueueV1DestinationAuthUnion) -> Self { Self { destination, authorization, } } } -#[doc = "The authentication definition for service bus queue definition."] +#[doc = "The authentication definition for service bus queue destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceBusQueueV1DestinationAuth { #[doc = "The kind of authentication to use."] @@ -2355,7 +1391,15 @@ impl ServiceBusQueueV1DestinationAuth { Self { type_ } } } -#[doc = "The authentication definition with connection string for service bus queue definition."] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServiceBusQueueV1DestinationAuthUnion { + #[serde(rename = "connectionString")] + ConnectionString(ServiceBusQueueV1DestinationConnectionStringAuth), + #[serde(rename = "systemAssignedManagedIdentity")] + SystemAssignedManagedIdentity(ServiceBusQueueV1DestinationSystemAssignedManagedIdentityAuth), +} +#[doc = "The authentication definition with connection string for service bus queue destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceBusQueueV1DestinationConnectionStringAuth { #[serde(flatten)] @@ -2372,7 +1416,7 @@ impl ServiceBusQueueV1DestinationConnectionStringAuth { } } } -#[doc = "The authentication definition with system assigned managed identity for service bus queue definition."] +#[doc = "The authentication definition with system assigned managed identity for service bus queue destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceBusQueueV1DestinationSystemAssignedManagedIdentityAuth { #[serde(flatten)] @@ -2399,10 +1443,10 @@ pub struct ServiceBusTopicV1Destination { #[serde(flatten)] pub destination: Destination, #[doc = "The authentication definition for service bus topic destination."] - pub authorization: ServiceBusTopicV1DestinationAuth, + pub authorization: ServiceBusTopicV1DestinationAuthUnion, } impl ServiceBusTopicV1Destination { - pub fn new(destination: Destination, authorization: ServiceBusTopicV1DestinationAuth) -> Self { + pub fn new(destination: Destination, authorization: ServiceBusTopicV1DestinationAuthUnion) -> Self { Self { destination, authorization, @@ -2421,6 +1465,14 @@ impl ServiceBusTopicV1DestinationAuth { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServiceBusTopicV1DestinationAuthUnion { + #[serde(rename = "connectionString")] + ConnectionString(ServiceBusTopicV1DestinationConnectionStringAuth), + #[serde(rename = "systemAssignedManagedIdentity")] + SystemAssignedManagedIdentity(ServiceBusTopicV1DestinationSystemAssignedManagedIdentityAuth), +} #[doc = "The authentication definition with connection string for service bus topic destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceBusTopicV1DestinationConnectionStringAuth { @@ -2459,7 +1511,7 @@ impl ServiceBusTopicV1DestinationSystemAssignedManagedIdentityAuth { } } } -#[doc = "The service principal user definition."] +#[doc = "The service principal user destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServicePrincipalUser { #[serde(flatten)] @@ -2480,112 +1532,6 @@ impl ServicePrincipalUser { } } } -#[doc = "The X509 definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SigningX509 { - #[doc = "The X509 certificates definition."] - #[serde(rename = "signingCertificates", default, skip_serializing_if = "Option::is_none")] - pub signing_certificates: Option, -} -impl SigningX509 { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The X509 certificate definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SigningX509Certificate { - #[doc = "Whether the certificate has been verified."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub verified: Option, - #[doc = "The string representation of this certificate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub certificate: Option, - #[doc = "The X509 certificate info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, - #[doc = "ETag used to prevent conflict across multiple updates"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, -} -impl SigningX509Certificate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The X509 certificates definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SigningX509Certificates { - #[doc = "The X509 certificate definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub primary: Option, - #[doc = "The X509 certificate definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub secondary: Option, -} -impl SigningX509Certificates { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration specifying options for a state chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct StateChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, -} -impl StateChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - } - } -} -#[doc = "Configuration specifying options for a state history chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct StateHistoryChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl StateHistoryChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} #[doc = "The symmetric key definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SymmetricKey { @@ -2621,175 +1567,6 @@ impl SymmetricKeyAttestation { } } } -#[doc = "Configuration specifying formatting options for a text based tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TextFormatConfiguration { - #[doc = "Whether to abbreviate the value"] - #[serde(rename = "abbreviateValue", default, skip_serializing_if = "Option::is_none")] - pub abbreviate_value: Option, - #[doc = "The number of decimal places being displayed"] - #[serde(rename = "decimalPlaces", default, skip_serializing_if = "Option::is_none")] - pub decimal_places: Option, - #[doc = "The font size of the text being displayed"] - #[serde(rename = "textSize", default, skip_serializing_if = "Option::is_none")] - pub text_size: Option, - #[doc = "The unit of size for the text in the tile"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, - #[doc = "Whether to wrap the text being displayed"] - #[serde(rename = "wordWrap", default, skip_serializing_if = "Option::is_none")] - pub word_wrap: Option, -} -impl TextFormatConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration specifying tile object, including the layout, display name and configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Tile { - #[doc = "Display name of the tile."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "Configuration specifying information about a tile."] - pub configuration: TileConfiguration, - #[doc = "Height of the tile"] - pub height: f64, - #[doc = "Width of the tile"] - pub width: f64, - #[doc = "Horizontal position of the tile"] - pub x: f64, - #[doc = "Vertical position of the tile"] - pub y: f64, -} -impl Tile { - pub fn new(display_name: String, configuration: TileConfiguration, height: f64, width: f64, x: f64, y: f64) -> Self { - Self { - display_name, - configuration, - height, - width, - x, - y, - } - } -} -#[doc = "Specifies the capability to be displayed in the tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TileCapability { - #[doc = "The path of the capability associated with data to be rendered in the tile."] - pub capability: String, - #[doc = "The type of aggregation to be applied on capability data."] - #[serde(rename = "aggregateFunction")] - pub aggregate_function: CapabilityAggregateFunctionType, -} -impl TileCapability { - pub fn new(capability: String, aggregate_function: CapabilityAggregateFunctionType) -> Self { - Self { - capability, - aggregate_function, - } - } -} -#[doc = "Configuration specifying an array of capabilities to be displayed in the tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TileCapabilityConfiguration { - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub capabilities: Vec, -} -impl TileCapabilityConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration specifying information about a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TileConfiguration { - #[doc = "The type of widget the tile renders"] - #[serde(rename = "type")] - pub type_: String, -} -impl TileConfiguration { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The unit of size for the text in the tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub enum TileTextSizeUnit { - #[serde(rename = "pt")] - Pt, -} -impl Default for TileTextSizeUnit { - fn default() -> Self { - Self::Pt - } -} -#[doc = "Configuration specifying the time range and resolution of data to return for a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TimeQueryRangeConfiguration { - #[serde(flatten)] - pub query_range_configuration: QueryRangeConfiguration, - #[doc = "The duration of time to look back when querying data."] - pub duration: TimeRangeDuration, - #[doc = "The resolution to aggregate data over for each data point."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option, -} -impl TimeQueryRangeConfiguration { - pub fn new(query_range_configuration: QueryRangeConfiguration, duration: TimeRangeDuration) -> Self { - Self { - query_range_configuration, - duration, - resolution: None, - } - } -} -#[doc = "The duration of time to look back when querying data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub enum TimeRangeDuration { - #[serde(rename = "PT30M")] - Pt30m, - #[serde(rename = "PT1H")] - Pt1h, - #[serde(rename = "PT12H")] - Pt12h, - #[serde(rename = "P1D")] - P1d, - #[serde(rename = "P1W")] - P1w, - #[serde(rename = "P30D")] - P30d, -} -#[doc = "The resolution to aggregate data over for each data point."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub enum TimeRangeResolution { - #[serde(rename = "PT1M")] - Pt1m, - #[serde(rename = "PT5M")] - Pt5m, - #[serde(rename = "PT10M")] - Pt10m, - #[serde(rename = "PT30M")] - Pt30m, - #[serde(rename = "PT1H")] - Pt1h, - #[serde(rename = "PT12H")] - Pt12h, - #[serde(rename = "P1D")] - P1d, - #[serde(rename = "P1W")] - P1w, -} -impl Default for TimeRangeResolution { - fn default() -> Self { - Self::Pt5m - } -} #[doc = "The trusted platform module definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Tpm { @@ -2802,7 +1579,7 @@ impl Tpm { Self { endorsement_key } } } -#[doc = "The TPM attestation definition."] +#[doc = "The trusted platform module attestation definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TpmAttestation { #[serde(flatten)] @@ -2836,11 +1613,20 @@ impl User { } } } -#[doc = "The paged results of users."] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserUnion { + #[serde(rename = "adGroup")] + AdGroup(AdGroupUser), + #[serde(rename = "email")] + Email(EmailUser), + #[serde(rename = "servicePrincipal")] + ServicePrincipal(ServicePrincipalUser), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserCollection { #[doc = "The collection of users."] - pub value: Vec, + pub value: Vec, #[doc = "URL to get the next page of users."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -2852,7 +1638,7 @@ impl azure_core::Continuable for UserCollection { } } impl UserCollection { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value, next_link: None } } } @@ -2871,7 +1657,7 @@ pub struct WebhookV1Destination { pub header_customizations: Option, #[doc = "The authentication definition for webhook destination."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization: Option, + pub authorization: Option, } impl WebhookV1Destination { pub fn new(destination: Destination, url: String) -> Self { @@ -2896,6 +1682,14 @@ impl WebhookV1DestinationAuth { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum WebhookV1DestinationAuthUnion { + #[serde(rename = "header")] + Header(WebhookV1DestinationHeaderAuth), + #[serde(rename = "oauth")] + Oauth(WebhookV1DestinationOAuthAuth), +} #[doc = "The customization definition for webhook destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WebhookV1DestinationCustomization { @@ -3007,7 +1801,7 @@ pub struct X509Certificate { #[doc = "The string representation of this certificate."] #[serde(default, skip_serializing_if = "Option::is_none")] pub certificate: Option, - #[doc = "The X509 certificate info."] + #[doc = "The X509 certificate information definition."] #[serde(default, skip_serializing_if = "Option::is_none")] pub info: Option, } @@ -3016,7 +1810,7 @@ impl X509Certificate { Self::default() } } -#[doc = "The X509 certificate info."] +#[doc = "The X509 certificate information definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct X509CertificateInfo { #[doc = "The SHA-1 hash value of the certificate."] @@ -3042,26 +1836,3 @@ impl X509Certificates { Self { primary, secondary: None } } } -#[doc = "The X509 verification certificate definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct X509VerificationCertificate { - #[doc = "The string representation of this certificate."] - pub certificate: String, -} -impl X509VerificationCertificate { - pub fn new(certificate: String) -> Self { - Self { certificate } - } -} -#[doc = "The X509 certificate verification code."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct X509VerificationCode { - #[doc = "The X509 certificate verification code."] - #[serde(rename = "verificationCode", default, skip_serializing_if = "Option::is_none")] - pub verification_code: Option, -} -impl X509VerificationCode { - pub fn new() -> Self { - Self::default() - } -} diff --git a/services/svc/iotcentral/src/package_2021_04_30_preview/mod.rs b/services/svc/iotcentral/src/package_2021_04_30_preview/mod.rs index 7bf4bd47a7..7a175189af 100644 --- a/services/svc/iotcentral/src/package_2021_04_30_preview/mod.rs +++ b/services/svc/iotcentral/src/package_2021_04_30_preview/mod.rs @@ -2139,7 +2139,7 @@ pub mod devices { pub fn create_attestation( &self, device_id: impl Into, - body: impl Into, + body: impl Into, ) -> create_attestation::RequestBuilder { create_attestation::RequestBuilder { client: self.0.clone(), @@ -3240,9 +3240,9 @@ pub mod devices { #[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::Attestation = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3318,8 +3318,8 @@ pub mod devices { } } 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`."] @@ -3339,9 +3339,9 @@ pub mod devices { #[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::Attestation = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3383,7 +3383,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) body: models::Attestation, + pub(crate) body: models::AttestationUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3419,8 +3419,8 @@ pub mod devices { } } 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`."] @@ -3440,9 +3440,9 @@ pub mod devices { #[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::Attestation = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3520,8 +3520,8 @@ pub mod devices { } } 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`."] @@ -7982,7 +7982,7 @@ pub mod users { #[doc = "Arguments:"] #[doc = "* `user_id`: Unique ID of the user."] #[doc = "* `body`: User body."] - pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { + pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), user_id: user_id.into(), @@ -8137,9 +8137,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8215,8 +8215,8 @@ pub mod users { } } 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`."] @@ -8236,9 +8236,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8280,7 +8280,7 @@ pub mod users { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) user_id: String, - pub(crate) body: models::User, + pub(crate) body: models::UserUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8316,8 +8316,8 @@ pub mod users { } } 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`."] @@ -8337,9 +8337,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8417,8 +8417,8 @@ pub mod users { } } 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`."] diff --git a/services/svc/iotcentral/src/package_2021_04_30_preview/models.rs b/services/svc/iotcentral/src/package_2021_04_30_preview/models.rs index c8ca97df8e..1e448324f1 100644 --- a/services/svc/iotcentral/src/package_2021_04_30_preview/models.rs +++ b/services/svc/iotcentral/src/package_2021_04_30_preview/models.rs @@ -77,6 +77,9 @@ impl Attestation { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AttestationUnion {} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CloudPropertyJobData { #[serde(flatten)] @@ -121,7 +124,7 @@ pub struct ContinuousDataExport { #[doc = "Display name of the continuous data export."] #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] pub display_name: Option, - pub endpoint: Endpoint, + pub endpoint: EndpointUnion, #[doc = "Indicates whether the continuous data export is starting, running, etc."] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, @@ -131,7 +134,7 @@ pub struct ContinuousDataExport { pub sources: Vec, } impl ContinuousDataExport { - pub fn new(endpoint: Endpoint, enabled: bool, sources: Vec) -> Self { + pub fn new(endpoint: EndpointUnion, enabled: bool, sources: Vec) -> Self { Self { id: None, etag: None, @@ -427,6 +430,9 @@ impl Endpoint { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum EndpointUnion {} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventHubsEndpoint { #[serde(flatten)] @@ -455,13 +461,13 @@ pub struct Job { #[serde(rename = "cancellationThreshold", default, skip_serializing_if = "Option::is_none")] pub cancellation_threshold: Option, #[doc = "The capabilities being updated by the job and the values with which they are being updated."] - pub data: Vec, + pub data: Vec, #[doc = "Indicates whether the job is starting, running, etc."] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, } impl Job { - pub fn new(group: String, data: Vec) -> Self { + pub fn new(group: String, data: Vec) -> Self { Self { id: None, display_name: None, @@ -567,6 +573,9 @@ impl JobData { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum JobDataUnion {} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobDeviceStatus { #[doc = "ID of the device whose job status is being provided."] @@ -781,10 +790,13 @@ impl User { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserUnion {} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserCollection { #[doc = "The collection of users."] - pub value: Vec, + pub value: Vec, #[doc = "URL to get the next page of users."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -796,7 +808,7 @@ impl azure_core::Continuable for UserCollection { } } impl UserCollection { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value, next_link: None } } } diff --git a/services/svc/iotcentral/src/package_2022_05_31/mod.rs b/services/svc/iotcentral/src/package_2022_05_31/mod.rs index 7fa19576ba..da3fb34785 100644 --- a/services/svc/iotcentral/src/package_2022_05_31/mod.rs +++ b/services/svc/iotcentral/src/package_2022_05_31/mod.rs @@ -1781,7 +1781,7 @@ pub mod devices { pub fn create_attestation( &self, device_id: impl Into, - body: impl Into, + body: impl Into, ) -> create_attestation::RequestBuilder { create_attestation::RequestBuilder { client: self.0.clone(), @@ -2842,9 +2842,9 @@ pub mod devices { #[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::Attestation = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2921,8 +2921,8 @@ pub mod devices { } } 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`."] @@ -2942,9 +2942,9 @@ pub mod devices { #[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::Attestation = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2986,7 +2986,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) body: models::Attestation, + pub(crate) body: models::AttestationUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3023,8 +3023,8 @@ pub mod devices { } } 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`."] @@ -3044,9 +3044,9 @@ pub mod devices { #[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::Attestation = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3125,8 +3125,8 @@ pub mod devices { } } 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`."] @@ -7530,7 +7530,7 @@ pub mod users { #[doc = "Arguments:"] #[doc = "* `user_id`: Unique ID of the user."] #[doc = "* `body`: User body."] - pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { + pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), user_id: user_id.into(), @@ -7686,9 +7686,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7765,8 +7765,8 @@ pub mod users { } } 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`."] @@ -7786,9 +7786,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7830,7 +7830,7 @@ pub mod users { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) user_id: String, - pub(crate) body: models::User, + pub(crate) body: models::UserUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7867,8 +7867,8 @@ pub mod users { } } 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`."] @@ -7888,9 +7888,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7969,8 +7969,8 @@ pub mod users { } } 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`."] diff --git a/services/svc/iotcentral/src/package_2022_05_31/models.rs b/services/svc/iotcentral/src/package_2022_05_31/models.rs index 9202553557..0265a4169d 100644 --- a/services/svc/iotcentral/src/package_2022_05_31/models.rs +++ b/services/svc/iotcentral/src/package_2022_05_31/models.rs @@ -89,6 +89,16 @@ impl Attestation { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AttestationUnion { + #[serde(rename = "symmetricKey")] + SymmetricKey(SymmetricKeyAttestation), + #[serde(rename = "tpm")] + Tpm(TpmAttestation), + #[serde(rename = "x509")] + X509(X509Attestation), +} #[doc = "The paged results of entities."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Collection { @@ -670,11 +680,21 @@ impl User { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserUnion { + #[serde(rename = "adGroup")] + AdGroup(AdGroupUser), + #[serde(rename = "email")] + Email(EmailUser), + #[serde(rename = "servicePrincipal")] + ServicePrincipal(ServicePrincipalUser), +} #[doc = "The paged results of users."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserCollection { #[doc = "The collection of users."] - pub value: Vec, + pub value: Vec, #[doc = "URL to get the next page of users."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -686,7 +706,7 @@ impl azure_core::Continuable for UserCollection { } } impl UserCollection { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value, next_link: None } } } diff --git a/services/svc/iotcentral/src/package_2022_07_31/mod.rs b/services/svc/iotcentral/src/package_2022_07_31/mod.rs index 4e84a198c5..b47f9895f0 100644 --- a/services/svc/iotcentral/src/package_2022_07_31/mod.rs +++ b/services/svc/iotcentral/src/package_2022_07_31/mod.rs @@ -1923,7 +1923,7 @@ pub mod devices { pub fn create_attestation( &self, device_id: impl Into, - body: impl Into, + body: impl Into, ) -> create_attestation::RequestBuilder { create_attestation::RequestBuilder { client: self.0.clone(), @@ -3069,9 +3069,9 @@ pub mod devices { #[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::Attestation = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3148,8 +3148,8 @@ pub mod devices { } } 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`."] @@ -3169,9 +3169,9 @@ pub mod devices { #[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::Attestation = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3213,7 +3213,7 @@ pub mod devices { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) device_id: String, - pub(crate) body: models::Attestation, + pub(crate) body: models::AttestationUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3250,8 +3250,8 @@ pub mod devices { } } 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`."] @@ -3271,9 +3271,9 @@ pub mod devices { #[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::Attestation = serde_json::from_slice(&bytes)?; + let body: models::AttestationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3352,8 +3352,8 @@ pub mod devices { } } 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`."] @@ -10941,7 +10941,7 @@ pub mod users { #[doc = "Arguments:"] #[doc = "* `user_id`: Unique ID for the user."] #[doc = "* `body`: User body."] - pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { + pub fn create(&self, user_id: impl Into, body: impl Into) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), user_id: user_id.into(), @@ -11097,9 +11097,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11176,8 +11176,8 @@ pub mod users { } } 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`."] @@ -11197,9 +11197,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11241,7 +11241,7 @@ pub mod users { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) user_id: String, - pub(crate) body: models::User, + pub(crate) body: models::UserUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11278,8 +11278,8 @@ pub mod users { } } 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`."] @@ -11299,9 +11299,9 @@ pub mod users { #[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::User = serde_json::from_slice(&bytes)?; + let body: models::UserUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11380,8 +11380,8 @@ pub mod users { } } 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`."] diff --git a/services/svc/iotcentral/src/package_2022_07_31/models.rs b/services/svc/iotcentral/src/package_2022_07_31/models.rs index 836933ad5c..4d620561e6 100644 --- a/services/svc/iotcentral/src/package_2022_07_31/models.rs +++ b/services/svc/iotcentral/src/package_2022_07_31/models.rs @@ -89,6 +89,16 @@ impl Attestation { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AttestationUnion { + #[serde(rename = "symmetricKey")] + SymmetricKey(SymmetricKeyAttestation), + #[serde(rename = "tpm")] + Tpm(TpmAttestation), + #[serde(rename = "x509")] + X509(X509Attestation), +} #[doc = "The capability job data definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CapabilityJobData { @@ -528,13 +538,13 @@ pub struct EnrollmentGroup { #[serde(rename = "type")] pub type_: enrollment_group::Type, #[doc = "The attestation definition for an enrollment group."] - pub attestation: GroupAttestation, + pub attestation: GroupAttestationUnion, #[doc = "ETag used to prevent conflict in enrollment group updates."] #[serde(default, skip_serializing_if = "Option::is_none")] pub etag: Option, } impl EnrollmentGroup { - pub fn new(display_name: String, type_: enrollment_group::Type, attestation: GroupAttestation) -> Self { + pub fn new(display_name: String, type_: enrollment_group::Type, attestation: GroupAttestationUnion) -> Self { Self { id: None, display_name, @@ -679,6 +689,14 @@ impl GroupAttestation { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum GroupAttestationUnion { + #[serde(rename = "symmetricKey")] + SymmetricKey(GroupSymmetricKeyAttestation), + #[serde(rename = "x509")] + X509(GroupX509Attestation), +} #[doc = "The symmetric key attestation definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupSymmetricKeyAttestation { @@ -737,7 +755,7 @@ pub struct Job { #[serde(rename = "cancellationThreshold", default, skip_serializing_if = "Option::is_none")] pub cancellation_threshold: Option, #[doc = "The capabilities being updated by the job and the values with which they are being updated."] - pub data: Vec, + pub data: Vec, #[doc = "The start time of the job"] #[serde(default, with = "azure_core::date::rfc3339::option")] pub start: Option, @@ -759,7 +777,7 @@ pub struct Job { pub organizations: Vec, } impl Job { - pub fn new(group: String, data: Vec) -> Self { + pub fn new(group: String, data: Vec) -> Self { Self { id: None, scheduled_job_id: None, @@ -862,6 +880,18 @@ impl JobData { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum JobDataUnion { + #[serde(rename = "cloudProperty")] + CloudProperty(CloudPropertyJobData), + #[serde(rename = "command")] + Command(CommandJobData), + #[serde(rename = "deviceTemplateMigration")] + DeviceTemplateMigration(DeviceTemplateMigrationJobData), + #[serde(rename = "property")] + Property(PropertyJobData), +} #[doc = "The job device status definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobDeviceStatus { @@ -929,7 +959,7 @@ pub struct JobSchedule { pub start: time::OffsetDateTime, #[doc = "The end definition of job schedule."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option, + pub end: Option, } impl JobSchedule { pub fn new(start: time::OffsetDateTime) -> Self { @@ -965,6 +995,14 @@ impl JobScheduleEnd { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum JobScheduleEndUnion { + #[serde(rename = "date")] + Date(DateJobScheduleEnd), + #[serde(rename = "occurrences")] + Occurrences(OccurrencesJobScheduleEnd), +} #[doc = "The occurences based end definition of job schedule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OccurrencesJobScheduleEnd { @@ -1119,7 +1157,7 @@ pub struct ScheduledJob { #[serde(rename = "cancellationThreshold", default, skip_serializing_if = "Option::is_none")] pub cancellation_threshold: Option, #[doc = "Data related to the operation being performed by this job. All entries must be of the same type."] - pub data: Vec, + pub data: Vec, #[doc = "List of organizations of the job, only one organization is supported today, multiple organizations will be supported soon."] #[serde( default, @@ -1137,7 +1175,7 @@ pub struct ScheduledJob { pub completed: Option, } impl ScheduledJob { - pub fn new(group: String, data: Vec, schedule: JobSchedule) -> Self { + pub fn new(group: String, data: Vec, schedule: JobSchedule) -> Self { Self { etag: None, id: None, @@ -1324,11 +1362,21 @@ impl User { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum UserUnion { + #[serde(rename = "adGroup")] + AdGroup(AdGroupUser), + #[serde(rename = "email")] + Email(EmailUser), + #[serde(rename = "servicePrincipal")] + ServicePrincipal(ServicePrincipalUser), +} #[doc = "The paged results of users."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserCollection { #[doc = "The collection of users."] - pub value: Vec, + pub value: Vec, #[doc = "URL to get the next page of users."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -1340,7 +1388,7 @@ impl azure_core::Continuable for UserCollection { } } impl UserCollection { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value, next_link: None } } } diff --git a/services/svc/iotcentral/src/package_2022_10_31_preview/models.rs b/services/svc/iotcentral/src/package_2022_10_31_preview/models.rs deleted file mode 100644 index ae518a92a0..0000000000 --- a/services/svc/iotcentral/src/package_2022_10_31_preview/models.rs +++ /dev/null @@ -1,3361 +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 = "The active directory group user definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AdGroupUser { - #[serde(flatten)] - pub user: User, - #[doc = "The AAD tenant ID of the AD Group."] - #[serde(rename = "tenantId")] - pub tenant_id: String, - #[doc = "The AAD object ID of the AD Group."] - #[serde(rename = "objectId")] - pub object_id: String, -} -impl AdGroupUser { - pub fn new(user: User, tenant_id: String, object_id: String) -> Self { - Self { - user, - tenant_id, - object_id, - } - } -} -#[doc = "Can be anything: string, number, array, object, etc. (except `null`)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AnyValue {} -impl AnyValue { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The access token definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiToken { - #[serde(flatten)] - pub permission: Permission, - #[doc = "Unique ID of the API token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Value of the API token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option, - #[doc = "String-formatted date representing the time when the token expires."] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub expiry: Option, -} -impl ApiToken { - pub fn new(permission: Permission) -> Self { - Self { - permission, - id: None, - token: None, - expiry: None, - } - } -} -#[doc = "The paged results of API tokens."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiTokenCollection { - #[doc = "The collection of API tokens."] - pub value: Vec, - #[doc = "URL to get the next page of API tokens."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ApiTokenCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ApiTokenCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The attestation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Attestation { - #[doc = "Type of the attestation."] - #[serde(rename = "type")] - pub type_: String, -} -impl Attestation { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "Configuration specifying options for a bar chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BarChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying formatting options for a chart tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, -} -impl BarChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - format: None, - query_range, - } - } -} -#[doc = "The blob storage destination definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlobStorageV1Destination { - #[serde(flatten)] - pub destination: Destination, - #[doc = "The authentication definition for blob storage destination."] - pub authorization: BlobStorageV1DestinationAuth, -} -impl BlobStorageV1Destination { - pub fn new(destination: Destination, authorization: BlobStorageV1DestinationAuth) -> Self { - Self { - destination, - authorization, - } - } -} -#[doc = "The authentication definition for blob storage destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlobStorageV1DestinationAuth { - #[doc = "The kind of authentication to use."] - #[serde(rename = "type")] - pub type_: String, -} -impl BlobStorageV1DestinationAuth { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The authentication definition with connection string for blob storage destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlobStorageV1DestinationConnectionStringAuth { - #[serde(flatten)] - pub blob_storage_v1_destination_auth: BlobStorageV1DestinationAuth, - #[doc = "The connection string for accessing the blob storage account."] - #[serde(rename = "connectionString")] - pub connection_string: String, - #[doc = "Name of the container where data should be written in the storage account."] - #[serde(rename = "containerName")] - pub container_name: String, -} -impl BlobStorageV1DestinationConnectionStringAuth { - pub fn new(blob_storage_v1_destination_auth: BlobStorageV1DestinationAuth, connection_string: String, container_name: String) -> Self { - Self { - blob_storage_v1_destination_auth, - connection_string, - container_name, - } - } -} -#[doc = "The authentication definition with system assigned managed identity for blob storage destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlobStorageV1DestinationSystemAssignedManagedIdentityAuth { - #[serde(flatten)] - pub blob_storage_v1_destination_auth: BlobStorageV1DestinationAuth, - #[doc = "The storage account's blob service endpoint URL."] - #[serde(rename = "endpointUri")] - pub endpoint_uri: String, - #[doc = "Name of the container where data should be written in the storage account."] - #[serde(rename = "containerName")] - pub container_name: String, -} -impl BlobStorageV1DestinationSystemAssignedManagedIdentityAuth { - pub fn new(blob_storage_v1_destination_auth: BlobStorageV1DestinationAuth, endpoint_uri: String, container_name: String) -> Self { - Self { - blob_storage_v1_destination_auth, - endpoint_uri, - container_name, - } - } -} -#[doc = "The type of aggregation to be applied on capability data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "CapabilityAggregateFunctionType")] -pub enum CapabilityAggregateFunctionType { - #[serde(rename = "sum")] - Sum, - #[serde(rename = "count")] - Count, - #[serde(rename = "max")] - Max, - #[serde(rename = "min")] - Min, - #[serde(rename = "avg")] - Avg, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for CapabilityAggregateFunctionType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for CapabilityAggregateFunctionType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for CapabilityAggregateFunctionType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Sum => serializer.serialize_unit_variant("CapabilityAggregateFunctionType", 0u32, "sum"), - Self::Count => serializer.serialize_unit_variant("CapabilityAggregateFunctionType", 1u32, "count"), - Self::Max => serializer.serialize_unit_variant("CapabilityAggregateFunctionType", 2u32, "max"), - Self::Min => serializer.serialize_unit_variant("CapabilityAggregateFunctionType", 3u32, "min"), - Self::Avg => serializer.serialize_unit_variant("CapabilityAggregateFunctionType", 4u32, "avg"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -impl Default for CapabilityAggregateFunctionType { - fn default() -> Self { - Self::Count - } -} -#[doc = "The capability job data definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CapabilityJobData { - #[doc = "The device template which defines the target capability for the job."] - pub target: String, - #[doc = "The path to the target capability within the device template."] - pub path: String, - #[doc = "Can be anything: string, number, array, object, etc. (except `null`)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl CapabilityJobData { - pub fn new(target: String, path: String) -> Self { - Self { target, path, value: None } - } -} -#[doc = "Configuration specifying formatting options for a chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ChartFormatConfiguration { - #[doc = "Whether to display the x-axis"] - #[serde(rename = "xAxisEnabled", default, skip_serializing_if = "Option::is_none")] - pub x_axis_enabled: Option, - #[doc = "Whether to display the y-axis"] - #[serde(rename = "yAxisEnabled", default, skip_serializing_if = "Option::is_none")] - pub y_axis_enabled: Option, - #[doc = "Whether to display the legend"] - #[serde(rename = "legendEnabled", default, skip_serializing_if = "Option::is_none")] - pub legend_enabled: Option, -} -impl ChartFormatConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The cloud property job data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CloudPropertyJobData { - #[serde(flatten)] - pub job_data: JobData, - #[serde(flatten)] - pub capability_job_data: CapabilityJobData, -} -impl CloudPropertyJobData { - pub fn new(job_data: JobData, capability_job_data: CapabilityJobData) -> Self { - Self { - job_data, - capability_job_data, - } - } -} -#[doc = "The collection of entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Collection { - #[doc = "The collection of entities."] - pub value: Vec, - #[doc = "URL to get the next page of entities."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl Collection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "Configuration specifying options for a command tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommandConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The device id that the command is associated with"] - pub device: String, - #[doc = "The command id to associate the tile to"] - pub command: String, -} -impl CommandConfiguration { - pub fn new(tile_configuration: TileConfiguration, device: String, command: String) -> Self { - Self { - tile_configuration, - device, - command, - } - } -} -#[doc = "The command job data definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommandJobData { - #[serde(flatten)] - pub job_data: JobData, - #[serde(flatten)] - pub capability_job_data: CapabilityJobData, -} -impl CommandJobData { - pub fn new(job_data: JobData, capability_job_data: CapabilityJobData) -> Self { - Self { - job_data, - capability_job_data, - } - } -} -#[doc = "Configuration specifying options for a command tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommandTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The ID of the device group to display"] - pub group: String, - #[doc = "The command to reference in the tile"] - pub command: String, - #[doc = "The device to reference in the tile"] - pub device: serde_json::Value, -} -impl CommandTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, group: String, command: String, device: serde_json::Value) -> Self { - Self { - tile_configuration, - group, - command, - device, - } - } -} -#[doc = "Configuration specifying the number of data points to query for a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CountQueryRangeConfiguration { - #[serde(flatten)] - pub query_range_configuration: QueryRangeConfiguration, - #[doc = "The maximum number of data points to query for."] - pub count: i32, -} -impl CountQueryRangeConfiguration { - pub fn new(query_range_configuration: QueryRangeConfiguration, count: i32) -> Self { - Self { - query_range_configuration, - count, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Dashboard { - #[doc = "Unique ID of the dashboard."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the dashboard."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "The tiles displayed by the dashboard."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub tiles: Vec, - #[doc = "Whether the dashboard is personal and can only be viewed by the current user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub personal: Option, - #[doc = "Whether the dashboard is favorited or not"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub favorite: Option, - #[doc = "Etag to prevent conflict when updating the dashboard."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "The organization the dashboard belongs to. If not present, the dashboard is root-level or personal. only one organization is supported today, multiple organizations will be supported soon."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub organizations: Vec, -} -impl Dashboard { - pub fn new(display_name: String) -> Self { - Self { - id: None, - display_name, - tiles: Vec::new(), - personal: None, - favorite: None, - etag: None, - organizations: Vec::new(), - } - } -} -#[doc = "The paged results of dashboards."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DashboardCollection { - #[doc = "The collection of dashboards."] - pub value: Vec, - #[doc = "URL to get the next page of dashboards."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DashboardCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DashboardCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "Configuration specifying options for an image tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataExplorerTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "The id of the Data Explorer query to show in the tile"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option, -} -impl DataExplorerTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, query_range: TimeQueryRangeConfiguration) -> Self { - Self { - tile_configuration, - query_range, - query: None, - } - } -} -#[doc = "The azure data explorer destination definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataExplorerV1Destination { - #[serde(flatten)] - pub destination: Destination, - #[doc = "The resource URI of the Data Explorer instance."] - #[serde(rename = "clusterUrl")] - pub cluster_url: String, - #[doc = "Name Data Explorer database where data should be written."] - pub database: String, - #[doc = "The table within the Data Explorer database that will receive the data."] - pub table: String, - #[doc = "The authentication definition for azure data explorer destination."] - pub authorization: DataExplorerV1DestinationAuth, -} -impl DataExplorerV1Destination { - pub fn new( - destination: Destination, - cluster_url: String, - database: String, - table: String, - authorization: DataExplorerV1DestinationAuth, - ) -> Self { - Self { - destination, - cluster_url, - database, - table, - authorization, - } - } -} -#[doc = "The authentication definition for azure data explorer destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataExplorerV1DestinationAuth { - #[doc = "The kind of authentication to use."] - #[serde(rename = "type")] - pub type_: String, -} -impl DataExplorerV1DestinationAuth { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The authentication definition with service principal for azure data explorer destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataExplorerV1DestinationServicePrincipalAuth { - #[serde(flatten)] - pub data_explorer_v1_destination_auth: DataExplorerV1DestinationAuth, - #[doc = "Service Principal client ID."] - #[serde(rename = "clientId")] - pub client_id: String, - #[doc = "Service Principal tenant ID."] - #[serde(rename = "tenantId")] - pub tenant_id: String, - #[doc = "Service Principal client secret."] - #[serde(rename = "clientSecret")] - pub client_secret: String, -} -impl DataExplorerV1DestinationServicePrincipalAuth { - pub fn new( - data_explorer_v1_destination_auth: DataExplorerV1DestinationAuth, - client_id: String, - tenant_id: String, - client_secret: String, - ) -> Self { - Self { - data_explorer_v1_destination_auth, - client_id, - tenant_id, - client_secret, - } - } -} -#[doc = "The authentication definition with system assigned managed identity for azure data explorer destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataExplorerV1DestinationSystemAssignedManagedIdentityAuth { - #[serde(flatten)] - pub data_explorer_v1_destination_auth: DataExplorerV1DestinationAuth, -} -impl DataExplorerV1DestinationSystemAssignedManagedIdentityAuth { - pub fn new(data_explorer_v1_destination_auth: DataExplorerV1DestinationAuth) -> Self { - Self { - data_explorer_v1_destination_auth, - } - } -} -#[doc = "The data export error definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataExportError { - #[doc = "The code for the error that occurred."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The description of the error that occurred."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl DataExportError { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The data export status definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataExportStatus { - #[doc = "Indication of the current health and operation of the export or destination."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Errors encountered by the export or destination."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub errors: Vec, - #[doc = "The timestamp of the last message that was sent to the export or destination."] - #[serde(rename = "lastExportTime", default, with = "azure_core::date::rfc3339::option")] - pub last_export_time: Option, -} -impl DataExportStatus { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The date based end definition of job schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DateJobScheduleEnd { - #[serde(flatten)] - pub job_schedule_end: JobScheduleEnd, - #[doc = "The date when to end the scheduled job."] - pub date: String, -} -impl DateJobScheduleEnd { - pub fn new(job_schedule_end: JobScheduleEnd, date: String) -> Self { - Self { job_schedule_end, date } - } -} -#[doc = "The deployment manifest used for edge devices."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeploymentManifest { - #[doc = "Unique ID of the deployment manifest."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the deployment manifest."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Content of the the deployment manifest."] - pub data: serde_json::Value, - #[doc = "Etag to prevent conflict when updating the deployment manifest."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "The organization that deployment manifest belongs to. If not present, the deployment manifest is root-level or personal. Only one organization is supported today, multiple organizations will be supported soon."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub organizations: Vec, -} -impl DeploymentManifest { - pub fn new(data: serde_json::Value) -> Self { - Self { - id: None, - display_name: None, - data, - etag: None, - organizations: Vec::new(), - } - } -} -#[doc = "The paged results of deployment manifests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeploymentManifestCollection { - #[doc = "The collection of deployment manifests."] - pub value: Vec, - #[doc = "URL to get the next page of deployment manifests."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DeploymentManifestCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DeploymentManifestCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The destination definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Destination { - #[serde(flatten)] - pub data_export_status: DataExportStatus, - #[doc = "Unique ID of the destination."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the destination."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "The type of destination configuration."] - #[serde(rename = "type")] - pub type_: String, -} -impl Destination { - pub fn new(display_name: String, type_: String) -> Self { - Self { - data_export_status: DataExportStatus::default(), - id: None, - display_name, - type_, - } - } -} -#[doc = "The paged results of destinations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DestinationCollection { - #[doc = "The collection of destinations."] - pub value: Vec, - #[doc = "URL to get the next page of destinations."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DestinationCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DestinationCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The destination export definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DestinationExport { - #[serde(flatten)] - pub export: Export, - #[doc = "Query for transforming the message structure to a particular output."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub transform: Option, -} -impl DestinationExport { - pub fn new(export: Export) -> Self { - Self { export, transform: None } - } -} -#[doc = "The destination reference definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DestinationReference { - #[doc = "The ID of the destination where data should be sent."] - pub id: String, - #[doc = "Query for transforming the message structure to a particular output."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub transform: Option, -} -impl DestinationReference { - pub fn new(id: String) -> Self { - Self { id, transform: None } - } -} -#[doc = "The device definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Device { - #[doc = "Unique ID of the device."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "ETag used to prevent conflict in device updates."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "Display name of the device."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "The device template definition for the device."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub template: Option, - #[doc = "Whether the device connection to IoT Central has been enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "Whether resources have been allocated for the device."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provisioned: Option, - #[doc = "Whether the device is simulated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub simulated: Option, - #[doc = "List of organization IDs that the device is a part of, only one organization is supported today, multiple organizations will be supported soon."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub organizations: Vec, - #[doc = "The type of the device."] - #[serde( - rename = "type", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub type_: Vec, - #[doc = "The deployment manifest used for edge devices."] - #[serde(rename = "deploymentManifest", default, skip_serializing_if = "Option::is_none")] - pub deployment_manifest: Option, -} -impl Device { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The paged results of devices."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceCollection { - #[doc = "The collection of devices."] - pub value: Vec, - #[doc = "URL to get the next page of devices."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DeviceCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DeviceCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The device command definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeviceCommand { - #[doc = "The request ID of the device command execution."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Connection timeout in seconds to wait for a disconnected device to come online. Defaults to 0 seconds."] - #[serde(rename = "connectionTimeout", default, skip_serializing_if = "Option::is_none")] - pub connection_timeout: Option, - #[doc = "Response timeout in seconds to wait for a command completion on a device. Defaults to 30 seconds."] - #[serde(rename = "responseTimeout", default, skip_serializing_if = "Option::is_none")] - pub response_timeout: Option, - #[doc = "The payload for the device command, support any primitive types or object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub request: Option, - #[doc = "The payload of the device command response, support any primitive types or object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub response: Option, - #[doc = "The status code of the device command response."] - #[serde(rename = "responseCode", default, skip_serializing_if = "Option::is_none")] - pub response_code: Option, -} -impl DeviceCommand { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The paged results of device command executions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceCommandCollection { - #[doc = "The collection of device command executions."] - pub value: Vec, - #[doc = "URL to get the next page of device command executions."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DeviceCommandCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DeviceCommandCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "Configuration specifying options for a device count tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceCountTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The ID of the device group to display"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group: Option, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl DeviceCountTileConfiguration { - pub fn new(tile_configuration: TileConfiguration) -> Self { - Self { - tile_configuration, - group: None, - format: None, - } - } -} -#[doc = "The device credentials definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceCredentials { - #[doc = "ID scope for connecting to the IoT Central application."] - #[serde(rename = "idScope")] - pub id_scope: String, - #[doc = "The symmetric key definition."] - #[serde(rename = "symmetricKey", default, skip_serializing_if = "Option::is_none")] - pub symmetric_key: Option, - #[doc = "The X509 definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub x509: Option, - #[doc = "The trusted platform module definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tpm: Option, -} -impl DeviceCredentials { - pub fn new(id_scope: String) -> Self { - Self { - id_scope, - symmetric_key: None, - x509: None, - tpm: None, - } - } -} -#[doc = "The device group definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceGroup { - #[doc = "Unique ID of the device group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the device group."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "Query defining which devices should be in this group, [Query Language Reference](https://aka.ms/iotcquery)."] - pub filter: String, - #[doc = "Short summary of device group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "ETag used to prevent conflict in device group updates."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "List of organization IDs of the device group, only one organization is supported today, multiple organizations will be supported soon."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub organizations: Vec, -} -impl DeviceGroup { - pub fn new(display_name: String, filter: String) -> Self { - Self { - id: None, - display_name, - filter, - description: None, - etag: None, - organizations: Vec::new(), - } - } -} -#[doc = "The paged results of device groups."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceGroupCollection { - #[doc = "The collection of device groups."] - pub value: Vec, - #[doc = "URL to get the next page of device groups."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DeviceGroupCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DeviceGroupCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The paged results of devices belonging to the device group."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceGroupDeviceCollection { - #[doc = "The collection of devices belonging to the device group."] - pub value: Vec, - #[doc = "URL to get the next page of devices in the group."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DeviceGroupDeviceCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DeviceGroupDeviceCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The edge device manifest migration job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceManifestMigrationJobData { - #[serde(flatten)] - pub job_data: JobData, - #[doc = "The target manifest identifier to which devices will be migrated."] - pub manifest: String, -} -impl DeviceManifestMigrationJobData { - pub fn new(job_data: JobData, manifest: String) -> Self { - Self { job_data, manifest } - } -} -#[doc = "Property values associated with the device."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeviceProperties {} -impl DeviceProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An object representing the relationship between an upstream and a downstream device."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeviceRelationship { - #[doc = "The unique identifier of this relationship."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The device ID of the source (parent) device."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "The device ID of the target (child) device."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, -} -impl DeviceRelationship { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The paged results of device relationships."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceRelationshipCollection { - #[doc = "The collection of device relationships."] - pub value: Vec, - #[doc = "URL to get the next page of device relationships."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DeviceRelationshipCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DeviceRelationshipCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The device telemetry definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeviceTelemetry { - #[doc = "The last known value of this device telemetry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "String-formatted date representing the time when the telemetry value was sent."] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub timestamp: Option, -} -impl DeviceTelemetry { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The device template definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceTemplate { - #[doc = "Unique ID of the device template."] - #[serde(rename = "@id", default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The JSON-LD types of this device template."] - #[serde(rename = "@type")] - pub type_: Vec, - #[doc = "ETag used to prevent conflict in device template updates."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "Display name of the device template."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Detailed description of the device template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The capability model utilized by this device template."] - #[serde(rename = "capabilityModel")] - pub capability_model: serde_json::Value, -} -impl DeviceTemplate { - pub fn new(type_: Vec, capability_model: serde_json::Value) -> Self { - Self { - id: None, - type_, - etag: None, - display_name: None, - description: None, - capability_model, - } - } -} -#[doc = "The paged results of device templates."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceTemplateCollection { - #[doc = "The collection of device templates."] - pub value: Vec, - #[doc = "URL to get the next page of device templates."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DeviceTemplateCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DeviceTemplateCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The device template migration job data definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceTemplateMigrationJobData { - #[serde(flatten)] - pub job_data: JobData, - #[doc = "The target device template to which devices will be migrated."] - pub template: String, -} -impl DeviceTemplateMigrationJobData { - pub fn new(job_data: JobData, template: String) -> Self { - Self { job_data, template } - } -} -#[doc = "The email user definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EmailUser { - #[serde(flatten)] - pub user: User, - #[doc = "Email address of the user."] - pub email: String, -} -impl EmailUser { - pub fn new(user: User, email: String) -> Self { - Self { user, email } - } -} -#[doc = "The enrichment definition for data export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Enrichment { - #[doc = "The device template or interface which defines the target capability for the enrichment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The path to the target capability within the device template or the system property to use."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, - #[doc = "The raw value used for the enrichment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl Enrichment { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The enrollment group definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnrollmentGroup { - #[doc = "Unique ID of the enrollment group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the enrollment group."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "Whether the devices using the group are allowed to connect to IoT Central."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "Type of devices that connect through the group."] - #[serde(rename = "type")] - pub type_: enrollment_group::Type, - #[doc = "The attestation definition for an enrollment group."] - pub attestation: GroupAttestation, - #[doc = "ETag used to prevent conflict in enrollment group updates."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "ID scope for connecting to the IoT Central application."] - #[serde(rename = "idScope", default, skip_serializing_if = "Option::is_none")] - pub id_scope: Option, -} -impl EnrollmentGroup { - pub fn new(display_name: String, type_: enrollment_group::Type, attestation: GroupAttestation) -> Self { - Self { - id: None, - display_name, - enabled: None, - type_, - attestation, - etag: None, - id_scope: None, - } - } -} -pub mod enrollment_group { - use super::*; - #[doc = "Type of devices that connect through the group."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "iot")] - Iot, - #[serde(rename = "iotEdge")] - IotEdge, - } -} -#[doc = "The paged results of enrollment groups."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnrollmentGroupCollection { - #[doc = "The collection of enrollment groups."] - pub value: Vec, - #[doc = "URL to get the next page of enrollment groups."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for EnrollmentGroupCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl EnrollmentGroupCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The response error definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Error { - #[doc = "The detail information of the error."] - pub error: ErrorDetails, -} -impl azure_core::Continuable for Error { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl Error { - pub fn new(error: ErrorDetails) -> Self { - Self { error } - } -} -#[doc = "The detail information of the error."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ErrorDetails { - #[doc = "Error code."] - pub code: String, - #[doc = "Error message details."] - pub message: String, - #[doc = "Correlation Id for current request."] - #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] - pub request_id: Option, - #[doc = "The time that error request failed."] - #[serde(default, with = "azure_core::date::rfc1123::option")] - pub time: Option, -} -impl ErrorDetails { - pub fn new(code: String, message: String) -> Self { - Self { - code, - message, - request_id: None, - time: None, - } - } -} -#[doc = "Configuration specifying options for a event chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, -} -impl EventChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - } - } -} -#[doc = "Configuration specifying options for a event history chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventHistoryChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl EventHistoryChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} -#[doc = "the event hub destination definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventHubsV1Destination { - #[serde(flatten)] - pub destination: Destination, - #[doc = "The authentication definition for event hub destination."] - pub authorization: EventHubsV1DestinationAuth, -} -impl EventHubsV1Destination { - pub fn new(destination: Destination, authorization: EventHubsV1DestinationAuth) -> Self { - Self { - destination, - authorization, - } - } -} -#[doc = "The authentication definition for event hub destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventHubsV1DestinationAuth { - #[doc = "The kind of authentication to use."] - #[serde(rename = "type")] - pub type_: String, -} -impl EventHubsV1DestinationAuth { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The authentication definition with connection string for event hub destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventHubsV1DestinationConnectionStringAuth { - #[serde(flatten)] - pub event_hubs_v1_destination_auth: EventHubsV1DestinationAuth, - #[doc = "The connection string for accessing the Event Hubs namespace, including the `EntityPath` of the event hub."] - #[serde(rename = "connectionString")] - pub connection_string: String, -} -impl EventHubsV1DestinationConnectionStringAuth { - pub fn new(event_hubs_v1_destination_auth: EventHubsV1DestinationAuth, connection_string: String) -> Self { - Self { - event_hubs_v1_destination_auth, - connection_string, - } - } -} -#[doc = "The authentication definition with system assigned managed identity for event hub destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventHubsV1DestinationSystemAssignedManagedIdentityAuth { - #[serde(flatten)] - pub event_hubs_v1_destination_auth: EventHubsV1DestinationAuth, - #[doc = "The host name of the Event Hubs namespace."] - #[serde(rename = "hostName")] - pub host_name: String, - #[doc = "The Event Hubs instance name."] - #[serde(rename = "eventHubName")] - pub event_hub_name: String, -} -impl EventHubsV1DestinationSystemAssignedManagedIdentityAuth { - pub fn new(event_hubs_v1_destination_auth: EventHubsV1DestinationAuth, host_name: String, event_hub_name: String) -> Self { - Self { - event_hubs_v1_destination_auth, - host_name, - event_hub_name, - } - } -} -#[doc = "The data export definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Export { - #[serde(flatten)] - pub data_export_status: DataExportStatus, - #[doc = "Unique ID of the export."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the export."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "Toggle to start/stop an export from sending data."] - pub enabled: bool, - #[doc = "The type of data to export."] - pub source: export::Source, - #[doc = "Query defining which events from the source should be exported."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option, - #[doc = "Additional pieces of information to include with each sent message. Data is represented as a set of key/value pairs, where the key is the name of the enrichment that will appear in the output message and the value identifies the data to send."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enrichments: Option, - #[doc = "The list of destinations to which the export should send data."] - pub destinations: Vec, -} -impl Export { - pub fn new(display_name: String, enabled: bool, source: export::Source, destinations: Vec) -> Self { - Self { - data_export_status: DataExportStatus::default(), - id: None, - display_name, - enabled, - source, - filter: None, - enrichments: None, - destinations, - } - } -} -pub mod export { - use super::*; - #[doc = "The type of data to export."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Source")] - pub enum Source { - #[serde(rename = "telemetry")] - Telemetry, - #[serde(rename = "properties")] - Properties, - #[serde(rename = "deviceLifecycle")] - DeviceLifecycle, - #[serde(rename = "deviceTemplateLifecycle")] - DeviceTemplateLifecycle, - #[serde(rename = "deviceConnectivity")] - DeviceConnectivity, - #[serde(rename = "audit")] - Audit, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Source { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Source { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Source { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Telemetry => serializer.serialize_unit_variant("Source", 0u32, "telemetry"), - Self::Properties => serializer.serialize_unit_variant("Source", 1u32, "properties"), - Self::DeviceLifecycle => serializer.serialize_unit_variant("Source", 2u32, "deviceLifecycle"), - Self::DeviceTemplateLifecycle => serializer.serialize_unit_variant("Source", 3u32, "deviceTemplateLifecycle"), - Self::DeviceConnectivity => serializer.serialize_unit_variant("Source", 4u32, "deviceConnectivity"), - Self::Audit => serializer.serialize_unit_variant("Source", 5u32, "audit"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The paged results of exports."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportCollection { - #[doc = "The collection of exports."] - pub value: Vec, - #[doc = "URL to get the next page of exports."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ExportCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ExportCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The export destination definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportDestination { - #[serde(flatten)] - pub destination: Destination, - #[doc = "Query for transforming the message structure to a particular output."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub transform: Option, -} -impl ExportDestination { - pub fn new(destination: Destination) -> Self { - Self { - destination, - transform: None, - } - } -} -#[doc = "Configuration specifying options for an external content tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExternalContentTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "URL of the website to render inside the tile. Must be a valid HTTPS URL."] - #[serde(rename = "sourceUrl")] - pub source_url: String, -} -impl ExternalContentTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, source_url: String) -> Self { - Self { - tile_configuration, - source_url, - } - } -} -#[doc = "The file upload configuration definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FileUpload { - #[doc = "The storage account name where to upload the file to"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub account: Option, - #[doc = "The connection string used to configure the storage account"] - #[serde(rename = "connectionString")] - pub connection_string: String, - #[doc = "The name of the container inside the storage account"] - pub container: String, - #[doc = "ISO 8601 duration standard, The amount of time the device’s request to upload a file is valid before it expires."] - #[serde(rename = "sasTtl", default, skip_serializing_if = "Option::is_none")] - pub sas_ttl: Option, - #[doc = "The state of the file upload configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "ETag used to prevent conflict with multiple uploads"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "The flag indicate if user be able to access device uploaded files from IoT Central portal"] - #[serde(rename = "readAccess", default, skip_serializing_if = "Option::is_none")] - pub read_access: Option, -} -impl FileUpload { - pub fn new(connection_string: String, container: String) -> Self { - Self { - account: None, - connection_string, - container, - sas_ttl: None, - state: None, - etag: None, - read_access: None, - } - } -} -pub mod file_upload { - use super::*; - #[doc = "The state of the file upload configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "pending")] - Pending, - #[serde(rename = "updating")] - Updating, - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - } -} -#[doc = "The attestation definition for an enrollment group."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupAttestation { - #[doc = "Type of the attestation."] - #[serde(rename = "type")] - pub type_: String, -} -impl GroupAttestation { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The symmetric key attestation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupSymmetricKeyAttestation { - #[serde(flatten)] - pub group_attestation: GroupAttestation, - #[doc = "The symmetric key definition."] - #[serde(rename = "symmetricKey", default, skip_serializing_if = "Option::is_none")] - pub symmetric_key: Option, -} -impl GroupSymmetricKeyAttestation { - pub fn new(group_attestation: GroupAttestation) -> Self { - Self { - group_attestation, - symmetric_key: None, - } - } -} -#[doc = "Configuration specifying a set of devices to display data for in a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupTileConfiguration { - #[doc = "The ID of the device group to display"] - pub group: String, - #[doc = "The list of associated devices to display"] - pub devices: Vec, -} -impl GroupTileConfiguration { - pub fn new(group: String, devices: Vec) -> Self { - Self { group, devices } - } -} -#[doc = "The X509 attestation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupX509Attestation { - #[serde(flatten)] - pub group_attestation: GroupAttestation, - #[doc = "The X509 definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub x509: Option, -} -impl GroupX509Attestation { - pub fn new(group_attestation: GroupAttestation) -> Self { - Self { - group_attestation, - x509: None, - } - } -} -#[doc = "Configuration specifying options for a heat map tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HeatMapConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a chart tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl HeatMapConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} -#[doc = "Configuration specifying options for an image tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The asset id of the image to display"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, - #[doc = "The URL the tile links to when clicked"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub href: Option, - #[doc = "Format options for the image tile"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl ImageTileConfiguration { - pub fn new(tile_configuration: TileConfiguration) -> Self { - Self { - tile_configuration, - image: None, - href: None, - format: None, - } - } -} -pub mod image_tile_configuration { - use super::*; - #[doc = "Format options for the image tile"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Format { - #[doc = "The background color to show behind the image"] - #[serde(rename = "backgroundColor", default, skip_serializing_if = "Option::is_none")] - pub background_color: Option, - #[doc = "Whether to stretch the image to fit the aspect ratio of the tile or display in the image's native aspect ratio"] - #[serde(rename = "fitImage", default, skip_serializing_if = "Option::is_none")] - pub fit_image: Option, - #[doc = "The color of the text in the tile"] - #[serde(rename = "textColor", default, skip_serializing_if = "Option::is_none")] - pub text_color: Option, - #[doc = "Size of the test in the tile"] - #[serde(rename = "textSize", default, skip_serializing_if = "Option::is_none")] - pub text_size: Option, - #[doc = "The unit of size for the text in the tile"] - #[serde(rename = "textSizeUnit", default, skip_serializing_if = "Option::is_none")] - pub text_size_unit: Option, - #[doc = "Whether or not to show the display name text on the tile"] - #[serde(rename = "showTitle", default, skip_serializing_if = "Option::is_none")] - pub show_title: Option, - } - impl Format { - pub fn new() -> Self { - Self::default() - } - } - pub mod format { - use super::*; - #[doc = "The unit of size for the text in the tile"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "TextSizeUnit")] - pub enum TextSizeUnit { - #[serde(rename = "px")] - Px, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for TextSizeUnit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for TextSizeUnit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for TextSizeUnit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Px => serializer.serialize_unit_variant("TextSizeUnit", 0u32, "px"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for TextSizeUnit { - fn default() -> Self { - Self::Px - } - } - } -} -#[doc = "The job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Job { - #[doc = "Unique ID of the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Id of the scheduled job definition that created this job."] - #[serde(rename = "scheduledJobId", default, skip_serializing_if = "Option::is_none")] - pub scheduled_job_id: Option, - #[doc = "Display name of the job."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Detailed description of the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The ID of the device group on which to execute the job."] - pub group: String, - #[doc = "The job batch definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub batch: Option, - #[doc = "The job cancellation threshold definition."] - #[serde(rename = "cancellationThreshold", default, skip_serializing_if = "Option::is_none")] - pub cancellation_threshold: Option, - #[doc = "The capabilities being updated by the job and the values with which they are being updated."] - pub data: Vec, - #[doc = "The start time of the job"] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub start: Option, - #[doc = "The end time of the job"] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub end: Option, - #[doc = "progress summary for a scheduled job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub progress: Option, - #[doc = "Indicates whether the job is starting, running, etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "List of organizations of the job, only one organization is supported today, multiple organizations will be supported soon."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub organizations: Vec, -} -impl Job { - pub fn new(group: String, data: Vec) -> Self { - Self { - id: None, - scheduled_job_id: None, - display_name: None, - description: None, - group, - batch: None, - cancellation_threshold: None, - data, - start: None, - end: None, - progress: None, - status: None, - organizations: Vec::new(), - } - } -} -#[doc = "The job batch definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobBatch { - #[doc = "Whether batching is done on a specified number of devices or a percentage of the total devices."] - #[serde(rename = "type")] - pub type_: job_batch::Type, - #[doc = "The number or percentage of devices on which batching is done."] - pub value: f64, -} -impl JobBatch { - pub fn new(type_: job_batch::Type, value: f64) -> Self { - Self { type_, value } - } -} -pub mod job_batch { - use super::*; - #[doc = "Whether batching is done on a specified number of devices or a percentage of the total devices."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "number")] - Number, - #[serde(rename = "percentage")] - Percentage, - } -} -#[doc = "The job cancellation threshold definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobCancellationThreshold { - #[doc = "Whether the cancellation threshold is per a specified number of devices or a percentage of the total devices."] - #[serde(rename = "type")] - pub type_: job_cancellation_threshold::Type, - #[doc = "The number or percentage of devices on which the cancellation threshold is applied."] - pub value: f64, - #[doc = "Whether the cancellation threshold applies per-batch or to the overall job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub batch: Option, -} -impl JobCancellationThreshold { - pub fn new(type_: job_cancellation_threshold::Type, value: f64) -> Self { - Self { type_, value, batch: None } - } -} -pub mod job_cancellation_threshold { - use super::*; - #[doc = "Whether the cancellation threshold is per a specified number of devices or a percentage of the total devices."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "number")] - Number, - #[serde(rename = "percentage")] - Percentage, - } -} -#[doc = "The paged results of jobs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobCollection { - #[doc = "The collection of jobs."] - pub value: Vec, - #[doc = "URL to get the next page of jobs."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for JobCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl JobCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The job data definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobData { - #[doc = "Type of the job data."] - #[serde(rename = "type")] - pub type_: String, -} -impl JobData { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The job device status definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobDeviceStatus { - #[doc = "ID of the device whose job status is being provided."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Indicates whether the job is starting, running, etc. for the given device."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl JobDeviceStatus { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The paged results of job device statuses."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobDeviceStatusCollection { - #[doc = "The collection of job device statuses."] - pub value: Vec, - #[doc = "URL to get the next page of job device statuses."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for JobDeviceStatusCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl JobDeviceStatusCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "progress summary for a scheduled job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobProgress { - #[doc = "The total number of entities targeted by the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option, - #[doc = "The number of entities for which the job is not yet running."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pending: Option, - #[doc = "The number of entities for which the job has completed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub completed: Option, - #[doc = "The number of entities for which the job has failed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub failed: Option, -} -impl JobProgress { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The schedule definition of job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobSchedule { - #[doc = "The recurrence of the scheduled job. If not provided, the job will run once at the specified start time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub recurrence: Option, - #[doc = "The start time for the scheduled job"] - #[serde(with = "azure_core::date::rfc3339")] - pub start: time::OffsetDateTime, - #[doc = "The end definition of job schedule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option, -} -impl JobSchedule { - pub fn new(start: time::OffsetDateTime) -> Self { - Self { - recurrence: None, - start, - end: None, - } - } -} -pub mod job_schedule { - use super::*; - #[doc = "The recurrence of the scheduled job. If not provided, the job will run once at the specified start time."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Recurrence { - #[serde(rename = "daily")] - Daily, - #[serde(rename = "weekly")] - Weekly, - #[serde(rename = "monthly")] - Monthly, - } -} -#[doc = "The end definition of job schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobScheduleEnd { - #[doc = "Type of the job schedule end."] - #[serde(rename = "type")] - pub type_: String, -} -impl JobScheduleEnd { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "Configuration specifying options for KPI tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KpiTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl KpiTileConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} -#[doc = "Configuration specifying options for a label tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "The text to display in the tile"] - pub text: String, - #[doc = "The font size of the text being displayed"] - #[serde(rename = "textSize", default, skip_serializing_if = "Option::is_none")] - pub text_size: Option, - #[doc = "The unit of size for the text in the tile"] - #[serde(rename = "textSizeUnit", default, skip_serializing_if = "Option::is_none")] - pub text_size_unit: Option, - #[doc = "Whether to wrap the text being displayed"] - #[serde(rename = "wordWrap", default, skip_serializing_if = "Option::is_none")] - pub word_wrap: Option, -} -impl LabelTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, text: String) -> Self { - Self { - tile_configuration, - text, - text_size: None, - text_size_unit: None, - word_wrap: None, - } - } -} -#[doc = "Configuration specifying options for a line chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LineChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying how much data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: QueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a chart tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl LineChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: QueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} -#[doc = "Configuration specifying options for a last known value tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LkvTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Show the trend between the last known value and the value before that"] - #[serde(rename = "showTrend", default, skip_serializing_if = "Option::is_none")] - pub show_trend: Option, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl LkvTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, group_tile_configuration: GroupTileConfiguration) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - show_trend: None, - format: None, - } - } -} -#[doc = "Configuration specifying formatting options for a map tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MapFormatConfiguration { - #[doc = "The zoom level of the map"] - #[serde(rename = "zoomLevel", default, skip_serializing_if = "Option::is_none")] - pub zoom_level: Option, -} -impl MapFormatConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration specifying options for a map property tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MapPropertyConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub map_tile_configuration: MapTileConfiguration, -} -impl MapPropertyConfiguration { - pub fn new(tile_configuration: TileConfiguration, map_tile_configuration: MapTileConfiguration) -> Self { - Self { - tile_configuration, - map_tile_configuration, - } - } -} -#[doc = "Configuration specifying options for a map telemetry tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MapTelemetryConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub map_tile_configuration: MapTileConfiguration, -} -impl MapTelemetryConfiguration { - pub fn new(tile_configuration: TileConfiguration, map_tile_configuration: MapTileConfiguration) -> Self { - Self { - tile_configuration, - map_tile_configuration, - } - } -} -#[doc = "Configuration specifying options for a map tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MapTileConfiguration { - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "The zoom level of the map"] - #[serde(rename = "zoomLevel", default, skip_serializing_if = "Option::is_none")] - pub zoom_level: Option, -} -impl MapTileConfiguration { - pub fn new(group_tile_configuration: GroupTileConfiguration) -> Self { - Self { - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - zoom_level: None, - } - } -} -#[doc = "Configuration specifying options for a markdown tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MarkdownTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[doc = "Link to visit when tile is clicked"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub href: Option, - #[doc = "Markdown string to render inside the tile"] - pub description: String, - #[doc = "Base64 encoded"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, -} -impl MarkdownTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, description: String) -> Self { - Self { - tile_configuration, - href: None, - description, - image: None, - } - } -} -#[doc = "The occurences based end definition of job schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OccurrencesJobScheduleEnd { - #[serde(flatten)] - pub job_schedule_end: JobScheduleEnd, - #[doc = "The number of occurrences after which to end the scheduled job."] - pub occurrences: i32, -} -impl OccurrencesJobScheduleEnd { - pub fn new(job_schedule_end: JobScheduleEnd, occurrences: i32) -> Self { - Self { - job_schedule_end, - occurrences, - } - } -} -#[doc = "The organization definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Organization { - #[doc = "Unique ID of the organization."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the organization."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "ID of the parent of the organization."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option, -} -impl Organization { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The paged results of organizations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OrganizationCollection { - #[doc = "The collection of organizations."] - pub value: Vec, - #[doc = "URL to get the next page of organizations."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for OrganizationCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl OrganizationCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The permission definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Permission { - #[doc = "List of role assignments that specify the permissions to access the application."] - pub roles: Vec, -} -impl Permission { - pub fn new(roles: Vec) -> Self { - Self { roles } - } -} -#[doc = "Configuration specifying options for a pie chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PieChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a chart tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl PieChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} -#[doc = "The property job data definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PropertyJobData { - #[serde(flatten)] - pub job_data: JobData, - #[serde(flatten)] - pub capability_job_data: CapabilityJobData, -} -impl PropertyJobData { - pub fn new(job_data: JobData, capability_job_data: CapabilityJobData) -> Self { - Self { - job_data, - capability_job_data, - } - } -} -#[doc = "Configuration specifying options for a property tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PropertyTileConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl PropertyTileConfiguration { - pub fn new(tile_configuration: TileConfiguration, group_tile_configuration: GroupTileConfiguration) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - format: None, - } - } -} -#[doc = "Configuration specifying how much data to return for a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct QueryRangeConfiguration { - #[doc = "The type of time range - 'count' or 'time'."] - #[serde(rename = "type")] - pub type_: String, -} -impl QueryRangeConfiguration { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The query request payload definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct QueryRequest { - #[doc = "Query to be executed."] - pub query: String, -} -impl QueryRequest { - pub fn new(query: String) -> Self { - Self { query } - } -} -#[doc = "The query response payload definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct QueryResponse { - pub results: Vec, -} -impl QueryResponse { - pub fn new(results: Vec) -> Self { - Self { results } - } -} -#[doc = "The role definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Role { - #[doc = "Unique ID of the role."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the role."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, -} -impl Role { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The role assignment definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleAssignment { - #[doc = "ID of the role for this role assignment."] - pub role: String, - #[doc = "ID of the organization for this role assignment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub organization: Option, -} -impl RoleAssignment { - pub fn new(role: String) -> Self { - Self { role, organization: None } - } -} -#[doc = "The paged results of roles."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleCollection { - #[doc = "The collection of roles."] - pub value: Vec, - #[doc = "URL to get the next page of roles."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for RoleCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl RoleCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The scheduled job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduledJob { - #[doc = "ETag used to prevent conflict in scheduled job updates."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "Unique ID of the scheduled job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the scheduled job."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Detailed description of the scheduled job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The ID of the device group on which to execute the scheduled job."] - pub group: String, - #[doc = "The job batch definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub batch: Option, - #[doc = "The job cancellation threshold definition."] - #[serde(rename = "cancellationThreshold", default, skip_serializing_if = "Option::is_none")] - pub cancellation_threshold: Option, - #[doc = "Data related to the operation being performed by this job. All entries must be of the same type."] - pub data: Vec, - #[doc = "List of organizations of the job, only one organization is supported today, multiple organizations will be supported soon."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub organizations: Vec, - #[doc = "The schedule definition of job."] - pub schedule: JobSchedule, - #[doc = "Whether the scheduled job is enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "Whether the scheduled job has completed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub completed: Option, -} -impl ScheduledJob { - pub fn new(group: String, data: Vec, schedule: JobSchedule) -> Self { - Self { - etag: None, - id: None, - display_name: None, - description: None, - group, - batch: None, - cancellation_threshold: None, - data, - organizations: Vec::new(), - schedule, - enabled: None, - completed: None, - } - } -} -#[doc = "The paged results of scheduled job definitions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduledJobCollection { - #[doc = "The collection of scheduled jobs."] - pub value: Vec, - #[doc = "URL to get the next page of scheduled jobs."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ScheduledJobCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ScheduledJobCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The service bus queue destination definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceBusQueueV1Destination { - #[serde(flatten)] - pub destination: Destination, - #[doc = "The authentication definition for service bus queue definition."] - pub authorization: ServiceBusQueueV1DestinationAuth, -} -impl ServiceBusQueueV1Destination { - pub fn new(destination: Destination, authorization: ServiceBusQueueV1DestinationAuth) -> Self { - Self { - destination, - authorization, - } - } -} -#[doc = "The authentication definition for service bus queue definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceBusQueueV1DestinationAuth { - #[doc = "The kind of authentication to use."] - #[serde(rename = "type")] - pub type_: String, -} -impl ServiceBusQueueV1DestinationAuth { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The authentication definition with connection string for service bus queue definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceBusQueueV1DestinationConnectionStringAuth { - #[serde(flatten)] - pub service_bus_queue_v1_destination_auth: ServiceBusQueueV1DestinationAuth, - #[doc = "The connection string for accessing the Service Bus namespace, including the `EntityPath` of the queue."] - #[serde(rename = "connectionString")] - pub connection_string: String, -} -impl ServiceBusQueueV1DestinationConnectionStringAuth { - pub fn new(service_bus_queue_v1_destination_auth: ServiceBusQueueV1DestinationAuth, connection_string: String) -> Self { - Self { - service_bus_queue_v1_destination_auth, - connection_string, - } - } -} -#[doc = "The authentication definition with system assigned managed identity for service bus queue definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceBusQueueV1DestinationSystemAssignedManagedIdentityAuth { - #[serde(flatten)] - pub service_bus_queue_v1_destination_auth: ServiceBusQueueV1DestinationAuth, - #[doc = "The host name of the Service Bus namespace."] - #[serde(rename = "hostName")] - pub host_name: String, - #[doc = "The Service Bus queue name."] - #[serde(rename = "queueName")] - pub queue_name: String, -} -impl ServiceBusQueueV1DestinationSystemAssignedManagedIdentityAuth { - pub fn new(service_bus_queue_v1_destination_auth: ServiceBusQueueV1DestinationAuth, host_name: String, queue_name: String) -> Self { - Self { - service_bus_queue_v1_destination_auth, - host_name, - queue_name, - } - } -} -#[doc = "The service bus topic destination definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceBusTopicV1Destination { - #[serde(flatten)] - pub destination: Destination, - #[doc = "The authentication definition for service bus topic destination."] - pub authorization: ServiceBusTopicV1DestinationAuth, -} -impl ServiceBusTopicV1Destination { - pub fn new(destination: Destination, authorization: ServiceBusTopicV1DestinationAuth) -> Self { - Self { - destination, - authorization, - } - } -} -#[doc = "The authentication definition for service bus topic destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceBusTopicV1DestinationAuth { - #[doc = "The kind of authentication to use."] - #[serde(rename = "type")] - pub type_: String, -} -impl ServiceBusTopicV1DestinationAuth { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The authentication definition with connection string for service bus topic destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceBusTopicV1DestinationConnectionStringAuth { - #[serde(flatten)] - pub service_bus_topic_v1_destination_auth: ServiceBusTopicV1DestinationAuth, - #[doc = "The connection string for accessing the Service Bus namespace, including the `EntityPath` of the topic."] - #[serde(rename = "connectionString")] - pub connection_string: String, -} -impl ServiceBusTopicV1DestinationConnectionStringAuth { - pub fn new(service_bus_topic_v1_destination_auth: ServiceBusTopicV1DestinationAuth, connection_string: String) -> Self { - Self { - service_bus_topic_v1_destination_auth, - connection_string, - } - } -} -#[doc = "The authentication definition with system assigned managed identity for service bus topic destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceBusTopicV1DestinationSystemAssignedManagedIdentityAuth { - #[serde(flatten)] - pub service_bus_topic_v1_destination_auth: ServiceBusTopicV1DestinationAuth, - #[doc = "The host name of the Service Bus namespace."] - #[serde(rename = "hostName")] - pub host_name: String, - #[doc = "The Service Bus topic name."] - #[serde(rename = "topicName")] - pub topic_name: String, -} -impl ServiceBusTopicV1DestinationSystemAssignedManagedIdentityAuth { - pub fn new(service_bus_topic_v1_destination_auth: ServiceBusTopicV1DestinationAuth, host_name: String, topic_name: String) -> Self { - Self { - service_bus_topic_v1_destination_auth, - host_name, - topic_name, - } - } -} -#[doc = "The service principal user definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalUser { - #[serde(flatten)] - pub user: User, - #[doc = "The AAD tenant ID of the service principal."] - #[serde(rename = "tenantId")] - pub tenant_id: String, - #[doc = "The AAD object ID of the service principal."] - #[serde(rename = "objectId")] - pub object_id: String, -} -impl ServicePrincipalUser { - pub fn new(user: User, tenant_id: String, object_id: String) -> Self { - Self { - user, - tenant_id, - object_id, - } - } -} -#[doc = "The X509 definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SigningX509 { - #[doc = "The X509 certificates definition."] - #[serde(rename = "signingCertificates", default, skip_serializing_if = "Option::is_none")] - pub signing_certificates: Option, -} -impl SigningX509 { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The X509 certificate definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SigningX509Certificate { - #[doc = "Whether the certificate has been verified."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub verified: Option, - #[doc = "The string representation of this certificate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub certificate: Option, - #[doc = "The X509 certificate info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, - #[doc = "ETag used to prevent conflict across multiple updates"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, -} -impl SigningX509Certificate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The X509 certificates definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SigningX509Certificates { - #[doc = "The X509 certificate definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub primary: Option, - #[doc = "The X509 certificate definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub secondary: Option, -} -impl SigningX509Certificates { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration specifying options for a state chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct StateChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, -} -impl StateChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - } - } -} -#[doc = "Configuration specifying options for a state history chart tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct StateHistoryChartConfiguration { - #[serde(flatten)] - pub tile_configuration: TileConfiguration, - #[serde(flatten)] - pub group_tile_configuration: GroupTileConfiguration, - #[serde(flatten)] - pub tile_capability_configuration: TileCapabilityConfiguration, - #[doc = "Configuration specifying the time range and resolution of data to return for a tile."] - #[serde(rename = "queryRange")] - pub query_range: TimeQueryRangeConfiguration, - #[doc = "Configuration specifying formatting options for a text based tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, -} -impl StateHistoryChartConfiguration { - pub fn new( - tile_configuration: TileConfiguration, - group_tile_configuration: GroupTileConfiguration, - query_range: TimeQueryRangeConfiguration, - ) -> Self { - Self { - tile_configuration, - group_tile_configuration, - tile_capability_configuration: TileCapabilityConfiguration::default(), - query_range, - format: None, - } - } -} -#[doc = "The symmetric key definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SymmetricKey { - #[doc = "The primary key for this credential."] - #[serde(rename = "primaryKey")] - pub primary_key: String, - #[doc = "The secondary key for this credential."] - #[serde(rename = "secondaryKey")] - pub secondary_key: String, -} -impl SymmetricKey { - pub fn new(primary_key: String, secondary_key: String) -> Self { - Self { - primary_key, - secondary_key, - } - } -} -#[doc = "The symmetric key attestation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SymmetricKeyAttestation { - #[serde(flatten)] - pub attestation: Attestation, - #[doc = "The symmetric key definition."] - #[serde(rename = "symmetricKey")] - pub symmetric_key: SymmetricKey, -} -impl SymmetricKeyAttestation { - pub fn new(attestation: Attestation, symmetric_key: SymmetricKey) -> Self { - Self { - attestation, - symmetric_key, - } - } -} -#[doc = "Configuration specifying formatting options for a text based tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TextFormatConfiguration { - #[doc = "Whether to abbreviate the value"] - #[serde(rename = "abbreviateValue", default, skip_serializing_if = "Option::is_none")] - pub abbreviate_value: Option, - #[doc = "The number of decimal places being displayed"] - #[serde(rename = "decimalPlaces", default, skip_serializing_if = "Option::is_none")] - pub decimal_places: Option, - #[doc = "The font size of the text being displayed"] - #[serde(rename = "textSize", default, skip_serializing_if = "Option::is_none")] - pub text_size: Option, - #[doc = "The unit of size for the text in the tile"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, - #[doc = "Whether to wrap the text being displayed"] - #[serde(rename = "wordWrap", default, skip_serializing_if = "Option::is_none")] - pub word_wrap: Option, -} -impl TextFormatConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration specifying tile object, including the layout, display name and configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Tile { - #[doc = "Unique ID of the tile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Display name of the tile."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "Configuration specifying information about a tile."] - pub configuration: TileConfiguration, - #[doc = "Height of the tile"] - pub height: f64, - #[doc = "Width of the tile"] - pub width: f64, - #[doc = "Horizontal position of the tile"] - pub x: f64, - #[doc = "Vertical position of the tile"] - pub y: f64, -} -impl Tile { - pub fn new(display_name: String, configuration: TileConfiguration, height: f64, width: f64, x: f64, y: f64) -> Self { - Self { - id: None, - display_name, - configuration, - height, - width, - x, - y, - } - } -} -#[doc = "Specifies the capability to be displayed in the tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TileCapability { - #[doc = "The path of the capability associated with data to be rendered in the tile."] - pub capability: String, - #[doc = "The type of aggregation to be applied on capability data."] - #[serde(rename = "aggregateFunction")] - pub aggregate_function: CapabilityAggregateFunctionType, -} -impl TileCapability { - pub fn new(capability: String, aggregate_function: CapabilityAggregateFunctionType) -> Self { - Self { - capability, - aggregate_function, - } - } -} -#[doc = "Configuration specifying an array of capabilities to be displayed in the tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TileCapabilityConfiguration { - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub capabilities: Vec, -} -impl TileCapabilityConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration specifying information about a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TileConfiguration { - #[doc = "The type of widget the tile renders"] - #[serde(rename = "type")] - pub type_: String, -} -impl TileConfiguration { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The unit of size for the text in the tile"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TileTextSizeUnit")] -pub enum TileTextSizeUnit { - #[serde(rename = "pt")] - Pt, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TileTextSizeUnit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TileTextSizeUnit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TileTextSizeUnit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Pt => serializer.serialize_unit_variant("TileTextSizeUnit", 0u32, "pt"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -impl Default for TileTextSizeUnit { - fn default() -> Self { - Self::Pt - } -} -#[doc = "Configuration specifying the time range and resolution of data to return for a tile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TimeQueryRangeConfiguration { - #[serde(flatten)] - pub query_range_configuration: QueryRangeConfiguration, - #[doc = "The duration of time to look back when querying data."] - pub duration: TimeRangeDuration, - #[doc = "The resolution to aggregate data over for each data point."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option, -} -impl TimeQueryRangeConfiguration { - pub fn new(query_range_configuration: QueryRangeConfiguration, duration: TimeRangeDuration) -> Self { - Self { - query_range_configuration, - duration, - resolution: None, - } - } -} -#[doc = "The duration of time to look back when querying data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TimeRangeDuration")] -pub enum TimeRangeDuration { - #[serde(rename = "PT30M")] - Pt30m, - #[serde(rename = "PT1H")] - Pt1h, - #[serde(rename = "PT12H")] - Pt12h, - #[serde(rename = "P1D")] - P1d, - #[serde(rename = "P1W")] - P1w, - #[serde(rename = "P30D")] - P30d, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TimeRangeDuration { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TimeRangeDuration { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TimeRangeDuration { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Pt30m => serializer.serialize_unit_variant("TimeRangeDuration", 0u32, "PT30M"), - Self::Pt1h => serializer.serialize_unit_variant("TimeRangeDuration", 1u32, "PT1H"), - Self::Pt12h => serializer.serialize_unit_variant("TimeRangeDuration", 2u32, "PT12H"), - Self::P1d => serializer.serialize_unit_variant("TimeRangeDuration", 3u32, "P1D"), - Self::P1w => serializer.serialize_unit_variant("TimeRangeDuration", 4u32, "P1W"), - Self::P30d => serializer.serialize_unit_variant("TimeRangeDuration", 5u32, "P30D"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The resolution to aggregate data over for each data point."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TimeRangeResolution")] -pub enum TimeRangeResolution { - #[serde(rename = "PT1M")] - Pt1m, - #[serde(rename = "PT5M")] - Pt5m, - #[serde(rename = "PT10M")] - Pt10m, - #[serde(rename = "PT30M")] - Pt30m, - #[serde(rename = "PT1H")] - Pt1h, - #[serde(rename = "PT12H")] - Pt12h, - #[serde(rename = "P1D")] - P1d, - #[serde(rename = "P1W")] - P1w, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TimeRangeResolution { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TimeRangeResolution { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TimeRangeResolution { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Pt1m => serializer.serialize_unit_variant("TimeRangeResolution", 0u32, "PT1M"), - Self::Pt5m => serializer.serialize_unit_variant("TimeRangeResolution", 1u32, "PT5M"), - Self::Pt10m => serializer.serialize_unit_variant("TimeRangeResolution", 2u32, "PT10M"), - Self::Pt30m => serializer.serialize_unit_variant("TimeRangeResolution", 3u32, "PT30M"), - Self::Pt1h => serializer.serialize_unit_variant("TimeRangeResolution", 4u32, "PT1H"), - Self::Pt12h => serializer.serialize_unit_variant("TimeRangeResolution", 5u32, "PT12H"), - Self::P1d => serializer.serialize_unit_variant("TimeRangeResolution", 6u32, "P1D"), - Self::P1w => serializer.serialize_unit_variant("TimeRangeResolution", 7u32, "P1W"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -impl Default for TimeRangeResolution { - fn default() -> Self { - Self::Pt5m - } -} -#[doc = "The trusted platform module definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Tpm { - #[doc = "The TPM endorsement key for this credential."] - #[serde(rename = "endorsementKey")] - pub endorsement_key: String, -} -impl Tpm { - pub fn new(endorsement_key: String) -> Self { - Self { endorsement_key } - } -} -#[doc = "The TPM attestation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TpmAttestation { - #[serde(flatten)] - pub attestation: Attestation, - #[doc = "The trusted platform module definition."] - pub tpm: Tpm, -} -impl TpmAttestation { - pub fn new(attestation: Attestation, tpm: Tpm) -> Self { - Self { attestation, tpm } - } -} -#[doc = "The user definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct User { - #[serde(flatten)] - pub permission: Permission, - #[doc = "Unique ID of the user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Type of the user."] - #[serde(rename = "type")] - pub type_: String, -} -impl User { - pub fn new(permission: Permission, type_: String) -> Self { - Self { - permission, - id: None, - type_, - } - } -} -#[doc = "The paged results of users."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserCollection { - #[doc = "The collection of users."] - pub value: Vec, - #[doc = "URL to get the next page of users."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for UserCollection { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl UserCollection { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "The webhook destination definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WebhookV1Destination { - #[serde(flatten)] - pub destination: Destination, - #[doc = "The URL to invoke when exporting data."] - pub url: String, - #[doc = "Additional query parameters that should be added to each request."] - #[serde(rename = "queryCustomizations", default, skip_serializing_if = "Option::is_none")] - pub query_customizations: Option, - #[doc = "Additional headers that should be added to each request."] - #[serde(rename = "headerCustomizations", default, skip_serializing_if = "Option::is_none")] - pub header_customizations: Option, - #[doc = "The authentication definition for webhook destination."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization: Option, -} -impl WebhookV1Destination { - pub fn new(destination: Destination, url: String) -> Self { - Self { - destination, - url, - query_customizations: None, - header_customizations: None, - authorization: None, - } - } -} -#[doc = "The authentication definition for webhook destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WebhookV1DestinationAuth { - #[doc = "The kind of authentication to use."] - #[serde(rename = "type")] - pub type_: String, -} -impl WebhookV1DestinationAuth { - pub fn new(type_: String) -> Self { - Self { type_ } - } -} -#[doc = "The customization definition for webhook destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WebhookV1DestinationCustomization { - #[doc = "The value to use for this webhook customization."] - pub value: String, - #[doc = "Whether to consider the value to be a secret and hide it when retrieving the destination configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub secret: Option, -} -impl WebhookV1DestinationCustomization { - pub fn new(value: String) -> Self { - Self { value, secret: None } - } -} -#[doc = "The authentication definition with header for webhook destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WebhookV1DestinationHeaderAuth { - #[serde(flatten)] - pub webhook_v1_destination_auth: WebhookV1DestinationAuth, - #[doc = "Value to use for the Authorization header when making requests."] - pub value: String, -} -impl WebhookV1DestinationHeaderAuth { - pub fn new(webhook_v1_destination_auth: WebhookV1DestinationAuth, value: String) -> Self { - Self { - webhook_v1_destination_auth, - value, - } - } -} -#[doc = "The authentication definition with OAuth for webhook destination."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WebhookV1DestinationOAuthAuth { - #[serde(flatten)] - pub webhook_v1_destination_auth: WebhookV1DestinationAuth, - #[doc = "URL where an access token can be retrieved."] - #[serde(rename = "tokenUrl")] - pub token_url: String, - #[doc = "OAuth2 client ID used when retrieving the token."] - #[serde(rename = "clientId")] - pub client_id: String, - #[doc = "OAuth2 client secret used to retrieve the token."] - #[serde(rename = "clientSecret")] - pub client_secret: String, - #[doc = "OAuth2 audience."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub audience: Option, - #[doc = "OAuth2 scope."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option, - #[doc = "Content-Type for the token request."] - #[serde(rename = "requestType", default, skip_serializing_if = "Option::is_none")] - pub request_type: Option, -} -impl WebhookV1DestinationOAuthAuth { - pub fn new(webhook_v1_destination_auth: WebhookV1DestinationAuth, token_url: String, client_id: String, client_secret: String) -> Self { - Self { - webhook_v1_destination_auth, - token_url, - client_id, - client_secret, - audience: None, - scope: None, - request_type: None, - } - } -} -pub mod webhook_v1_destination_o_auth_auth { - use super::*; - #[doc = "Content-Type for the token request."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum RequestType { - #[serde(rename = "auto")] - Auto, - #[serde(rename = "json")] - Json, - #[serde(rename = "urlencoded")] - Urlencoded, - } -} -#[doc = "The X509 definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct X509 { - #[doc = "The X509 certificates definition."] - #[serde(rename = "clientCertificates", default, skip_serializing_if = "Option::is_none")] - pub client_certificates: Option, -} -impl X509 { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The X509 attestation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct X509Attestation { - #[serde(flatten)] - pub attestation: Attestation, - #[doc = "The X509 definition."] - pub x509: X509, -} -impl X509Attestation { - pub fn new(attestation: Attestation, x509: X509) -> Self { - Self { attestation, x509 } - } -} -#[doc = "The X509 certificate definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct X509Certificate { - #[doc = "The string representation of this certificate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub certificate: Option, - #[doc = "The X509 certificate info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, -} -impl X509Certificate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The X509 certificate info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct X509CertificateInfo { - #[doc = "The SHA-1 hash value of the certificate."] - #[serde(rename = "sha1Thumbprint")] - pub sha1_thumbprint: String, -} -impl X509CertificateInfo { - pub fn new(sha1_thumbprint: String) -> Self { - Self { sha1_thumbprint } - } -} -#[doc = "The X509 certificates definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct X509Certificates { - #[doc = "The X509 certificate definition."] - pub primary: X509Certificate, - #[doc = "The X509 certificate definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub secondary: Option, -} -impl X509Certificates { - pub fn new(primary: X509Certificate) -> Self { - Self { primary, secondary: None } - } -} -#[doc = "The X509 verification certificate definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct X509VerificationCertificate { - #[doc = "The string representation of this certificate."] - pub certificate: String, -} -impl X509VerificationCertificate { - pub fn new(certificate: String) -> Self { - Self { certificate } - } -} -#[doc = "The X509 certificate verification code."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct X509VerificationCode { - #[doc = "The X509 certificate verification code."] - #[serde(rename = "verificationCode", default, skip_serializing_if = "Option::is_none")] - pub verification_code: Option, -} -impl X509VerificationCode { - pub fn new() -> Self { - Self::default() - } -} diff --git a/services/svc/machinelearningservices/src/package_2019_08_preview/mod.rs b/services/svc/machinelearningservices/src/package_2019_08_preview/mod.rs index 3668da7195..79f10ed095 100644 --- a/services/svc/machinelearningservices/src/package_2019_08_preview/mod.rs +++ b/services/svc/machinelearningservices/src/package_2019_08_preview/mod.rs @@ -2926,7 +2926,7 @@ pub mod services { subscription_id: impl Into, resource_group: impl Into, workspace: impl Into, - request: impl Into, + request: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -3018,9 +3018,9 @@ pub mod services { #[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::ServiceResponseBase = serde_json::from_slice(&bytes)?; + let body: models::ServiceResponseBaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3104,8 +3104,8 @@ pub mod services { } } 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`."] @@ -3546,7 +3546,7 @@ pub mod services { pub(crate) subscription_id: String, pub(crate) resource_group: String, pub(crate) workspace: String, - pub(crate) request: models::CreateServiceRequest, + pub(crate) request: 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."] diff --git a/services/svc/machinelearningservices/src/package_2019_08_preview/models.rs b/services/svc/machinelearningservices/src/package_2019_08_preview/models.rs index 8935b896e0..92030cf9c3 100644 --- a/services/svc/machinelearningservices/src/package_2019_08_preview/models.rs +++ b/services/svc/machinelearningservices/src/package_2019_08_preview/models.rs @@ -279,7 +279,7 @@ pub struct AksServiceResponse { #[serde(flatten)] pub aks_variant_response: AksVariantResponse, #[serde(rename = "imageDetails", default, skip_serializing_if = "Option::is_none")] - pub image_details: Option, + pub image_details: Option, #[doc = "The Id of the Image."] #[serde(rename = "imageId", default, skip_serializing_if = "Option::is_none")] pub image_id: Option, @@ -1368,6 +1368,16 @@ pub mod create_service_request { Batch, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum CreateServiceRequestUnion { + #[serde(rename = "ACI")] + Aci(AciServiceCreateRequest), + #[serde(rename = "AKSENDPOINT")] + Aksendpoint(CreateEndpointRequest), + #[serde(rename = "IOT")] + Iot(CreateIotServiceRequest), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreatedBy { #[doc = "A user or service principal's object ID.\r\nThis is PII and should never be logged."] @@ -1998,7 +2008,7 @@ pub struct HyperDriveExperimentBase { #[doc = "Platform config object specifying the run definition structure."] pub platform_config: serde_json::Value, #[doc = "Early termination policy configuration."] - pub policy_config: HyperDrivePolicyConfigBase, + pub policy_config: HyperDrivePolicyConfigBaseUnion, #[doc = "Name of the primary metric and goal of optimizing."] pub primary_metric_config: hyper_drive_experiment_base::PrimaryMetricConfig, #[doc = "Study Id of the Hyperdrive run."] @@ -2011,7 +2021,7 @@ impl HyperDriveExperimentBase { name: String, platform: hyper_drive_experiment_base::Platform, platform_config: serde_json::Value, - policy_config: HyperDrivePolicyConfigBase, + policy_config: HyperDrivePolicyConfigBaseUnion, primary_metric_config: hyper_drive_experiment_base::PrimaryMetricConfig, ) -> Self { Self { @@ -2284,6 +2294,14 @@ pub mod hyper_drive_policy_config_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum HyperDrivePolicyConfigBaseUnion { + Bandit(HyperDriveBanditPolicy), + Default(HyperDriveDefaultPolicy), + MedianStopping(HyperDriveMedianStoppingPolicy), + TruncationSelection(HyperDriveTruncationSelectionPolicy), +} #[doc = "Truncation selection policy configuration. Please refer https://docs.microsoft.com/en-us/python/api/azureml-train-core/azureml.train.hyperdrive.truncationselectionpolicy?view=azure-ml-py for more information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HyperDriveTruncationSelectionPolicy { @@ -2443,6 +2461,14 @@ pub mod image_response_base { TimedOut, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "imageFlavor")] +pub enum ImageResponseBaseUnion { + #[serde(rename = "WEBAPICONTAINER")] + Webapicontainer(DockerImageResponse), + #[serde(rename = "ACCELCONTAINER")] + Accelcontainer(FpgaDockerImageResponse), +} #[doc = "A nested structure of errors."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InnerErrorResponse { @@ -2512,7 +2538,7 @@ pub struct IotServiceResponse { #[serde(rename = "authEnabled", default, skip_serializing_if = "Option::is_none")] pub auth_enabled: Option, #[serde(rename = "imageDetails", default, skip_serializing_if = "Option::is_none")] - pub image_details: Option, + pub image_details: Option, #[serde(rename = "imageId", default, skip_serializing_if = "Option::is_none")] pub image_id: Option, } @@ -3178,7 +3204,7 @@ pub struct PaginatedServiceList { 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, @@ -3758,6 +3784,20 @@ pub mod service_response_base { Batch, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum ServiceResponseBaseUnion { + #[serde(rename = "ACI")] + Aci(AciServiceResponse), + #[serde(rename = "AKSENDPOINT")] + Aksendpoint(AksEndpointResponse), + #[serde(rename = "AMLCOMPUTE")] + Amlcompute(BatchServiceResponse), + #[serde(rename = "IOT")] + Iot(IotServiceResponse), + #[serde(rename = "UNKNOWON")] + Unknowon(UnknownServiceResponse), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SparkConfiguration { #[serde(default, skip_serializing_if = "Option::is_none")] diff --git a/services/svc/machinelearningservices/src/package_2019_09_preview/mod.rs b/services/svc/machinelearningservices/src/package_2019_09_preview/mod.rs index b7e9edec61..39d3da17f9 100644 --- a/services/svc/machinelearningservices/src/package_2019_09_preview/mod.rs +++ b/services/svc/machinelearningservices/src/package_2019_09_preview/mod.rs @@ -3920,7 +3920,7 @@ pub mod services { subscription_id: impl Into, resource_group: impl Into, workspace: impl Into, - request: impl Into, + request: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), @@ -4012,9 +4012,9 @@ pub mod services { #[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::ServiceResponseBase = serde_json::from_slice(&bytes)?; + let body: models::ServiceResponseBaseUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4098,8 +4098,8 @@ pub mod services { } } 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`."] @@ -4540,7 +4540,7 @@ pub mod services { pub(crate) subscription_id: String, pub(crate) resource_group: String, pub(crate) workspace: String, - pub(crate) request: models::CreateServiceRequest, + pub(crate) request: 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."] diff --git a/services/svc/machinelearningservices/src/package_2019_09_preview/models.rs b/services/svc/machinelearningservices/src/package_2019_09_preview/models.rs index 8935b896e0..92030cf9c3 100644 --- a/services/svc/machinelearningservices/src/package_2019_09_preview/models.rs +++ b/services/svc/machinelearningservices/src/package_2019_09_preview/models.rs @@ -279,7 +279,7 @@ pub struct AksServiceResponse { #[serde(flatten)] pub aks_variant_response: AksVariantResponse, #[serde(rename = "imageDetails", default, skip_serializing_if = "Option::is_none")] - pub image_details: Option, + pub image_details: Option, #[doc = "The Id of the Image."] #[serde(rename = "imageId", default, skip_serializing_if = "Option::is_none")] pub image_id: Option, @@ -1368,6 +1368,16 @@ pub mod create_service_request { Batch, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum CreateServiceRequestUnion { + #[serde(rename = "ACI")] + Aci(AciServiceCreateRequest), + #[serde(rename = "AKSENDPOINT")] + Aksendpoint(CreateEndpointRequest), + #[serde(rename = "IOT")] + Iot(CreateIotServiceRequest), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreatedBy { #[doc = "A user or service principal's object ID.\r\nThis is PII and should never be logged."] @@ -1998,7 +2008,7 @@ pub struct HyperDriveExperimentBase { #[doc = "Platform config object specifying the run definition structure."] pub platform_config: serde_json::Value, #[doc = "Early termination policy configuration."] - pub policy_config: HyperDrivePolicyConfigBase, + pub policy_config: HyperDrivePolicyConfigBaseUnion, #[doc = "Name of the primary metric and goal of optimizing."] pub primary_metric_config: hyper_drive_experiment_base::PrimaryMetricConfig, #[doc = "Study Id of the Hyperdrive run."] @@ -2011,7 +2021,7 @@ impl HyperDriveExperimentBase { name: String, platform: hyper_drive_experiment_base::Platform, platform_config: serde_json::Value, - policy_config: HyperDrivePolicyConfigBase, + policy_config: HyperDrivePolicyConfigBaseUnion, primary_metric_config: hyper_drive_experiment_base::PrimaryMetricConfig, ) -> Self { Self { @@ -2284,6 +2294,14 @@ pub mod hyper_drive_policy_config_base { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "name")] +pub enum HyperDrivePolicyConfigBaseUnion { + Bandit(HyperDriveBanditPolicy), + Default(HyperDriveDefaultPolicy), + MedianStopping(HyperDriveMedianStoppingPolicy), + TruncationSelection(HyperDriveTruncationSelectionPolicy), +} #[doc = "Truncation selection policy configuration. Please refer https://docs.microsoft.com/en-us/python/api/azureml-train-core/azureml.train.hyperdrive.truncationselectionpolicy?view=azure-ml-py for more information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HyperDriveTruncationSelectionPolicy { @@ -2443,6 +2461,14 @@ pub mod image_response_base { TimedOut, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "imageFlavor")] +pub enum ImageResponseBaseUnion { + #[serde(rename = "WEBAPICONTAINER")] + Webapicontainer(DockerImageResponse), + #[serde(rename = "ACCELCONTAINER")] + Accelcontainer(FpgaDockerImageResponse), +} #[doc = "A nested structure of errors."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InnerErrorResponse { @@ -2512,7 +2538,7 @@ pub struct IotServiceResponse { #[serde(rename = "authEnabled", default, skip_serializing_if = "Option::is_none")] pub auth_enabled: Option, #[serde(rename = "imageDetails", default, skip_serializing_if = "Option::is_none")] - pub image_details: Option, + pub image_details: Option, #[serde(rename = "imageId", default, skip_serializing_if = "Option::is_none")] pub image_id: Option, } @@ -3178,7 +3204,7 @@ pub struct PaginatedServiceList { 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, @@ -3758,6 +3784,20 @@ pub mod service_response_base { Batch, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum ServiceResponseBaseUnion { + #[serde(rename = "ACI")] + Aci(AciServiceResponse), + #[serde(rename = "AKSENDPOINT")] + Aksendpoint(AksEndpointResponse), + #[serde(rename = "AMLCOMPUTE")] + Amlcompute(BatchServiceResponse), + #[serde(rename = "IOT")] + Iot(IotServiceResponse), + #[serde(rename = "UNKNOWON")] + Unknowon(UnknownServiceResponse), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SparkConfiguration { #[serde(default, skip_serializing_if = "Option::is_none")] diff --git a/services/svc/purview/src/package_2023_02_15_preview/mod.rs b/services/svc/purview/src/package_2023_02_15_preview/mod.rs index 2b33378cbf..8380bfe848 100644 --- a/services/svc/purview/src/package_2023_02_15_preview/mod.rs +++ b/services/svc/purview/src/package_2023_02_15_preview/mod.rs @@ -138,7 +138,7 @@ pub mod received_shares { pub fn create_or_replace( &self, received_share_id: impl Into, - received_share: impl Into, + received_share: impl Into, ) -> create_or_replace::RequestBuilder { create_or_replace::RequestBuilder { client: self.0.clone(), @@ -214,9 +214,9 @@ pub mod received_shares { #[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::ReceivedShare = serde_json::from_slice(&bytes)?; + let body: models::ReceivedShareUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -293,8 +293,8 @@ pub mod received_shares { } } 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`."] @@ -314,9 +314,9 @@ pub mod received_shares { #[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::ReceivedShare = serde_json::from_slice(&bytes)?; + let body: models::ReceivedShareUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -367,7 +367,7 @@ pub mod received_shares { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) received_share_id: String, - pub(crate) received_share: models::ReceivedShare, + pub(crate) received_share: models::ReceivedShareUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -404,8 +404,8 @@ pub mod received_shares { } } 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."] @@ -1134,7 +1134,7 @@ pub mod sent_shares { pub fn create_or_replace( &self, sent_share_id: impl Into, - sent_share: impl Into, + sent_share: impl Into, ) -> create_or_replace::RequestBuilder { create_or_replace::RequestBuilder { client: self.0.clone(), @@ -1195,7 +1195,7 @@ pub mod sent_shares { &self, sent_share_id: impl Into, sent_share_invitation_id: impl Into, - sent_share_invitation: impl Into, + sent_share_invitation: impl Into, ) -> create_invitation::RequestBuilder { create_invitation::RequestBuilder { client: self.0.clone(), @@ -1396,9 +1396,9 @@ pub mod sent_shares { #[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::SentShare = serde_json::from_slice(&bytes)?; + let body: models::SentShareUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1475,8 +1475,8 @@ pub mod sent_shares { } } 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`."] @@ -1496,9 +1496,9 @@ pub mod sent_shares { #[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::SentShare = serde_json::from_slice(&bytes)?; + let body: models::SentShareUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1549,7 +1549,7 @@ pub mod sent_shares { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) sent_share_id: String, - pub(crate) sent_share: models::SentShare, + pub(crate) sent_share: models::SentShareUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1586,8 +1586,8 @@ pub mod sent_shares { } } 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."] @@ -1921,9 +1921,9 @@ pub mod sent_shares { #[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::SentShareInvitation = serde_json::from_slice(&bytes)?; + let body: models::SentShareInvitationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2006,8 +2006,8 @@ pub mod sent_shares { } } 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`."] @@ -2027,9 +2027,9 @@ pub mod sent_shares { #[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::SentShareInvitation = serde_json::from_slice(&bytes)?; + let body: models::SentShareInvitationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2072,7 +2072,7 @@ pub mod sent_shares { pub(crate) client: super::super::Client, pub(crate) sent_share_id: String, pub(crate) sent_share_invitation_id: String, - pub(crate) sent_share_invitation: models::SentShareInvitation, + pub(crate) sent_share_invitation: models::SentShareInvitationUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2114,8 +2114,8 @@ pub mod sent_shares { } } 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`."] @@ -2278,9 +2278,9 @@ pub mod sent_shares { #[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::SentShareInvitation = serde_json::from_slice(&bytes)?; + let body: models::SentShareInvitationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2373,8 +2373,8 @@ pub mod sent_shares { } } 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`."] diff --git a/services/svc/purview/src/package_2023_02_15_preview/models.rs b/services/svc/purview/src/package_2023_02_15_preview/models.rs index 385efcbbcd..75a34490c1 100644 --- a/services/svc/purview/src/package_2023_02_15_preview/models.rs +++ b/services/svc/purview/src/package_2023_02_15_preview/models.rs @@ -86,6 +86,12 @@ impl Artifact { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "storeKind")] +pub enum ArtifactUnion { + AdlsGen2Account(AdlsGen2Artifact), + BlobAccount(BlobStorageArtifact), +} #[doc = "Blob Sink"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BlobAccountSink { @@ -214,7 +220,7 @@ pub struct InPlaceReceivedShareProperties { pub share_status: Option, #[doc = "Holds details on the destination of the mapped artifact"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub sink: Option, + pub sink: Option, #[doc = "State of the resource"] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, @@ -241,7 +247,7 @@ impl InPlaceSentShare { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InPlaceSentShareProperties { #[doc = "A class for sent share artifact."] - pub artifact: Artifact, + pub artifact: ArtifactUnion, #[doc = "Time at which the sent share was created. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)"] #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] pub created_at: Option, @@ -273,7 +279,7 @@ pub struct InPlaceSentShareProperties { pub state: Option, } impl InPlaceSentShareProperties { - pub fn new(artifact: Artifact, display_name: String) -> Self { + pub fn new(artifact: ArtifactUnion, display_name: String) -> Self { Self { artifact, created_at: None, @@ -473,6 +479,11 @@ impl ReceivedShare { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "shareKind")] +pub enum ReceivedShareUnion { + InPlace(InPlaceReceivedShare), +} #[doc = "List of received shares."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReceivedShareList { @@ -480,7 +491,7 @@ pub struct ReceivedShareList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for ReceivedShareList { type Continuation = String; @@ -489,7 +500,7 @@ impl azure_core::Continuable for ReceivedShareList { } } impl ReceivedShareList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -545,6 +556,11 @@ impl SentShare { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "shareKind")] +pub enum SentShareUnion { + InPlace(InPlaceSentShare), +} #[doc = "A sent share invitation data transfer object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SentShareInvitation { @@ -562,6 +578,12 @@ impl SentShareInvitation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "invitationKind")] +pub enum SentShareInvitationUnion { + Service(ServiceInvitation), + User(UserInvitation), +} #[doc = "List of the sent share invitations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SentShareInvitationList { @@ -569,7 +591,7 @@ pub struct SentShareInvitationList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SentShareInvitationList { type Continuation = String; @@ -578,7 +600,7 @@ impl azure_core::Continuable for SentShareInvitationList { } } impl SentShareInvitationList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -589,7 +611,7 @@ pub struct SentShareList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type DataTransferObjects."] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SentShareList { type Continuation = String; @@ -598,7 +620,7 @@ impl azure_core::Continuable for SentShareList { } } impl SentShareList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -754,6 +776,12 @@ impl Sink { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "storeKind")] +pub enum SinkUnion { + AdlsGen2Account(AdlsGen2AccountSink), + BlobAccount(BlobAccountSink), +} #[doc = "State of the resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "State")] diff --git a/services/svc/purview/src/package_2023_05_30_preview/mod.rs b/services/svc/purview/src/package_2023_05_30_preview/mod.rs index cf3a5794eb..36726d745f 100644 --- a/services/svc/purview/src/package_2023_05_30_preview/mod.rs +++ b/services/svc/purview/src/package_2023_05_30_preview/mod.rs @@ -141,7 +141,7 @@ pub mod received_shares { pub fn create_or_replace( &self, received_share_id: impl Into, - received_share: impl Into, + received_share: impl Into, ) -> create_or_replace::RequestBuilder { create_or_replace::RequestBuilder { client: self.0.clone(), @@ -215,9 +215,9 @@ pub mod received_shares { #[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::ReceivedShare = serde_json::from_slice(&bytes)?; + let body: models::ReceivedShareUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -294,8 +294,8 @@ pub mod received_shares { } } 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`."] @@ -315,9 +315,9 @@ pub mod received_shares { #[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::ReceivedShare = serde_json::from_slice(&bytes)?; + let body: models::ReceivedShareUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -368,7 +368,7 @@ pub mod received_shares { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) received_share_id: String, - pub(crate) received_share: models::ReceivedShare, + pub(crate) received_share: models::ReceivedShareUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -405,8 +405,8 @@ pub mod received_shares { } } 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."] @@ -1116,7 +1116,7 @@ pub mod sent_shares { pub fn create_or_replace( &self, sent_share_id: impl Into, - sent_share: impl Into, + sent_share: impl Into, ) -> create_or_replace::RequestBuilder { create_or_replace::RequestBuilder { client: self.0.clone(), @@ -1176,7 +1176,7 @@ pub mod sent_shares { &self, sent_share_id: impl Into, sent_share_invitation_id: impl Into, - sent_share_invitation: impl Into, + sent_share_invitation: impl Into, ) -> create_invitation::RequestBuilder { create_invitation::RequestBuilder { client: self.0.clone(), @@ -1368,9 +1368,9 @@ pub mod sent_shares { #[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::SentShare = serde_json::from_slice(&bytes)?; + let body: models::SentShareUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1447,8 +1447,8 @@ pub mod sent_shares { } } 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`."] @@ -1468,9 +1468,9 @@ pub mod sent_shares { #[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::SentShare = serde_json::from_slice(&bytes)?; + let body: models::SentShareUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1521,7 +1521,7 @@ pub mod sent_shares { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) sent_share_id: String, - pub(crate) sent_share: models::SentShare, + pub(crate) sent_share: models::SentShareUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1558,8 +1558,8 @@ pub mod sent_shares { } } 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."] @@ -1884,9 +1884,9 @@ pub mod sent_shares { #[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::SentShareInvitation = serde_json::from_slice(&bytes)?; + let body: models::SentShareInvitationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1969,8 +1969,8 @@ pub mod sent_shares { } } 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`."] @@ -1990,9 +1990,9 @@ pub mod sent_shares { #[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::SentShareInvitation = serde_json::from_slice(&bytes)?; + let body: models::SentShareInvitationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2035,7 +2035,7 @@ pub mod sent_shares { pub(crate) client: super::super::Client, pub(crate) sent_share_id: String, pub(crate) sent_share_invitation_id: String, - pub(crate) sent_share_invitation: models::SentShareInvitation, + pub(crate) sent_share_invitation: models::SentShareInvitationUnion, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2077,8 +2077,8 @@ pub mod sent_shares { } } 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`."] @@ -2241,9 +2241,9 @@ pub mod sent_shares { #[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::SentShareInvitation = serde_json::from_slice(&bytes)?; + let body: models::SentShareInvitationUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2336,8 +2336,8 @@ pub mod sent_shares { } } 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`."] diff --git a/services/svc/purview/src/package_2023_05_30_preview/models.rs b/services/svc/purview/src/package_2023_05_30_preview/models.rs index 5e77b481f1..379ca5776e 100644 --- a/services/svc/purview/src/package_2023_05_30_preview/models.rs +++ b/services/svc/purview/src/package_2023_05_30_preview/models.rs @@ -86,6 +86,12 @@ impl Artifact { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "storeKind")] +pub enum ArtifactUnion { + AdlsGen2Account(AdlsGen2Artifact), + BlobAccount(BlobStorageArtifact), +} #[doc = "Blob Sink"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BlobAccountSink { @@ -214,7 +220,7 @@ pub struct InPlaceReceivedShareProperties { pub share_status: Option, #[doc = "Holds details on the destination of the mapped artifact"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub sink: Option, + pub sink: Option, #[doc = "State of the resource"] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, @@ -241,7 +247,7 @@ impl InPlaceSentShare { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InPlaceSentShareProperties { #[doc = "A class for sent share artifact."] - pub artifact: Artifact, + pub artifact: ArtifactUnion, #[doc = "Time at which the sent share was created. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)"] #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] pub created_at: Option, @@ -273,7 +279,7 @@ pub struct InPlaceSentShareProperties { pub state: Option, } impl InPlaceSentShareProperties { - pub fn new(artifact: Artifact, display_name: String) -> Self { + pub fn new(artifact: ArtifactUnion, display_name: String) -> Self { Self { artifact, created_at: None, @@ -473,6 +479,11 @@ impl ReceivedShare { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "shareKind")] +pub enum ReceivedShareUnion { + InPlace(InPlaceReceivedShare), +} #[doc = "List of received shares."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReceivedShareList { @@ -480,7 +491,7 @@ pub struct ReceivedShareList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type ReceivedShare"] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for ReceivedShareList { type Continuation = String; @@ -489,7 +500,7 @@ impl azure_core::Continuable for ReceivedShareList { } } impl ReceivedShareList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -545,6 +556,11 @@ impl SentShare { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "shareKind")] +pub enum SentShareUnion { + InPlace(InPlaceSentShare), +} #[doc = "A sent share invitation data transfer object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SentShareInvitation { @@ -562,6 +578,12 @@ impl SentShareInvitation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "invitationKind")] +pub enum SentShareInvitationUnion { + Service(ServiceInvitation), + User(UserInvitation), +} #[doc = "List of the sent share invitations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SentShareInvitationList { @@ -569,7 +591,7 @@ pub struct SentShareInvitationList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type SentShareInvitation"] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SentShareInvitationList { type Continuation = String; @@ -578,7 +600,7 @@ impl azure_core::Continuable for SentShareInvitationList { } } impl SentShareInvitationList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -589,7 +611,7 @@ pub struct SentShareList { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, #[doc = "Collection of items of type SentShare"] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for SentShareList { type Continuation = String; @@ -598,7 +620,7 @@ impl azure_core::Continuable for SentShareList { } } impl SentShareList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { next_link: None, value } } } @@ -797,6 +819,12 @@ impl Sink { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "storeKind")] +pub enum SinkUnion { + AdlsGen2Account(AdlsGen2AccountSink), + BlobAccount(BlobAccountSink), +} #[doc = "State of the resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "State")] diff --git a/services/svc/quantum/src/package_2022_09_12_preview/models.rs b/services/svc/quantum/src/package_2022_09_12_preview/models.rs index db292abeda..5caf2dd0e0 100644 --- a/services/svc/quantum/src/package_2022_09_12_preview/models.rs +++ b/services/svc/quantum/src/package_2022_09_12_preview/models.rs @@ -143,10 +143,16 @@ pub mod item_details { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "itemType")] +pub enum ItemDetailsUnion { + Job(JobDetails), + Session(SessionDetails), +} #[doc = "List of item details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ItemDetailsList { - pub value: Vec, + pub value: Vec, #[doc = "Link to the next page of results."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -158,7 +164,7 @@ impl azure_core::Continuable for ItemDetailsList { } } impl ItemDetailsList { - pub fn new(value: Vec) -> Self { + pub fn new(value: Vec) -> Self { Self { value, next_link: None } } } diff --git a/services/svc/servicefabric/src/v7_1/mod.rs b/services/svc/servicefabric/src/v7_1/mod.rs index 5ffa6e24a6..0be29e5895 100644 --- a/services/svc/servicefabric/src/v7_1/mod.rs +++ b/services/svc/servicefabric/src/v7_1/mod.rs @@ -627,7 +627,7 @@ impl Client { #[doc = "* `provision_application_type_description_base_required_body_param`: The base type of provision application type description which supports either image store-based provision or external store-based provision."] pub fn provision_application_type( &self, - provision_application_type_description_base_required_body_param: impl Into, + provision_application_type_description_base_required_body_param: impl Into, ) -> provision_application_type::RequestBuilder { provision_application_type::RequestBuilder { client: self.clone(), @@ -1120,7 +1120,7 @@ impl Client { pub fn create_service( &self, application_id: impl Into, - service_description: impl Into, + service_description: impl Into, ) -> create_service::RequestBuilder { create_service::RequestBuilder { client: self.clone(), @@ -1169,7 +1169,7 @@ impl Client { pub fn update_service( &self, service_id: impl Into, - service_update_description: impl Into, + service_update_description: impl Into, ) -> update_service::RequestBuilder { update_service::RequestBuilder { client: self.clone(), @@ -7692,7 +7692,7 @@ pub mod provision_application_type { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::Client, - pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBase, + pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBaseUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -10895,9 +10895,9 @@ pub mod get_service_info { #[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::ServiceInfo = serde_json::from_slice(&bytes)?; + let body: models::ServiceInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10988,8 +10988,8 @@ pub mod get_service_info { } } 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`."] @@ -11160,7 +11160,7 @@ pub mod create_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) application_id: String, - pub(crate) service_description: models::ServiceDescription, + pub(crate) service_description: models::ServiceDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11457,7 +11457,7 @@ pub mod update_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) service_id: String, - pub(crate) service_update_description: models::ServiceUpdateDescription, + pub(crate) service_update_description: models::ServiceUpdateDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11511,9 +11511,9 @@ pub mod get_service_description { #[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::ServiceDescription = serde_json::from_slice(&bytes)?; + let body: models::ServiceDescriptionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11602,8 +11602,8 @@ pub mod get_service_description { } } 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`."] @@ -12412,9 +12412,9 @@ pub mod get_partition_info { #[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::ServicePartitionInfo = serde_json::from_slice(&bytes)?; + let body: models::ServicePartitionInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12499,8 +12499,8 @@ pub mod get_partition_info { } } 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`."] @@ -14671,9 +14671,9 @@ pub mod get_replica_info { #[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::ReplicaInfo = serde_json::from_slice(&bytes)?; + let body: models::ReplicaInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14764,8 +14764,8 @@ pub mod get_replica_info { } } 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`."] @@ -14785,9 +14785,9 @@ pub mod get_replica_health { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14889,8 +14889,8 @@ pub mod get_replica_health { } } 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`."] @@ -14910,9 +14910,9 @@ pub mod get_replica_health_using_policy { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15025,8 +15025,8 @@ pub mod get_replica_health_using_policy { } } 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`."] @@ -15291,9 +15291,9 @@ pub mod get_deployed_service_replica_detail_info { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15386,8 +15386,8 @@ pub mod get_deployed_service_replica_detail_info { } } 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`."] @@ -15407,9 +15407,9 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15500,8 +15500,8 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { } } 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`."] diff --git a/services/svc/servicefabric/src/v7_1/models.rs b/services/svc/servicefabric/src/v7_1/models.rs index a23c6d05be..ac19dab623 100644 --- a/services/svc/servicefabric/src/v7_1/models.rs +++ b/services/svc/servicefabric/src/v7_1/models.rs @@ -1126,10 +1126,10 @@ pub struct ApplicationScopedVolume { pub volume_reference: VolumeReference, #[doc = "Describes parameters for creating application-scoped volumes."] #[serde(rename = "creationParameters")] - pub creation_parameters: ApplicationScopedVolumeCreationParameters, + pub creation_parameters: ApplicationScopedVolumeCreationParametersUnion, } impl ApplicationScopedVolume { - pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParameters) -> Self { + pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParametersUnion) -> Self { Self { volume_reference, creation_parameters, @@ -1150,6 +1150,11 @@ impl ApplicationScopedVolumeCreationParameters { Self { kind, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ApplicationScopedVolumeCreationParametersUnion { + ServiceFabricVolumeDisk(ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk), +} #[doc = "Describes parameters for creating application-scoped volumes provided by Service Fabric Volume Disks"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk { @@ -1859,6 +1864,11 @@ impl AutoScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMechanismUnion { + AddRemoveReplica(AddRemoveReplicaScalingMechanism), +} #[doc = "Enumerates the mechanisms for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMechanismKind")] @@ -1905,6 +1915,11 @@ impl AutoScalingMetric { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMetricUnion { + Resource(AutoScalingResourceMetric), +} #[doc = "Enumerates the metrics that are used for triggering auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMetricKind")] @@ -1946,12 +1961,12 @@ pub struct AutoScalingPolicy { #[doc = "The name of the auto scaling policy."] pub name: String, #[doc = "Describes the trigger for performing auto scaling operation."] - pub trigger: AutoScalingTrigger, + pub trigger: AutoScalingTriggerUnion, #[doc = "Describes the mechanism for performing auto scaling operation. Derived classes will describe the actual mechanism."] - pub mechanism: AutoScalingMechanism, + pub mechanism: AutoScalingMechanismUnion, } impl AutoScalingPolicy { - pub fn new(name: String, trigger: AutoScalingTrigger, mechanism: AutoScalingMechanism) -> Self { + pub fn new(name: String, trigger: AutoScalingTriggerUnion, mechanism: AutoScalingMechanismUnion) -> Self { Self { name, trigger, mechanism } } } @@ -2018,6 +2033,11 @@ impl AutoScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingTriggerUnion { + AverageLoad(AverageLoadScalingTrigger), +} #[doc = "Enumerates the triggers for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingTriggerKind")] @@ -2059,7 +2079,7 @@ pub struct AverageLoadScalingTrigger { #[serde(flatten)] pub auto_scaling_trigger: AutoScalingTrigger, #[doc = "Describes the metric that is used for triggering auto scaling operation. Derived classes will describe resources or metrics."] - pub metric: AutoScalingMetric, + pub metric: AutoScalingMetricUnion, #[doc = "Lower load threshold (if average load is below this threshold, service will scale down)."] #[serde(rename = "lowerLoadThreshold")] pub lower_load_threshold: f64, @@ -2073,7 +2093,7 @@ pub struct AverageLoadScalingTrigger { impl AverageLoadScalingTrigger { pub fn new( auto_scaling_trigger: AutoScalingTrigger, - metric: AutoScalingMetric, + metric: AutoScalingMetricUnion, lower_load_threshold: f64, upper_load_threshold: f64, scale_interval_in_seconds: i64, @@ -2237,6 +2257,13 @@ impl BackupConfigurationInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum BackupConfigurationInfoUnion { + Application(ApplicationBackupConfigurationInfo), + Partition(PartitionBackupConfigurationInfo), + Service(ServiceBackupConfigurationInfo), +} #[doc = "Describes the Service Fabric entity that is configured for backup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupEntity { @@ -2249,6 +2276,13 @@ impl BackupEntity { Self { entity_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "EntityKind")] +pub enum BackupEntityUnion { + Application(ApplicationBackupEntity), + Partition(PartitionBackupEntity), + Service(ServiceBackupEntity), +} #[doc = "The entity type of a Service Fabric entity such as Application, Service or a Partition where periodic backups can be enabled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupEntityKind")] @@ -2307,7 +2341,7 @@ pub struct BackupInfo { pub service_name: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, #[doc = "Location of the backup, relative to the backup store."] #[serde(rename = "BackupLocation", default, skip_serializing_if = "Option::is_none")] pub backup_location: Option, @@ -2340,7 +2374,7 @@ impl BackupInfo { pub struct BackupPartitionDescription { #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl BackupPartitionDescription { pub fn new() -> Self { @@ -2361,21 +2395,21 @@ pub struct BackupPolicyDescription { pub max_incremental_backups: i64, #[doc = "Describes the backup schedule parameters."] #[serde(rename = "Schedule")] - pub schedule: BackupScheduleDescription, + pub schedule: BackupScheduleDescriptionUnion, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the retention policy configured."] #[serde(rename = "RetentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl BackupPolicyDescription { pub fn new( name: String, auto_restore_on_data_loss: bool, max_incremental_backups: i64, - schedule: BackupScheduleDescription, - storage: BackupStorageDescription, + schedule: BackupScheduleDescriptionUnion, + storage: BackupStorageDescriptionUnion, ) -> Self { Self { name, @@ -2470,6 +2504,12 @@ impl BackupScheduleDescription { Self { schedule_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ScheduleKind")] +pub enum BackupScheduleDescriptionUnion { + FrequencyBased(FrequencyBasedBackupScheduleDescription), + TimeBased(TimeBasedBackupScheduleDescription), +} #[doc = "Describes the frequency with which to run the time based backup schedule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupScheduleFrequencyType")] @@ -2611,6 +2651,12 @@ impl BackupStorageDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "StorageKind")] +pub enum BackupStorageDescriptionUnion { + AzureBlobStore(AzureBlobBackupStorageDescription), + FileShare(FileShareBackupStorageDescription), +} #[doc = "The kind of backup storage, where backups are saved."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupStorageKind")] @@ -2879,6 +2925,16 @@ impl ChaosEvent { Self { kind, time_stamp_utc } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ChaosEventUnion { + ExecutingFaults(ExecutingFaultsChaosEvent), + Started(StartedChaosEvent), + Stopped(StoppedChaosEvent), + TestError(TestErrorChaosEvent), + ValidationFailed(ValidationFailedChaosEvent), + Waiting(WaitingChaosEvent), +} pub type ChaosEventHistory = Vec; #[doc = "The kind of Chaos event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -2932,7 +2988,7 @@ impl Serialize for ChaosEventKind { pub struct ChaosEventWrapper { #[doc = "Represents an event generated during a Chaos run."] #[serde(rename = "ChaosEvent", default, skip_serializing_if = "Option::is_none")] - pub chaos_event: Option, + pub chaos_event: Option, } impl ChaosEventWrapper { pub fn new() -> Self { @@ -3495,10 +3551,10 @@ pub struct CheckValuePropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl CheckValuePropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -5805,6 +5861,12 @@ impl DeployedServiceReplicaDetailInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaDetailInfoUnion { + Stateful(DeployedStatefulServiceReplicaDetailInfo), + Stateless(DeployedStatelessServiceInstanceDetailInfo), +} #[doc = "Information about a Service Fabric service replica deployed on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeployedServiceReplicaInfo { @@ -5855,6 +5917,12 @@ impl DeployedServiceReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaInfoUnion { + Stateful(DeployedStatefulServiceReplicaInfo), + Stateless(DeployedStatelessServiceInstanceInfo), +} pub type DeployedServiceReplicaInfoList = Vec; #[doc = "Information about service type deployed on a node, information such as the status of the service type registration on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] @@ -5900,7 +5968,7 @@ pub struct DeployedStatefulServiceReplicaDetailInfo { pub write_status: Option, #[doc = "Represents a base class for primary or secondary replicator status.\nContains information about the service fabric replicator like the replication/copy queue utilization, last acknowledgement received timestamp, etc."] #[serde(rename = "ReplicatorStatus", default, skip_serializing_if = "Option::is_none")] - pub replicator_status: Option, + pub replicator_status: Option, #[doc = "Key value store related information for the replica."] #[serde(rename = "ReplicaStatus", default, skip_serializing_if = "Option::is_none")] pub replica_status: Option, @@ -6044,7 +6112,7 @@ pub struct DiagnosticsDescription { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, #[doc = "Status of whether or not sinks are enabled."] #[serde(default, skip_serializing_if = "Option::is_none")] pub enabled: Option, @@ -6142,6 +6210,11 @@ impl DiagnosticsSinkProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DiagnosticsSinkPropertiesUnion { + AzureInternalMonitoringPipeline(AzureInternalMonitoringPipelineSinkDescription), +} #[doc = "It describes the body parameters while disabling backup of a backup entity(Application/Service/Partition)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DisableBackupDescription { @@ -6549,6 +6622,12 @@ impl ExecutionPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ExecutionPolicyUnion { + Default(DefaultExecutionPolicy), + RunToCompletion(RunToCompletionExecutionPolicy), +} #[doc = "Enumerates the execution policy types for services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ExecutionPolicyType")] @@ -7087,6 +7166,17 @@ impl FabricEvent { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum FabricEventUnion { + ApplicationEvent(ApplicationEvent), + ClusterEvent(ClusterEvent), + ContainerInstanceEvent(ContainerInstanceEvent), + NodeEvent(NodeEvent), + PartitionEvent(PartitionEvent), + ReplicaEvent(ReplicaEvent), + ServiceEvent(ServiceEvent), +} #[doc = "The kind of FabricEvent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "FabricEventKind")] @@ -7683,13 +7773,13 @@ pub struct GetBackupByStorageQueryDescription { pub latest: Option, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the Service Fabric entity that is configured for backup."] #[serde(rename = "BackupEntity")] - pub backup_entity: BackupEntity, + pub backup_entity: BackupEntityUnion, } impl GetBackupByStorageQueryDescription { - pub fn new(storage: BackupStorageDescription, backup_entity: BackupEntity) -> Self { + pub fn new(storage: BackupStorageDescriptionUnion, backup_entity: BackupEntityUnion) -> Self { Self { start_date_time_filter: None, end_date_time_filter: None, @@ -7755,6 +7845,30 @@ impl HealthEvaluation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum HealthEvaluationUnion { + Application(ApplicationHealthEvaluation), + ApplicationTypeApplications(ApplicationTypeApplicationsHealthEvaluation), + Applications(ApplicationsHealthEvaluation), + DeltaNodesCheck(DeltaNodesCheckHealthEvaluation), + DeployedApplication(DeployedApplicationHealthEvaluation), + DeployedApplications(DeployedApplicationsHealthEvaluation), + DeployedServicePackage(DeployedServicePackageHealthEvaluation), + DeployedServicePackages(DeployedServicePackagesHealthEvaluation), + Event(EventHealthEvaluation), + Node(NodeHealthEvaluation), + Nodes(NodesHealthEvaluation), + Partition(PartitionHealthEvaluation), + Partitions(PartitionsHealthEvaluation), + Replica(ReplicaHealthEvaluation), + Replicas(ReplicasHealthEvaluation), + Service(ServiceHealthEvaluation), + Services(ServicesHealthEvaluation), + SystemApplication(SystemApplicationHealthEvaluation), + UpgradeDomainDeltaNodesCheck(UpgradeDomainDeltaNodesCheckHealthEvaluation), + UpgradeDomainNodes(UpgradeDomainNodesHealthEvaluation), +} #[doc = "The health manager in the cluster performs health evaluations in determining the aggregated health state of an entity. This enumeration provides information on the kind of evaluation that was performed. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "HealthEvaluationKind")] @@ -7843,7 +7957,7 @@ impl Serialize for HealthEvaluationKind { pub struct HealthEvaluationWrapper { #[doc = "Represents a health evaluation which describes the data and the algorithm used by health manager to evaluate the health of an entity."] #[serde(rename = "HealthEvaluation", default, skip_serializing_if = "Option::is_none")] - pub health_evaluation: Option, + pub health_evaluation: Option, } impl HealthEvaluationWrapper { pub fn new() -> Self { @@ -8982,6 +9096,9 @@ impl NetworkResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum NetworkResourcePropertiesBaseUnion {} pub type NextUpgradeDomain = String; #[doc = "Node Aborted event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -10488,7 +10605,7 @@ pub struct PagedBackupConfigurationInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupConfigurationInfoList { pub fn new() -> Self { @@ -10508,7 +10625,7 @@ pub struct PagedBackupEntityList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupEntityList { pub fn new() -> Self { @@ -10691,7 +10808,7 @@ pub struct PagedReplicaInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedReplicaInfoList { pub fn new() -> Self { @@ -10751,7 +10868,7 @@ pub struct PagedServiceInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServiceInfoList { pub fn new() -> Self { @@ -10771,7 +10888,7 @@ pub struct PagedServicePartitionInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServicePartitionInfoList { pub fn new() -> Self { @@ -11008,7 +11125,7 @@ pub struct PartitionHealth { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub replica_health_states: Vec, + pub replica_health_states: Vec, } impl PartitionHealth { pub fn new() -> Self { @@ -11181,6 +11298,13 @@ impl PartitionInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServicePartitionKind")] +pub enum PartitionInformationUnion { + Int64Range(Int64RangePartitionInformation), + Named(NamedPartitionInformation), + Singleton(SingletonPartitionInformation), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -11514,6 +11638,13 @@ impl PartitionSchemeDescription { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "PartitionScheme")] +pub enum PartitionSchemeDescriptionUnion { + Named(NamedPartitionSchemeDescription), + Singleton(SingletonPartitionSchemeDescription), + UniformInt64Range(UniformInt64RangePartitionSchemeDescription), +} #[doc = "Represents health evaluation for the partitions of a service, containing health evaluations for each unhealthy partition that impacts current aggregated health state. Can be returned when evaluating service health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionsHealthEvaluation { @@ -11718,7 +11849,7 @@ pub struct PropertyBatchDescriptionList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub operations: Vec, + pub operations: Vec, } impl PropertyBatchDescriptionList { pub fn new() -> Self { @@ -11737,6 +11868,12 @@ impl PropertyBatchInfo { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchInfoUnion { + Failed(FailedPropertyBatchInfo), + Successful(SuccessfulPropertyBatchInfo), +} #[doc = "The kind of property batch info, determined by the results of a property batch. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchInfoKind")] @@ -11791,6 +11928,16 @@ impl PropertyBatchOperation { Self { kind, property_name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchOperationUnion { + CheckExists(CheckExistsPropertyBatchOperation), + CheckSequence(CheckSequencePropertyBatchOperation), + CheckValue(CheckValuePropertyBatchOperation), + Delete(DeletePropertyBatchOperation), + Get(GetPropertyBatchOperation), + Put(PutPropertyBatchOperation), +} #[doc = "The kind of property batch operation, determined by the operation to be performed. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchOperationKind")] @@ -11850,10 +11997,10 @@ pub struct PropertyDescription { pub custom_type_id: Option, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl PropertyDescription { - pub fn new(property_name: PropertyName, value: PropertyValue) -> Self { + pub fn new(property_name: PropertyName, value: PropertyValueUnion) -> Self { Self { property_name, custom_type_id: None, @@ -11869,7 +12016,7 @@ pub struct PropertyInfo { pub name: PropertyName, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value", default, skip_serializing_if = "Option::is_none")] - pub value: Option, + pub value: Option, #[doc = "The metadata associated with a property, including the property's name."] #[serde(rename = "Metadata")] pub metadata: PropertyMetadata, @@ -11923,6 +12070,15 @@ impl PropertyValue { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyValueUnion { + Binary(BinaryPropertyValue), + Double(DoublePropertyValue), + Guid(GuidPropertyValue), + Int64(Int64PropertyValue), + String(StringPropertyValue), +} #[doc = "The kind of property, determined by the type of data. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyValueKind")] @@ -12007,6 +12163,12 @@ impl ProvisionApplicationTypeDescriptionBase { Self { kind, async_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ProvisionApplicationTypeDescriptionBaseUnion { + ExternalStore(ExternalStoreProvisionApplicationTypeDescription), + ImageStorePath(ProvisionApplicationTypeDescription), +} #[doc = "The kind of application type registration or provision requested. The application package can be registered or provisioned either from the image store or from an external store. Following are the kinds of the application type provision."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ProvisionApplicationTypeKind")] @@ -12068,13 +12230,13 @@ pub struct PutPropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, #[doc = "The property's custom type ID. Using this property, the user is able to tag the type of the value of the property."] #[serde(rename = "CustomTypeId", default, skip_serializing_if = "Option::is_none")] pub custom_type_id: Option, } impl PutPropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -12318,6 +12480,11 @@ impl RepairImpactDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairImpactDescriptionBaseUnion { + Node(NodeRepairImpactDescription), +} #[doc = "Specifies the kind of the impact. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairImpactKind")] @@ -12367,6 +12534,11 @@ impl RepairTargetDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairTargetDescriptionBaseUnion { + Node(NodeRepairTargetDescription), +} #[doc = "Specifies the kind of the repair target. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairTargetKind")] @@ -12427,7 +12599,7 @@ pub struct RepairTask { pub action: String, #[doc = "Describes the entities targeted by a repair action.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Target", default, skip_serializing_if = "Option::is_none")] - pub target: Option, + pub target: Option, #[doc = "The name of the repair executor. Must be specified in Claimed and later states, and is immutable once set."] #[serde(rename = "Executor", default, skip_serializing_if = "Option::is_none")] pub executor: Option, @@ -12436,7 +12608,7 @@ pub struct RepairTask { pub executor_data: Option, #[doc = "Describes the expected impact of executing a repair task.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Impact", default, skip_serializing_if = "Option::is_none")] - pub impact: Option, + pub impact: Option, #[doc = "A value describing the overall result of the repair task execution. Must be specified in the Restoring and later states, and is immutable once set."] #[serde(rename = "ResultStatus", default, skip_serializing_if = "Option::is_none")] pub result_status: Option, @@ -12818,6 +12990,12 @@ impl ReplicaHealth { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthUnion { + Stateful(StatefulServiceReplicaHealth), + Stateless(StatelessServiceInstanceHealth), +} #[doc = "Represents health evaluation for a replica, containing information about the data and the algorithm used by health store to evaluate health. The evaluation is returned only when the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicaHealthEvaluation { @@ -12864,6 +13042,12 @@ impl ReplicaHealthState { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthStateUnion { + Stateful(StatefulServiceReplicaHealthState), + Stateless(StatelessServiceInstanceHealthState), +} #[doc = "Represents the health state chunk of a stateful service replica or a stateless service instance.\nThe replica health state contains the replica ID and its aggregated health state."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicaHealthStateChunk { @@ -12946,6 +13130,12 @@ impl ReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaInfoUnion { + Stateful(StatefulServiceReplicaInfo), + Stateless(StatelessServiceInstanceInfo), +} #[doc = "The role of a replica of a stateful service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ReplicaKind")] @@ -13084,6 +13274,11 @@ impl ReplicaStatusBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicaStatusBaseUnion { + KeyValueStore(KeyValueStoreReplicaStatus), +} #[doc = "Represents health evaluation for replicas, containing health evaluations for each unhealthy replica that impacted current aggregated health state. Can be returned when evaluating partition health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicasHealthEvaluation { @@ -13205,6 +13400,11 @@ impl ReplicatorStatus { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicatorStatusUnion { + Primary(PrimaryReplicatorStatus), +} #[doc = "Endpoint of a resolved service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResolvedServiceEndpoint { @@ -13229,7 +13429,7 @@ pub struct ResolvedServicePartition { pub name: ServiceName, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation")] - pub partition_information: PartitionInformation, + pub partition_information: PartitionInformationUnion, #[doc = "List of resolved service endpoints of a service partition."] #[serde(rename = "Endpoints")] pub endpoints: ResolvedServiceEndpointList, @@ -13240,7 +13440,7 @@ pub struct ResolvedServicePartition { impl ResolvedServicePartition { pub fn new( name: ServiceName, - partition_information: PartitionInformation, + partition_information: PartitionInformationUnion, endpoints: ResolvedServiceEndpointList, version: String, ) -> Self { @@ -13496,7 +13696,7 @@ pub struct RestorePartitionDescription { pub backup_location: String, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl RestorePartitionDescription { pub fn new(backup_id: String, backup_location: String) -> Self { @@ -13612,6 +13812,11 @@ impl RetentionPolicyDescription { Self { retention_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "RetentionPolicyType")] +pub enum RetentionPolicyDescriptionUnion { + Basic(BasicRetentionPolicyDescription), +} #[doc = "The type of retention policy. Currently only \"Basic\" retention policy is supported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RetentionPolicyType")] @@ -13774,6 +13979,11 @@ impl SafetyCheck { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum SafetyCheckUnion { + EnsureSeedNodeQuorum(SeedNodeSafetyCheck), +} pub type SafetyCheckInfoList = Vec; #[doc = "The kind of safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state. Following are the kinds of safety checks."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -13829,7 +14039,7 @@ impl Serialize for SafetyCheckKind { pub struct SafetyCheckWrapper { #[doc = "Represents a safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state."] #[serde(rename = "SafetyCheck", default, skip_serializing_if = "Option::is_none")] - pub safety_check: Option, + pub safety_check: Option, } impl SafetyCheckWrapper { pub fn new() -> Self { @@ -13848,6 +14058,12 @@ impl ScalingMechanismDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingMechanismDescriptionUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + PartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingMechanismKind")] @@ -13894,13 +14110,13 @@ impl Serialize for ScalingMechanismKind { pub struct ScalingPolicyDescription { #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "ScalingTrigger")] - pub scaling_trigger: ScalingTriggerDescription, + pub scaling_trigger: ScalingTriggerDescriptionUnion, #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "ScalingMechanism")] - pub scaling_mechanism: ScalingMechanismDescription, + pub scaling_mechanism: ScalingMechanismDescriptionUnion, } impl ScalingPolicyDescription { - pub fn new(scaling_trigger: ScalingTriggerDescription, scaling_mechanism: ScalingMechanismDescription) -> Self { + pub fn new(scaling_trigger: ScalingTriggerDescriptionUnion, scaling_mechanism: ScalingMechanismDescriptionUnion) -> Self { Self { scaling_trigger, scaling_mechanism, @@ -13920,6 +14136,12 @@ impl ScalingTriggerDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingTriggerDescriptionUnion { + AveragePartitionLoad(AveragePartitionLoadScalingTrigger), + AverageServiceLoad(AverageServiceLoadScalingTrigger), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingTriggerKind")] @@ -14119,6 +14341,9 @@ impl SecretResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecretResourcePropertiesBaseUnion {} #[doc = "This type represents the unencrypted value of the secret."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretValue { @@ -14428,7 +14653,7 @@ pub struct ServiceDescription { pub initialization_data: Option, #[doc = "Describes how the service is partitioned."] #[serde(rename = "PartitionDescription")] - pub partition_description: PartitionSchemeDescription, + pub partition_description: PartitionSchemeDescriptionUnion, #[doc = "The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: \"NodeColor == blue)\"."] #[serde(rename = "PlacementConstraints", default, skip_serializing_if = "Option::is_none")] pub placement_constraints: Option, @@ -14462,7 +14687,7 @@ impl ServiceDescription { service_kind: ServiceKind, service_name: ServiceName, service_type_name: ServiceTypeName, - partition_description: PartitionSchemeDescription, + partition_description: PartitionSchemeDescriptionUnion, ) -> Self { Self { service_kind, @@ -14483,6 +14708,12 @@ impl ServiceDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceDescriptionUnion { + Stateful(StatefulServiceDescription), + Stateless(StatelessServiceDescription), +} #[doc = "The role of the replica where the endpoint is reported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceEndpointRole")] @@ -14805,6 +15036,12 @@ impl ServiceInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceInfoUnion { + Stateful(StatefulServiceInfo), + Stateless(StatelessServiceInfo), +} #[doc = "The kind of service (Stateless or Stateful)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceKind")] @@ -15090,7 +15327,7 @@ pub struct ServicePartitionInfo { pub partition_status: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, } impl ServicePartitionInfo { pub fn new(service_kind: ServiceKind) -> Self { @@ -15102,6 +15339,12 @@ impl ServicePartitionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServicePartitionInfoUnion { + Stateful(StatefulServicePartitionInfo), + Stateless(StatelessServicePartitionInfo), +} #[doc = "The kind of partitioning scheme used to partition the service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePartitionKind")] @@ -15231,6 +15474,15 @@ impl ServicePlacementPolicyDescription { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Type")] +pub enum ServicePlacementPolicyDescriptionUnion { + InvalidDomain(ServicePlacementInvalidDomainPolicyDescription), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicyDescription), + PreferPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicyDescription), + RequireDomainDistribution(ServicePlacementRequireDomainDistributionPolicyDescription), + RequireDomain(ServicePlacementRequiredDomainPolicyDescription), +} pub type ServicePlacementPolicyDescriptionList = Vec; #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -15343,7 +15595,7 @@ pub struct ServiceProperties { pub replica_count: Option, #[doc = "The execution policy of the service"] #[serde(rename = "executionPolicy", default, skip_serializing_if = "Option::is_none")] - pub execution_policy: Option, + pub execution_policy: Option, #[doc = "Auto scaling policies"] #[serde( rename = "autoScalingPolicies", @@ -15542,6 +15794,12 @@ impl ServiceTypeDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ServiceTypeDescriptionUnion { + Stateful(StatefulServiceTypeDescription), + Stateless(StatelessServiceTypeDescription), +} #[doc = "Describes extension of a service type defined in the service manifest."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceTypeExtensionDescription { @@ -15605,7 +15863,7 @@ impl ServiceTypeHealthPolicyMapItem { pub struct ServiceTypeInfo { #[doc = "Describes a service type defined in the service manifest of a provisioned application type. The properties the ones defined in the service manifest."] #[serde(rename = "ServiceTypeDescription", default, skip_serializing_if = "Option::is_none")] - pub service_type_description: Option, + pub service_type_description: Option, #[doc = "The name of the service manifest."] #[serde(rename = "ServiceManifestName", default, skip_serializing_if = "Option::is_none")] pub service_manifest_name: Option, @@ -15718,6 +15976,12 @@ impl ServiceUpdateDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceUpdateDescriptionUnion { + Stateful(StatefulServiceUpdateDescription), + Stateless(StatelessServiceUpdateDescription), +} #[doc = "Information about how many replicas are completed or pending for a specific service during upgrade."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceUpgradeProgress { diff --git a/services/svc/servicefabric/src/v7_2/mod.rs b/services/svc/servicefabric/src/v7_2/mod.rs index 46c0e735a8..51d6051159 100644 --- a/services/svc/servicefabric/src/v7_2/mod.rs +++ b/services/svc/servicefabric/src/v7_2/mod.rs @@ -627,7 +627,7 @@ impl Client { #[doc = "* `provision_application_type_description_base_required_body_param`: The base type of provision application type description which supports either image store-based provision or external store-based provision."] pub fn provision_application_type( &self, - provision_application_type_description_base_required_body_param: impl Into, + provision_application_type_description_base_required_body_param: impl Into, ) -> provision_application_type::RequestBuilder { provision_application_type::RequestBuilder { client: self.clone(), @@ -1120,7 +1120,7 @@ impl Client { pub fn create_service( &self, application_id: impl Into, - service_description: impl Into, + service_description: impl Into, ) -> create_service::RequestBuilder { create_service::RequestBuilder { client: self.clone(), @@ -1169,7 +1169,7 @@ impl Client { pub fn update_service( &self, service_id: impl Into, - service_update_description: impl Into, + service_update_description: impl Into, ) -> update_service::RequestBuilder { update_service::RequestBuilder { client: self.clone(), @@ -7709,7 +7709,7 @@ pub mod provision_application_type { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::Client, - pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBase, + pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBaseUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -10912,9 +10912,9 @@ pub mod get_service_info { #[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::ServiceInfo = serde_json::from_slice(&bytes)?; + let body: models::ServiceInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11005,8 +11005,8 @@ pub mod get_service_info { } } 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`."] @@ -11177,7 +11177,7 @@ pub mod create_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) application_id: String, - pub(crate) service_description: models::ServiceDescription, + pub(crate) service_description: models::ServiceDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11474,7 +11474,7 @@ pub mod update_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) service_id: String, - pub(crate) service_update_description: models::ServiceUpdateDescription, + pub(crate) service_update_description: models::ServiceUpdateDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11528,9 +11528,9 @@ pub mod get_service_description { #[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::ServiceDescription = serde_json::from_slice(&bytes)?; + let body: models::ServiceDescriptionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11619,8 +11619,8 @@ pub mod get_service_description { } } 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`."] @@ -12429,9 +12429,9 @@ pub mod get_partition_info { #[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::ServicePartitionInfo = serde_json::from_slice(&bytes)?; + let body: models::ServicePartitionInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12516,8 +12516,8 @@ pub mod get_partition_info { } } 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`."] @@ -14815,9 +14815,9 @@ pub mod get_replica_info { #[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::ReplicaInfo = serde_json::from_slice(&bytes)?; + let body: models::ReplicaInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14908,8 +14908,8 @@ pub mod get_replica_info { } } 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`."] @@ -14929,9 +14929,9 @@ pub mod get_replica_health { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15033,8 +15033,8 @@ pub mod get_replica_health { } } 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`."] @@ -15054,9 +15054,9 @@ pub mod get_replica_health_using_policy { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15169,8 +15169,8 @@ pub mod get_replica_health_using_policy { } } 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`."] @@ -15435,9 +15435,9 @@ pub mod get_deployed_service_replica_detail_info { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15530,8 +15530,8 @@ pub mod get_deployed_service_replica_detail_info { } } 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`."] @@ -15551,9 +15551,9 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15644,8 +15644,8 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { } } 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`."] diff --git a/services/svc/servicefabric/src/v7_2/models.rs b/services/svc/servicefabric/src/v7_2/models.rs index 185a9896da..bd186e2d49 100644 --- a/services/svc/servicefabric/src/v7_2/models.rs +++ b/services/svc/servicefabric/src/v7_2/models.rs @@ -1138,10 +1138,10 @@ pub struct ApplicationScopedVolume { pub volume_reference: VolumeReference, #[doc = "Describes parameters for creating application-scoped volumes."] #[serde(rename = "creationParameters")] - pub creation_parameters: ApplicationScopedVolumeCreationParameters, + pub creation_parameters: ApplicationScopedVolumeCreationParametersUnion, } impl ApplicationScopedVolume { - pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParameters) -> Self { + pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParametersUnion) -> Self { Self { volume_reference, creation_parameters, @@ -1162,6 +1162,11 @@ impl ApplicationScopedVolumeCreationParameters { Self { kind, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ApplicationScopedVolumeCreationParametersUnion { + ServiceFabricVolumeDisk(ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk), +} #[doc = "Describes parameters for creating application-scoped volumes provided by Service Fabric Volume Disks"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk { @@ -1871,6 +1876,11 @@ impl AutoScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMechanismUnion { + AddRemoveReplica(AddRemoveReplicaScalingMechanism), +} #[doc = "Enumerates the mechanisms for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMechanismKind")] @@ -1917,6 +1927,11 @@ impl AutoScalingMetric { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMetricUnion { + Resource(AutoScalingResourceMetric), +} #[doc = "Enumerates the metrics that are used for triggering auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMetricKind")] @@ -1958,12 +1973,12 @@ pub struct AutoScalingPolicy { #[doc = "The name of the auto scaling policy."] pub name: String, #[doc = "Describes the trigger for performing auto scaling operation."] - pub trigger: AutoScalingTrigger, + pub trigger: AutoScalingTriggerUnion, #[doc = "Describes the mechanism for performing auto scaling operation. Derived classes will describe the actual mechanism."] - pub mechanism: AutoScalingMechanism, + pub mechanism: AutoScalingMechanismUnion, } impl AutoScalingPolicy { - pub fn new(name: String, trigger: AutoScalingTrigger, mechanism: AutoScalingMechanism) -> Self { + pub fn new(name: String, trigger: AutoScalingTriggerUnion, mechanism: AutoScalingMechanismUnion) -> Self { Self { name, trigger, mechanism } } } @@ -2030,6 +2045,11 @@ impl AutoScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingTriggerUnion { + AverageLoad(AverageLoadScalingTrigger), +} #[doc = "Enumerates the triggers for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingTriggerKind")] @@ -2071,7 +2091,7 @@ pub struct AverageLoadScalingTrigger { #[serde(flatten)] pub auto_scaling_trigger: AutoScalingTrigger, #[doc = "Describes the metric that is used for triggering auto scaling operation. Derived classes will describe resources or metrics."] - pub metric: AutoScalingMetric, + pub metric: AutoScalingMetricUnion, #[doc = "Lower load threshold (if average load is below this threshold, service will scale down)."] #[serde(rename = "lowerLoadThreshold")] pub lower_load_threshold: f64, @@ -2085,7 +2105,7 @@ pub struct AverageLoadScalingTrigger { impl AverageLoadScalingTrigger { pub fn new( auto_scaling_trigger: AutoScalingTrigger, - metric: AutoScalingMetric, + metric: AutoScalingMetricUnion, lower_load_threshold: f64, upper_load_threshold: f64, scale_interval_in_seconds: i64, @@ -2249,6 +2269,13 @@ impl BackupConfigurationInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum BackupConfigurationInfoUnion { + Application(ApplicationBackupConfigurationInfo), + Partition(PartitionBackupConfigurationInfo), + Service(ServiceBackupConfigurationInfo), +} #[doc = "Describes the Service Fabric entity that is configured for backup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupEntity { @@ -2261,6 +2288,13 @@ impl BackupEntity { Self { entity_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "EntityKind")] +pub enum BackupEntityUnion { + Application(ApplicationBackupEntity), + Partition(PartitionBackupEntity), + Service(ServiceBackupEntity), +} #[doc = "The entity type of a Service Fabric entity such as Application, Service or a Partition where periodic backups can be enabled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupEntityKind")] @@ -2319,7 +2353,7 @@ pub struct BackupInfo { pub service_name: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, #[doc = "Location of the backup, relative to the backup store."] #[serde(rename = "BackupLocation", default, skip_serializing_if = "Option::is_none")] pub backup_location: Option, @@ -2352,7 +2386,7 @@ impl BackupInfo { pub struct BackupPartitionDescription { #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl BackupPartitionDescription { pub fn new() -> Self { @@ -2373,21 +2407,21 @@ pub struct BackupPolicyDescription { pub max_incremental_backups: i64, #[doc = "Describes the backup schedule parameters."] #[serde(rename = "Schedule")] - pub schedule: BackupScheduleDescription, + pub schedule: BackupScheduleDescriptionUnion, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the retention policy configured."] #[serde(rename = "RetentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl BackupPolicyDescription { pub fn new( name: String, auto_restore_on_data_loss: bool, max_incremental_backups: i64, - schedule: BackupScheduleDescription, - storage: BackupStorageDescription, + schedule: BackupScheduleDescriptionUnion, + storage: BackupStorageDescriptionUnion, ) -> Self { Self { name, @@ -2482,6 +2516,12 @@ impl BackupScheduleDescription { Self { schedule_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ScheduleKind")] +pub enum BackupScheduleDescriptionUnion { + FrequencyBased(FrequencyBasedBackupScheduleDescription), + TimeBased(TimeBasedBackupScheduleDescription), +} #[doc = "Describes the frequency with which to run the time based backup schedule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupScheduleFrequencyType")] @@ -2623,6 +2663,13 @@ impl BackupStorageDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "StorageKind")] +pub enum BackupStorageDescriptionUnion { + AzureBlobStore(AzureBlobBackupStorageDescription), + DsmsAzureBlobStore(DsmsAzureBlobBackupStorageDescription), + FileShare(FileShareBackupStorageDescription), +} #[doc = "The kind of backup storage, where backups are saved."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupStorageKind")] @@ -2893,6 +2940,16 @@ impl ChaosEvent { Self { kind, time_stamp_utc } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ChaosEventUnion { + ExecutingFaults(ExecutingFaultsChaosEvent), + Started(StartedChaosEvent), + Stopped(StoppedChaosEvent), + TestError(TestErrorChaosEvent), + ValidationFailed(ValidationFailedChaosEvent), + Waiting(WaitingChaosEvent), +} pub type ChaosEventHistory = Vec; #[doc = "The kind of Chaos event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -2946,7 +3003,7 @@ impl Serialize for ChaosEventKind { pub struct ChaosEventWrapper { #[doc = "Represents an event generated during a Chaos run."] #[serde(rename = "ChaosEvent", default, skip_serializing_if = "Option::is_none")] - pub chaos_event: Option, + pub chaos_event: Option, } impl ChaosEventWrapper { pub fn new() -> Self { @@ -3509,10 +3566,10 @@ pub struct CheckValuePropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl CheckValuePropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -5819,6 +5876,12 @@ impl DeployedServiceReplicaDetailInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaDetailInfoUnion { + Stateful(DeployedStatefulServiceReplicaDetailInfo), + Stateless(DeployedStatelessServiceInstanceDetailInfo), +} #[doc = "Information about a Service Fabric service replica deployed on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeployedServiceReplicaInfo { @@ -5869,6 +5932,12 @@ impl DeployedServiceReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaInfoUnion { + Stateful(DeployedStatefulServiceReplicaInfo), + Stateless(DeployedStatelessServiceInstanceInfo), +} pub type DeployedServiceReplicaInfoList = Vec; #[doc = "Information about service type deployed on a node, information such as the status of the service type registration on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] @@ -5914,7 +5983,7 @@ pub struct DeployedStatefulServiceReplicaDetailInfo { pub write_status: Option, #[doc = "Represents a base class for primary or secondary replicator status.\nContains information about the service fabric replicator like the replication/copy queue utilization, last acknowledgement received timestamp, etc."] #[serde(rename = "ReplicatorStatus", default, skip_serializing_if = "Option::is_none")] - pub replicator_status: Option, + pub replicator_status: Option, #[doc = "Key value store related information for the replica."] #[serde(rename = "ReplicaStatus", default, skip_serializing_if = "Option::is_none")] pub replica_status: Option, @@ -6058,7 +6127,7 @@ pub struct DiagnosticsDescription { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, #[doc = "Status of whether or not sinks are enabled."] #[serde(default, skip_serializing_if = "Option::is_none")] pub enabled: Option, @@ -6156,6 +6225,11 @@ impl DiagnosticsSinkProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DiagnosticsSinkPropertiesUnion { + AzureInternalMonitoringPipeline(AzureInternalMonitoringPipelineSinkDescription), +} #[doc = "It describes the body parameters while disabling backup of a backup entity(Application/Service/Partition)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DisableBackupDescription { @@ -6588,6 +6662,12 @@ impl ExecutionPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ExecutionPolicyUnion { + Default(DefaultExecutionPolicy), + RunToCompletion(RunToCompletionExecutionPolicy), +} #[doc = "Enumerates the execution policy types for services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ExecutionPolicyType")] @@ -7126,6 +7206,17 @@ impl FabricEvent { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum FabricEventUnion { + ApplicationEvent(ApplicationEvent), + ClusterEvent(ClusterEvent), + ContainerInstanceEvent(ContainerInstanceEvent), + NodeEvent(NodeEvent), + PartitionEvent(PartitionEvent), + ReplicaEvent(ReplicaEvent), + ServiceEvent(ServiceEvent), +} #[doc = "The kind of FabricEvent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "FabricEventKind")] @@ -7722,13 +7813,13 @@ pub struct GetBackupByStorageQueryDescription { pub latest: Option, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the Service Fabric entity that is configured for backup."] #[serde(rename = "BackupEntity")] - pub backup_entity: BackupEntity, + pub backup_entity: BackupEntityUnion, } impl GetBackupByStorageQueryDescription { - pub fn new(storage: BackupStorageDescription, backup_entity: BackupEntity) -> Self { + pub fn new(storage: BackupStorageDescriptionUnion, backup_entity: BackupEntityUnion) -> Self { Self { start_date_time_filter: None, end_date_time_filter: None, @@ -7794,6 +7885,30 @@ impl HealthEvaluation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum HealthEvaluationUnion { + Application(ApplicationHealthEvaluation), + ApplicationTypeApplications(ApplicationTypeApplicationsHealthEvaluation), + Applications(ApplicationsHealthEvaluation), + DeltaNodesCheck(DeltaNodesCheckHealthEvaluation), + DeployedApplication(DeployedApplicationHealthEvaluation), + DeployedApplications(DeployedApplicationsHealthEvaluation), + DeployedServicePackage(DeployedServicePackageHealthEvaluation), + DeployedServicePackages(DeployedServicePackagesHealthEvaluation), + Event(EventHealthEvaluation), + Node(NodeHealthEvaluation), + Nodes(NodesHealthEvaluation), + Partition(PartitionHealthEvaluation), + Partitions(PartitionsHealthEvaluation), + Replica(ReplicaHealthEvaluation), + Replicas(ReplicasHealthEvaluation), + Service(ServiceHealthEvaluation), + Services(ServicesHealthEvaluation), + SystemApplication(SystemApplicationHealthEvaluation), + UpgradeDomainDeltaNodesCheck(UpgradeDomainDeltaNodesCheckHealthEvaluation), + UpgradeDomainNodes(UpgradeDomainNodesHealthEvaluation), +} #[doc = "The health manager in the cluster performs health evaluations in determining the aggregated health state of an entity. This enumeration provides information on the kind of evaluation that was performed. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "HealthEvaluationKind")] @@ -7882,7 +7997,7 @@ impl Serialize for HealthEvaluationKind { pub struct HealthEvaluationWrapper { #[doc = "Represents a health evaluation which describes the data and the algorithm used by health manager to evaluate the health of an entity."] #[serde(rename = "HealthEvaluation", default, skip_serializing_if = "Option::is_none")] - pub health_evaluation: Option, + pub health_evaluation: Option, } impl HealthEvaluationWrapper { pub fn new() -> Self { @@ -9039,6 +9154,9 @@ impl NetworkResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum NetworkResourcePropertiesBaseUnion {} pub type NextUpgradeDomain = String; #[doc = "Node Aborted event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -10545,7 +10663,7 @@ pub struct PagedBackupConfigurationInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupConfigurationInfoList { pub fn new() -> Self { @@ -10565,7 +10683,7 @@ pub struct PagedBackupEntityList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupEntityList { pub fn new() -> Self { @@ -10748,7 +10866,7 @@ pub struct PagedReplicaInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedReplicaInfoList { pub fn new() -> Self { @@ -10808,7 +10926,7 @@ pub struct PagedServiceInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServiceInfoList { pub fn new() -> Self { @@ -10828,7 +10946,7 @@ pub struct PagedServicePartitionInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServicePartitionInfoList { pub fn new() -> Self { @@ -11085,7 +11203,7 @@ pub struct PartitionHealth { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub replica_health_states: Vec, + pub replica_health_states: Vec, } impl PartitionHealth { pub fn new() -> Self { @@ -11258,6 +11376,13 @@ impl PartitionInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServicePartitionKind")] +pub enum PartitionInformationUnion { + Int64Range(Int64RangePartitionInformation), + Named(NamedPartitionInformation), + Singleton(SingletonPartitionInformation), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -11628,6 +11753,13 @@ impl PartitionSchemeDescription { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "PartitionScheme")] +pub enum PartitionSchemeDescriptionUnion { + Named(NamedPartitionSchemeDescription), + Singleton(SingletonPartitionSchemeDescription), + UniformInt64Range(UniformInt64RangePartitionSchemeDescription), +} #[doc = "Represents health evaluation for the partitions of a service, containing health evaluations for each unhealthy partition that impacts current aggregated health state. Can be returned when evaluating service health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionsHealthEvaluation { @@ -11832,7 +11964,7 @@ pub struct PropertyBatchDescriptionList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub operations: Vec, + pub operations: Vec, } impl PropertyBatchDescriptionList { pub fn new() -> Self { @@ -11851,6 +11983,12 @@ impl PropertyBatchInfo { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchInfoUnion { + Failed(FailedPropertyBatchInfo), + Successful(SuccessfulPropertyBatchInfo), +} #[doc = "The kind of property batch info, determined by the results of a property batch. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchInfoKind")] @@ -11905,6 +12043,16 @@ impl PropertyBatchOperation { Self { kind, property_name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchOperationUnion { + CheckExists(CheckExistsPropertyBatchOperation), + CheckSequence(CheckSequencePropertyBatchOperation), + CheckValue(CheckValuePropertyBatchOperation), + Delete(DeletePropertyBatchOperation), + Get(GetPropertyBatchOperation), + Put(PutPropertyBatchOperation), +} #[doc = "The kind of property batch operation, determined by the operation to be performed. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchOperationKind")] @@ -11964,10 +12112,10 @@ pub struct PropertyDescription { pub custom_type_id: Option, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl PropertyDescription { - pub fn new(property_name: PropertyName, value: PropertyValue) -> Self { + pub fn new(property_name: PropertyName, value: PropertyValueUnion) -> Self { Self { property_name, custom_type_id: None, @@ -11983,7 +12131,7 @@ pub struct PropertyInfo { pub name: PropertyName, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value", default, skip_serializing_if = "Option::is_none")] - pub value: Option, + pub value: Option, #[doc = "The metadata associated with a property, including the property's name."] #[serde(rename = "Metadata")] pub metadata: PropertyMetadata, @@ -12037,6 +12185,15 @@ impl PropertyValue { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyValueUnion { + Binary(BinaryPropertyValue), + Double(DoublePropertyValue), + Guid(GuidPropertyValue), + Int64(Int64PropertyValue), + String(StringPropertyValue), +} #[doc = "The kind of property, determined by the type of data. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyValueKind")] @@ -12121,6 +12278,12 @@ impl ProvisionApplicationTypeDescriptionBase { Self { kind, async_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ProvisionApplicationTypeDescriptionBaseUnion { + ExternalStore(ExternalStoreProvisionApplicationTypeDescription), + ImageStorePath(ProvisionApplicationTypeDescription), +} #[doc = "The kind of application type registration or provision requested. The application package can be registered or provisioned either from the image store or from an external store. Following are the kinds of the application type provision."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ProvisionApplicationTypeKind")] @@ -12182,13 +12345,13 @@ pub struct PutPropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, #[doc = "The property's custom type ID. Using this property, the user is able to tag the type of the value of the property."] #[serde(rename = "CustomTypeId", default, skip_serializing_if = "Option::is_none")] pub custom_type_id: Option, } impl PutPropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -12432,6 +12595,11 @@ impl RepairImpactDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairImpactDescriptionBaseUnion { + Node(NodeRepairImpactDescription), +} #[doc = "Specifies the kind of the impact. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairImpactKind")] @@ -12481,6 +12649,11 @@ impl RepairTargetDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairTargetDescriptionBaseUnion { + Node(NodeRepairTargetDescription), +} #[doc = "Specifies the kind of the repair target. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairTargetKind")] @@ -12541,7 +12714,7 @@ pub struct RepairTask { pub action: String, #[doc = "Describes the entities targeted by a repair action.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Target", default, skip_serializing_if = "Option::is_none")] - pub target: Option, + pub target: Option, #[doc = "The name of the repair executor. Must be specified in Claimed and later states, and is immutable once set."] #[serde(rename = "Executor", default, skip_serializing_if = "Option::is_none")] pub executor: Option, @@ -12550,7 +12723,7 @@ pub struct RepairTask { pub executor_data: Option, #[doc = "Describes the expected impact of executing a repair task.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Impact", default, skip_serializing_if = "Option::is_none")] - pub impact: Option, + pub impact: Option, #[doc = "A value describing the overall result of the repair task execution. Must be specified in the Restoring and later states, and is immutable once set."] #[serde(rename = "ResultStatus", default, skip_serializing_if = "Option::is_none")] pub result_status: Option, @@ -12932,6 +13105,12 @@ impl ReplicaHealth { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthUnion { + Stateful(StatefulServiceReplicaHealth), + Stateless(StatelessServiceInstanceHealth), +} #[doc = "Represents health evaluation for a replica, containing information about the data and the algorithm used by health store to evaluate health. The evaluation is returned only when the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicaHealthEvaluation { @@ -12978,6 +13157,12 @@ impl ReplicaHealthState { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthStateUnion { + Stateful(StatefulServiceReplicaHealthState), + Stateless(StatelessServiceInstanceHealthState), +} #[doc = "Represents the health state chunk of a stateful service replica or a stateless service instance.\nThe replica health state contains the replica ID and its aggregated health state."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicaHealthStateChunk { @@ -13060,6 +13245,12 @@ impl ReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaInfoUnion { + Stateful(StatefulServiceReplicaInfo), + Stateless(StatelessServiceInstanceInfo), +} #[doc = "The role of a replica of a stateful service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ReplicaKind")] @@ -13218,6 +13409,11 @@ impl ReplicaStatusBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicaStatusBaseUnion { + KeyValueStore(KeyValueStoreReplicaStatus), +} #[doc = "Represents health evaluation for replicas, containing health evaluations for each unhealthy replica that impacted current aggregated health state. Can be returned when evaluating partition health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicasHealthEvaluation { @@ -13339,6 +13535,11 @@ impl ReplicatorStatus { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicatorStatusUnion { + Primary(PrimaryReplicatorStatus), +} #[doc = "Endpoint of a resolved service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResolvedServiceEndpoint { @@ -13363,7 +13564,7 @@ pub struct ResolvedServicePartition { pub name: ServiceName, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation")] - pub partition_information: PartitionInformation, + pub partition_information: PartitionInformationUnion, #[doc = "List of resolved service endpoints of a service partition."] #[serde(rename = "Endpoints")] pub endpoints: ResolvedServiceEndpointList, @@ -13374,7 +13575,7 @@ pub struct ResolvedServicePartition { impl ResolvedServicePartition { pub fn new( name: ServiceName, - partition_information: PartitionInformation, + partition_information: PartitionInformationUnion, endpoints: ResolvedServiceEndpointList, version: String, ) -> Self { @@ -13630,7 +13831,7 @@ pub struct RestorePartitionDescription { pub backup_location: String, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl RestorePartitionDescription { pub fn new(backup_id: String, backup_location: String) -> Self { @@ -13746,6 +13947,11 @@ impl RetentionPolicyDescription { Self { retention_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "RetentionPolicyType")] +pub enum RetentionPolicyDescriptionUnion { + Basic(BasicRetentionPolicyDescription), +} #[doc = "The type of retention policy. Currently only \"Basic\" retention policy is supported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RetentionPolicyType")] @@ -13908,6 +14114,11 @@ impl SafetyCheck { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum SafetyCheckUnion { + EnsureSeedNodeQuorum(SeedNodeSafetyCheck), +} pub type SafetyCheckInfoList = Vec; #[doc = "The kind of safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state. Following are the kinds of safety checks."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -13963,7 +14174,7 @@ impl Serialize for SafetyCheckKind { pub struct SafetyCheckWrapper { #[doc = "Represents a safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state."] #[serde(rename = "SafetyCheck", default, skip_serializing_if = "Option::is_none")] - pub safety_check: Option, + pub safety_check: Option, } impl SafetyCheckWrapper { pub fn new() -> Self { @@ -13982,6 +14193,12 @@ impl ScalingMechanismDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingMechanismDescriptionUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + PartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingMechanismKind")] @@ -14028,13 +14245,13 @@ impl Serialize for ScalingMechanismKind { pub struct ScalingPolicyDescription { #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "ScalingTrigger")] - pub scaling_trigger: ScalingTriggerDescription, + pub scaling_trigger: ScalingTriggerDescriptionUnion, #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "ScalingMechanism")] - pub scaling_mechanism: ScalingMechanismDescription, + pub scaling_mechanism: ScalingMechanismDescriptionUnion, } impl ScalingPolicyDescription { - pub fn new(scaling_trigger: ScalingTriggerDescription, scaling_mechanism: ScalingMechanismDescription) -> Self { + pub fn new(scaling_trigger: ScalingTriggerDescriptionUnion, scaling_mechanism: ScalingMechanismDescriptionUnion) -> Self { Self { scaling_trigger, scaling_mechanism, @@ -14054,6 +14271,12 @@ impl ScalingTriggerDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingTriggerDescriptionUnion { + AveragePartitionLoad(AveragePartitionLoadScalingTrigger), + AverageServiceLoad(AverageServiceLoadScalingTrigger), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingTriggerKind")] @@ -14253,6 +14476,9 @@ impl SecretResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecretResourcePropertiesBaseUnion {} #[doc = "This type represents the unencrypted value of the secret."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretValue { @@ -14562,7 +14788,7 @@ pub struct ServiceDescription { pub initialization_data: Option, #[doc = "Describes how the service is partitioned."] #[serde(rename = "PartitionDescription")] - pub partition_description: PartitionSchemeDescription, + pub partition_description: PartitionSchemeDescriptionUnion, #[doc = "The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: \"NodeColor == blue)\"."] #[serde(rename = "PlacementConstraints", default, skip_serializing_if = "Option::is_none")] pub placement_constraints: Option, @@ -14596,7 +14822,7 @@ impl ServiceDescription { service_kind: ServiceKind, service_name: ServiceName, service_type_name: ServiceTypeName, - partition_description: PartitionSchemeDescription, + partition_description: PartitionSchemeDescriptionUnion, ) -> Self { Self { service_kind, @@ -14617,6 +14843,12 @@ impl ServiceDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceDescriptionUnion { + Stateful(StatefulServiceDescription), + Stateless(StatelessServiceDescription), +} #[doc = "The role of the replica where the endpoint is reported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceEndpointRole")] @@ -14939,6 +15171,12 @@ impl ServiceInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceInfoUnion { + Stateful(StatefulServiceInfo), + Stateless(StatelessServiceInfo), +} #[doc = "The kind of service (Stateless or Stateful)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceKind")] @@ -15224,7 +15462,7 @@ pub struct ServicePartitionInfo { pub partition_status: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, } impl ServicePartitionInfo { pub fn new(service_kind: ServiceKind) -> Self { @@ -15236,6 +15474,12 @@ impl ServicePartitionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServicePartitionInfoUnion { + Stateful(StatefulServicePartitionInfo), + Stateless(StatelessServicePartitionInfo), +} #[doc = "The kind of partitioning scheme used to partition the service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePartitionKind")] @@ -15365,6 +15609,15 @@ impl ServicePlacementPolicyDescription { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Type")] +pub enum ServicePlacementPolicyDescriptionUnion { + InvalidDomain(ServicePlacementInvalidDomainPolicyDescription), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicyDescription), + PreferPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicyDescription), + RequireDomainDistribution(ServicePlacementRequireDomainDistributionPolicyDescription), + RequireDomain(ServicePlacementRequiredDomainPolicyDescription), +} pub type ServicePlacementPolicyDescriptionList = Vec; #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -15481,7 +15734,7 @@ pub struct ServiceProperties { pub replica_count: Option, #[doc = "The execution policy of the service"] #[serde(rename = "executionPolicy", default, skip_serializing_if = "Option::is_none")] - pub execution_policy: Option, + pub execution_policy: Option, #[doc = "Auto scaling policies"] #[serde( rename = "autoScalingPolicies", @@ -15680,6 +15933,12 @@ impl ServiceTypeDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ServiceTypeDescriptionUnion { + Stateful(StatefulServiceTypeDescription), + Stateless(StatelessServiceTypeDescription), +} #[doc = "Describes extension of a service type defined in the service manifest."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceTypeExtensionDescription { @@ -15743,7 +16002,7 @@ impl ServiceTypeHealthPolicyMapItem { pub struct ServiceTypeInfo { #[doc = "Describes a service type defined in the service manifest of a provisioned application type. The properties the ones defined in the service manifest."] #[serde(rename = "ServiceTypeDescription", default, skip_serializing_if = "Option::is_none")] - pub service_type_description: Option, + pub service_type_description: Option, #[doc = "The name of the service manifest."] #[serde(rename = "ServiceManifestName", default, skip_serializing_if = "Option::is_none")] pub service_manifest_name: Option, @@ -15856,6 +16115,12 @@ impl ServiceUpdateDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceUpdateDescriptionUnion { + Stateful(StatefulServiceUpdateDescription), + Stateless(StatelessServiceUpdateDescription), +} #[doc = "Information about how many replicas are completed or pending for a specific service during upgrade."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceUpgradeProgress { diff --git a/services/svc/servicefabric/src/v8_0/mod.rs b/services/svc/servicefabric/src/v8_0/mod.rs index 8f5e9a6e30..85db4099f6 100644 --- a/services/svc/servicefabric/src/v8_0/mod.rs +++ b/services/svc/servicefabric/src/v8_0/mod.rs @@ -657,7 +657,7 @@ impl Client { #[doc = "* `provision_application_type_description_base_required_body_param`: The base type of provision application type description which supports either image store-based provision or external store-based provision."] pub fn provision_application_type( &self, - provision_application_type_description_base_required_body_param: impl Into, + provision_application_type_description_base_required_body_param: impl Into, ) -> provision_application_type::RequestBuilder { provision_application_type::RequestBuilder { client: self.clone(), @@ -1150,7 +1150,7 @@ impl Client { pub fn create_service( &self, application_id: impl Into, - service_description: impl Into, + service_description: impl Into, ) -> create_service::RequestBuilder { create_service::RequestBuilder { client: self.clone(), @@ -1199,7 +1199,7 @@ impl Client { pub fn update_service( &self, service_id: impl Into, - service_update_description: impl Into, + service_update_description: impl Into, ) -> update_service::RequestBuilder { update_service::RequestBuilder { client: self.clone(), @@ -7941,7 +7941,7 @@ pub mod provision_application_type { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::Client, - pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBase, + pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBaseUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11144,9 +11144,9 @@ pub mod get_service_info { #[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::ServiceInfo = serde_json::from_slice(&bytes)?; + let body: models::ServiceInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11237,8 +11237,8 @@ pub mod get_service_info { } } 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`."] @@ -11409,7 +11409,7 @@ pub mod create_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) application_id: String, - pub(crate) service_description: models::ServiceDescription, + pub(crate) service_description: models::ServiceDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11706,7 +11706,7 @@ pub mod update_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) service_id: String, - pub(crate) service_update_description: models::ServiceUpdateDescription, + pub(crate) service_update_description: models::ServiceUpdateDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11760,9 +11760,9 @@ pub mod get_service_description { #[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::ServiceDescription = serde_json::from_slice(&bytes)?; + let body: models::ServiceDescriptionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11851,8 +11851,8 @@ pub mod get_service_description { } } 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`."] @@ -12798,9 +12798,9 @@ pub mod get_partition_info { #[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::ServicePartitionInfo = serde_json::from_slice(&bytes)?; + let body: models::ServicePartitionInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12885,8 +12885,8 @@ pub mod get_partition_info { } } 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`."] @@ -15311,9 +15311,9 @@ pub mod get_replica_info { #[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::ReplicaInfo = serde_json::from_slice(&bytes)?; + let body: models::ReplicaInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15404,8 +15404,8 @@ pub mod get_replica_info { } } 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`."] @@ -15425,9 +15425,9 @@ pub mod get_replica_health { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15529,8 +15529,8 @@ pub mod get_replica_health { } } 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`."] @@ -15550,9 +15550,9 @@ pub mod get_replica_health_using_policy { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15665,8 +15665,8 @@ pub mod get_replica_health_using_policy { } } 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`."] @@ -15931,9 +15931,9 @@ pub mod get_deployed_service_replica_detail_info { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16026,8 +16026,8 @@ pub mod get_deployed_service_replica_detail_info { } } 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`."] @@ -16047,9 +16047,9 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16140,8 +16140,8 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { } } 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`."] diff --git a/services/svc/servicefabric/src/v8_0/models.rs b/services/svc/servicefabric/src/v8_0/models.rs index acc1a2bdb7..3f01e0a74b 100644 --- a/services/svc/servicefabric/src/v8_0/models.rs +++ b/services/svc/servicefabric/src/v8_0/models.rs @@ -1141,10 +1141,10 @@ pub struct ApplicationScopedVolume { pub volume_reference: VolumeReference, #[doc = "Describes parameters for creating application-scoped volumes."] #[serde(rename = "creationParameters")] - pub creation_parameters: ApplicationScopedVolumeCreationParameters, + pub creation_parameters: ApplicationScopedVolumeCreationParametersUnion, } impl ApplicationScopedVolume { - pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParameters) -> Self { + pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParametersUnion) -> Self { Self { volume_reference, creation_parameters, @@ -1165,6 +1165,11 @@ impl ApplicationScopedVolumeCreationParameters { Self { kind, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ApplicationScopedVolumeCreationParametersUnion { + ServiceFabricVolumeDisk(ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk), +} #[doc = "Describes parameters for creating application-scoped volumes provided by Service Fabric Volume Disks"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk { @@ -1878,6 +1883,11 @@ impl AutoScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMechanismUnion { + AddRemoveReplica(AddRemoveReplicaScalingMechanism), +} #[doc = "Enumerates the mechanisms for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMechanismKind")] @@ -1924,6 +1934,11 @@ impl AutoScalingMetric { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMetricUnion { + Resource(AutoScalingResourceMetric), +} #[doc = "Enumerates the metrics that are used for triggering auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMetricKind")] @@ -1965,12 +1980,12 @@ pub struct AutoScalingPolicy { #[doc = "The name of the auto scaling policy."] pub name: String, #[doc = "Describes the trigger for performing auto scaling operation."] - pub trigger: AutoScalingTrigger, + pub trigger: AutoScalingTriggerUnion, #[doc = "Describes the mechanism for performing auto scaling operation. Derived classes will describe the actual mechanism."] - pub mechanism: AutoScalingMechanism, + pub mechanism: AutoScalingMechanismUnion, } impl AutoScalingPolicy { - pub fn new(name: String, trigger: AutoScalingTrigger, mechanism: AutoScalingMechanism) -> Self { + pub fn new(name: String, trigger: AutoScalingTriggerUnion, mechanism: AutoScalingMechanismUnion) -> Self { Self { name, trigger, mechanism } } } @@ -2037,6 +2052,11 @@ impl AutoScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingTriggerUnion { + AverageLoad(AverageLoadScalingTrigger), +} #[doc = "Enumerates the triggers for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingTriggerKind")] @@ -2078,7 +2098,7 @@ pub struct AverageLoadScalingTrigger { #[serde(flatten)] pub auto_scaling_trigger: AutoScalingTrigger, #[doc = "Describes the metric that is used for triggering auto scaling operation. Derived classes will describe resources or metrics."] - pub metric: AutoScalingMetric, + pub metric: AutoScalingMetricUnion, #[doc = "Lower load threshold (if average load is below this threshold, service will scale down)."] #[serde(rename = "lowerLoadThreshold")] pub lower_load_threshold: f64, @@ -2092,7 +2112,7 @@ pub struct AverageLoadScalingTrigger { impl AverageLoadScalingTrigger { pub fn new( auto_scaling_trigger: AutoScalingTrigger, - metric: AutoScalingMetric, + metric: AutoScalingMetricUnion, lower_load_threshold: f64, upper_load_threshold: f64, scale_interval_in_seconds: i64, @@ -2261,6 +2281,13 @@ impl BackupConfigurationInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum BackupConfigurationInfoUnion { + Application(ApplicationBackupConfigurationInfo), + Partition(PartitionBackupConfigurationInfo), + Service(ServiceBackupConfigurationInfo), +} #[doc = "Describes the Service Fabric entity that is configured for backup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupEntity { @@ -2273,6 +2300,13 @@ impl BackupEntity { Self { entity_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "EntityKind")] +pub enum BackupEntityUnion { + Application(ApplicationBackupEntity), + Partition(PartitionBackupEntity), + Service(ServiceBackupEntity), +} #[doc = "The entity type of a Service Fabric entity such as Application, Service or a Partition where periodic backups can be enabled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupEntityKind")] @@ -2331,7 +2365,7 @@ pub struct BackupInfo { pub service_name: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, #[doc = "Location of the backup, relative to the backup store."] #[serde(rename = "BackupLocation", default, skip_serializing_if = "Option::is_none")] pub backup_location: Option, @@ -2364,7 +2398,7 @@ impl BackupInfo { pub struct BackupPartitionDescription { #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl BackupPartitionDescription { pub fn new() -> Self { @@ -2385,21 +2419,21 @@ pub struct BackupPolicyDescription { pub max_incremental_backups: i64, #[doc = "Describes the backup schedule parameters."] #[serde(rename = "Schedule")] - pub schedule: BackupScheduleDescription, + pub schedule: BackupScheduleDescriptionUnion, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the retention policy configured."] #[serde(rename = "RetentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl BackupPolicyDescription { pub fn new( name: String, auto_restore_on_data_loss: bool, max_incremental_backups: i64, - schedule: BackupScheduleDescription, - storage: BackupStorageDescription, + schedule: BackupScheduleDescriptionUnion, + storage: BackupStorageDescriptionUnion, ) -> Self { Self { name, @@ -2494,6 +2528,12 @@ impl BackupScheduleDescription { Self { schedule_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ScheduleKind")] +pub enum BackupScheduleDescriptionUnion { + FrequencyBased(FrequencyBasedBackupScheduleDescription), + TimeBased(TimeBasedBackupScheduleDescription), +} #[doc = "Describes the frequency with which to run the time based backup schedule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupScheduleFrequencyType")] @@ -2635,6 +2675,14 @@ impl BackupStorageDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "StorageKind")] +pub enum BackupStorageDescriptionUnion { + AzureBlobStore(AzureBlobBackupStorageDescription), + DsmsAzureBlobStore(DsmsAzureBlobBackupStorageDescription), + FileShare(FileShareBackupStorageDescription), + ManagedIdentityAzureBlobStore(ManagedIdentityAzureBlobBackupStorageDescription), +} #[doc = "The kind of backup storage, where backups are saved."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupStorageKind")] @@ -2909,6 +2957,16 @@ impl ChaosEvent { Self { kind, time_stamp_utc } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ChaosEventUnion { + ExecutingFaults(ExecutingFaultsChaosEvent), + Started(StartedChaosEvent), + Stopped(StoppedChaosEvent), + TestError(TestErrorChaosEvent), + ValidationFailed(ValidationFailedChaosEvent), + Waiting(WaitingChaosEvent), +} pub type ChaosEventHistory = Vec; #[doc = "The kind of Chaos event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -2962,7 +3020,7 @@ impl Serialize for ChaosEventKind { pub struct ChaosEventWrapper { #[doc = "Represents an event generated during a Chaos run."] #[serde(rename = "ChaosEvent", default, skip_serializing_if = "Option::is_none")] - pub chaos_event: Option, + pub chaos_event: Option, } impl ChaosEventWrapper { pub fn new() -> Self { @@ -3525,10 +3583,10 @@ pub struct CheckValuePropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl CheckValuePropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -5838,6 +5896,12 @@ impl DeployedServiceReplicaDetailInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaDetailInfoUnion { + Stateful(DeployedStatefulServiceReplicaDetailInfo), + Stateless(DeployedStatelessServiceInstanceDetailInfo), +} #[doc = "Information about a Service Fabric service replica deployed on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeployedServiceReplicaInfo { @@ -5888,6 +5952,12 @@ impl DeployedServiceReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaInfoUnion { + Stateful(DeployedStatefulServiceReplicaInfo), + Stateless(DeployedStatelessServiceInstanceInfo), +} pub type DeployedServiceReplicaInfoList = Vec; #[doc = "Information about service type deployed on a node, information such as the status of the service type registration on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] @@ -5933,7 +6003,7 @@ pub struct DeployedStatefulServiceReplicaDetailInfo { pub write_status: Option, #[doc = "Represents a base class for primary or secondary replicator status.\nContains information about the service fabric replicator like the replication/copy queue utilization, last acknowledgement received timestamp, etc."] #[serde(rename = "ReplicatorStatus", default, skip_serializing_if = "Option::is_none")] - pub replicator_status: Option, + pub replicator_status: Option, #[doc = "Key value store related information for the replica."] #[serde(rename = "ReplicaStatus", default, skip_serializing_if = "Option::is_none")] pub replica_status: Option, @@ -6077,7 +6147,7 @@ pub struct DiagnosticsDescription { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, #[doc = "Status of whether or not sinks are enabled."] #[serde(default, skip_serializing_if = "Option::is_none")] pub enabled: Option, @@ -6175,6 +6245,11 @@ impl DiagnosticsSinkProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DiagnosticsSinkPropertiesUnion { + AzureInternalMonitoringPipeline(AzureInternalMonitoringPipelineSinkDescription), +} #[doc = "It describes the body parameters while disabling backup of a backup entity(Application/Service/Partition)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DisableBackupDescription { @@ -6607,6 +6682,12 @@ impl ExecutionPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ExecutionPolicyUnion { + Default(DefaultExecutionPolicy), + RunToCompletion(RunToCompletionExecutionPolicy), +} #[doc = "Enumerates the execution policy types for services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ExecutionPolicyType")] @@ -7145,6 +7226,17 @@ impl FabricEvent { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum FabricEventUnion { + ApplicationEvent(ApplicationEvent), + ClusterEvent(ClusterEvent), + ContainerInstanceEvent(ContainerInstanceEvent), + NodeEvent(NodeEvent), + PartitionEvent(PartitionEvent), + ReplicaEvent(ReplicaEvent), + ServiceEvent(ServiceEvent), +} #[doc = "The kind of FabricEvent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "FabricEventKind")] @@ -7741,13 +7833,13 @@ pub struct GetBackupByStorageQueryDescription { pub latest: Option, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the Service Fabric entity that is configured for backup."] #[serde(rename = "BackupEntity")] - pub backup_entity: BackupEntity, + pub backup_entity: BackupEntityUnion, } impl GetBackupByStorageQueryDescription { - pub fn new(storage: BackupStorageDescription, backup_entity: BackupEntity) -> Self { + pub fn new(storage: BackupStorageDescriptionUnion, backup_entity: BackupEntityUnion) -> Self { Self { start_date_time_filter: None, end_date_time_filter: None, @@ -7813,6 +7905,31 @@ impl HealthEvaluation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum HealthEvaluationUnion { + Application(ApplicationHealthEvaluation), + ApplicationTypeApplications(ApplicationTypeApplicationsHealthEvaluation), + Applications(ApplicationsHealthEvaluation), + DeltaNodesCheck(DeltaNodesCheckHealthEvaluation), + DeployedApplication(DeployedApplicationHealthEvaluation), + DeployedApplications(DeployedApplicationsHealthEvaluation), + DeployedServicePackage(DeployedServicePackageHealthEvaluation), + DeployedServicePackages(DeployedServicePackagesHealthEvaluation), + Event(EventHealthEvaluation), + Node(NodeHealthEvaluation), + NodeTypeNodes(NodeTypeNodesHealthEvaluation), + Nodes(NodesHealthEvaluation), + Partition(PartitionHealthEvaluation), + Partitions(PartitionsHealthEvaluation), + Replica(ReplicaHealthEvaluation), + Replicas(ReplicasHealthEvaluation), + Service(ServiceHealthEvaluation), + Services(ServicesHealthEvaluation), + SystemApplication(SystemApplicationHealthEvaluation), + UpgradeDomainDeltaNodesCheck(UpgradeDomainDeltaNodesCheckHealthEvaluation), + UpgradeDomainNodes(UpgradeDomainNodesHealthEvaluation), +} #[doc = "The health manager in the cluster performs health evaluations in determining the aggregated health state of an entity. This enumeration provides information on the kind of evaluation that was performed. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "HealthEvaluationKind")] @@ -7903,7 +8020,7 @@ impl Serialize for HealthEvaluationKind { pub struct HealthEvaluationWrapper { #[doc = "Represents a health evaluation which describes the data and the algorithm used by health manager to evaluate the health of an entity."] #[serde(rename = "HealthEvaluation", default, skip_serializing_if = "Option::is_none")] - pub health_evaluation: Option, + pub health_evaluation: Option, } impl HealthEvaluationWrapper { pub fn new() -> Self { @@ -9212,6 +9329,9 @@ impl NetworkResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum NetworkResourcePropertiesBaseUnion {} pub type NextUpgradeDomain = String; #[doc = "Node Aborted event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -10825,7 +10945,7 @@ pub struct PagedBackupConfigurationInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupConfigurationInfoList { pub fn new() -> Self { @@ -10845,7 +10965,7 @@ pub struct PagedBackupEntityList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupEntityList { pub fn new() -> Self { @@ -11028,7 +11148,7 @@ pub struct PagedReplicaInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedReplicaInfoList { pub fn new() -> Self { @@ -11088,7 +11208,7 @@ pub struct PagedServiceInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServiceInfoList { pub fn new() -> Self { @@ -11108,7 +11228,7 @@ pub struct PagedServicePartitionInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServicePartitionInfoList { pub fn new() -> Self { @@ -11365,7 +11485,7 @@ pub struct PartitionHealth { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub replica_health_states: Vec, + pub replica_health_states: Vec, } impl PartitionHealth { pub fn new() -> Self { @@ -11538,6 +11658,13 @@ impl PartitionInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServicePartitionKind")] +pub enum PartitionInformationUnion { + Int64Range(Int64RangePartitionInformation), + Named(NamedPartitionInformation), + Singleton(SingletonPartitionInformation), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -11908,6 +12035,13 @@ impl PartitionSchemeDescription { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "PartitionScheme")] +pub enum PartitionSchemeDescriptionUnion { + Named(NamedPartitionSchemeDescription), + Singleton(SingletonPartitionSchemeDescription), + UniformInt64Range(UniformInt64RangePartitionSchemeDescription), +} #[doc = "Represents health evaluation for the partitions of a service, containing health evaluations for each unhealthy partition that impacts current aggregated health state. Can be returned when evaluating service health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionsHealthEvaluation { @@ -12112,7 +12246,7 @@ pub struct PropertyBatchDescriptionList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub operations: Vec, + pub operations: Vec, } impl PropertyBatchDescriptionList { pub fn new() -> Self { @@ -12131,6 +12265,12 @@ impl PropertyBatchInfo { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchInfoUnion { + Failed(FailedPropertyBatchInfo), + Successful(SuccessfulPropertyBatchInfo), +} #[doc = "The kind of property batch info, determined by the results of a property batch. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchInfoKind")] @@ -12185,6 +12325,16 @@ impl PropertyBatchOperation { Self { kind, property_name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchOperationUnion { + CheckExists(CheckExistsPropertyBatchOperation), + CheckSequence(CheckSequencePropertyBatchOperation), + CheckValue(CheckValuePropertyBatchOperation), + Delete(DeletePropertyBatchOperation), + Get(GetPropertyBatchOperation), + Put(PutPropertyBatchOperation), +} #[doc = "The kind of property batch operation, determined by the operation to be performed. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchOperationKind")] @@ -12244,10 +12394,10 @@ pub struct PropertyDescription { pub custom_type_id: Option, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl PropertyDescription { - pub fn new(property_name: PropertyName, value: PropertyValue) -> Self { + pub fn new(property_name: PropertyName, value: PropertyValueUnion) -> Self { Self { property_name, custom_type_id: None, @@ -12263,7 +12413,7 @@ pub struct PropertyInfo { pub name: PropertyName, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value", default, skip_serializing_if = "Option::is_none")] - pub value: Option, + pub value: Option, #[doc = "The metadata associated with a property, including the property's name."] #[serde(rename = "Metadata")] pub metadata: PropertyMetadata, @@ -12317,6 +12467,15 @@ impl PropertyValue { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyValueUnion { + Binary(BinaryPropertyValue), + Double(DoublePropertyValue), + Guid(GuidPropertyValue), + Int64(Int64PropertyValue), + String(StringPropertyValue), +} #[doc = "The kind of property, determined by the type of data. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyValueKind")] @@ -12401,6 +12560,12 @@ impl ProvisionApplicationTypeDescriptionBase { Self { kind, async_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ProvisionApplicationTypeDescriptionBaseUnion { + ExternalStore(ExternalStoreProvisionApplicationTypeDescription), + ImageStorePath(ProvisionApplicationTypeDescription), +} #[doc = "The kind of application type registration or provision requested. The application package can be registered or provisioned either from the image store or from an external store. Following are the kinds of the application type provision."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ProvisionApplicationTypeKind")] @@ -12462,13 +12627,13 @@ pub struct PutPropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, #[doc = "The property's custom type ID. Using this property, the user is able to tag the type of the value of the property."] #[serde(rename = "CustomTypeId", default, skip_serializing_if = "Option::is_none")] pub custom_type_id: Option, } impl PutPropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -12712,6 +12877,11 @@ impl RepairImpactDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairImpactDescriptionBaseUnion { + Node(NodeRepairImpactDescription), +} #[doc = "Specifies the kind of the impact. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairImpactKind")] @@ -12761,6 +12931,11 @@ impl RepairTargetDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairTargetDescriptionBaseUnion { + Node(NodeRepairTargetDescription), +} #[doc = "Specifies the kind of the repair target. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairTargetKind")] @@ -12821,7 +12996,7 @@ pub struct RepairTask { pub action: String, #[doc = "Describes the entities targeted by a repair action.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Target", default, skip_serializing_if = "Option::is_none")] - pub target: Option, + pub target: Option, #[doc = "The name of the repair executor. Must be specified in Claimed and later states, and is immutable once set."] #[serde(rename = "Executor", default, skip_serializing_if = "Option::is_none")] pub executor: Option, @@ -12830,7 +13005,7 @@ pub struct RepairTask { pub executor_data: Option, #[doc = "Describes the expected impact of executing a repair task.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Impact", default, skip_serializing_if = "Option::is_none")] - pub impact: Option, + pub impact: Option, #[doc = "A value describing the overall result of the repair task execution. Must be specified in the Restoring and later states, and is immutable once set."] #[serde(rename = "ResultStatus", default, skip_serializing_if = "Option::is_none")] pub result_status: Option, @@ -13212,6 +13387,12 @@ impl ReplicaHealth { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthUnion { + Stateful(StatefulServiceReplicaHealth), + Stateless(StatelessServiceInstanceHealth), +} #[doc = "Represents health evaluation for a replica, containing information about the data and the algorithm used by health store to evaluate health. The evaluation is returned only when the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicaHealthEvaluation { @@ -13258,6 +13439,12 @@ impl ReplicaHealthState { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthStateUnion { + Stateful(StatefulServiceReplicaHealthState), + Stateless(StatelessServiceInstanceHealthState), +} #[doc = "Represents the health state chunk of a stateful service replica or a stateless service instance.\nThe replica health state contains the replica ID and its aggregated health state."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicaHealthStateChunk { @@ -13340,6 +13527,12 @@ impl ReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaInfoUnion { + Stateful(StatefulServiceReplicaInfo), + Stateless(StatelessServiceInstanceInfo), +} #[doc = "The role of a replica of a stateful service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ReplicaKind")] @@ -13517,6 +13710,11 @@ impl ReplicaStatusBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicaStatusBaseUnion { + KeyValueStore(KeyValueStoreReplicaStatus), +} #[doc = "Represents health evaluation for replicas, containing health evaluations for each unhealthy replica that impacted current aggregated health state. Can be returned when evaluating partition health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicasHealthEvaluation { @@ -13638,6 +13836,11 @@ impl ReplicatorStatus { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicatorStatusUnion { + Primary(PrimaryReplicatorStatus), +} #[doc = "Endpoint of a resolved service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResolvedServiceEndpoint { @@ -13662,7 +13865,7 @@ pub struct ResolvedServicePartition { pub name: ServiceName, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation")] - pub partition_information: PartitionInformation, + pub partition_information: PartitionInformationUnion, #[doc = "List of resolved service endpoints of a service partition."] #[serde(rename = "Endpoints")] pub endpoints: ResolvedServiceEndpointList, @@ -13673,7 +13876,7 @@ pub struct ResolvedServicePartition { impl ResolvedServicePartition { pub fn new( name: ServiceName, - partition_information: PartitionInformation, + partition_information: PartitionInformationUnion, endpoints: ResolvedServiceEndpointList, version: String, ) -> Self { @@ -13929,7 +14132,7 @@ pub struct RestorePartitionDescription { pub backup_location: String, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl RestorePartitionDescription { pub fn new(backup_id: String, backup_location: String) -> Self { @@ -14045,6 +14248,11 @@ impl RetentionPolicyDescription { Self { retention_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "RetentionPolicyType")] +pub enum RetentionPolicyDescriptionUnion { + Basic(BasicRetentionPolicyDescription), +} #[doc = "The type of retention policy. Currently only \"Basic\" retention policy is supported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RetentionPolicyType")] @@ -14207,6 +14415,11 @@ impl SafetyCheck { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum SafetyCheckUnion { + EnsureSeedNodeQuorum(SeedNodeSafetyCheck), +} pub type SafetyCheckInfoList = Vec; #[doc = "The kind of safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state. Following are the kinds of safety checks."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -14262,7 +14475,7 @@ impl Serialize for SafetyCheckKind { pub struct SafetyCheckWrapper { #[doc = "Represents a safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state."] #[serde(rename = "SafetyCheck", default, skip_serializing_if = "Option::is_none")] - pub safety_check: Option, + pub safety_check: Option, } impl SafetyCheckWrapper { pub fn new() -> Self { @@ -14281,6 +14494,12 @@ impl ScalingMechanismDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingMechanismDescriptionUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + PartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingMechanismKind")] @@ -14327,13 +14546,13 @@ impl Serialize for ScalingMechanismKind { pub struct ScalingPolicyDescription { #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "ScalingTrigger")] - pub scaling_trigger: ScalingTriggerDescription, + pub scaling_trigger: ScalingTriggerDescriptionUnion, #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "ScalingMechanism")] - pub scaling_mechanism: ScalingMechanismDescription, + pub scaling_mechanism: ScalingMechanismDescriptionUnion, } impl ScalingPolicyDescription { - pub fn new(scaling_trigger: ScalingTriggerDescription, scaling_mechanism: ScalingMechanismDescription) -> Self { + pub fn new(scaling_trigger: ScalingTriggerDescriptionUnion, scaling_mechanism: ScalingMechanismDescriptionUnion) -> Self { Self { scaling_trigger, scaling_mechanism, @@ -14353,6 +14572,12 @@ impl ScalingTriggerDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingTriggerDescriptionUnion { + AveragePartitionLoad(AveragePartitionLoadScalingTrigger), + AverageServiceLoad(AverageServiceLoadScalingTrigger), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingTriggerKind")] @@ -14552,6 +14777,9 @@ impl SecretResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecretResourcePropertiesBaseUnion {} #[doc = "This type represents the unencrypted value of the secret."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretValue { @@ -14861,7 +15089,7 @@ pub struct ServiceDescription { pub initialization_data: Option, #[doc = "Describes how the service is partitioned."] #[serde(rename = "PartitionDescription")] - pub partition_description: PartitionSchemeDescription, + pub partition_description: PartitionSchemeDescriptionUnion, #[doc = "The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: \"NodeColor == blue)\"."] #[serde(rename = "PlacementConstraints", default, skip_serializing_if = "Option::is_none")] pub placement_constraints: Option, @@ -14901,7 +15129,7 @@ impl ServiceDescription { service_kind: ServiceKind, service_name: ServiceName, service_type_name: ServiceTypeName, - partition_description: PartitionSchemeDescription, + partition_description: PartitionSchemeDescriptionUnion, ) -> Self { Self { service_kind, @@ -14924,6 +15152,12 @@ impl ServiceDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceDescriptionUnion { + Stateful(StatefulServiceDescription), + Stateless(StatelessServiceDescription), +} #[doc = "The role of the replica where the endpoint is reported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceEndpointRole")] @@ -15246,6 +15480,12 @@ impl ServiceInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceInfoUnion { + Stateful(StatefulServiceInfo), + Stateless(StatelessServiceInfo), +} #[doc = "The kind of service (Stateless or Stateful)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceKind")] @@ -15531,7 +15771,7 @@ pub struct ServicePartitionInfo { pub partition_status: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, } impl ServicePartitionInfo { pub fn new(service_kind: ServiceKind) -> Self { @@ -15543,6 +15783,12 @@ impl ServicePartitionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServicePartitionInfoUnion { + Stateful(StatefulServicePartitionInfo), + Stateless(StatelessServicePartitionInfo), +} #[doc = "The kind of partitioning scheme used to partition the service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePartitionKind")] @@ -15689,6 +15935,16 @@ impl ServicePlacementPolicyDescription { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Type")] +pub enum ServicePlacementPolicyDescriptionUnion { + AllowMultipleStatelessInstancesOnNode(ServicePlacementAllowMultipleStatelessInstancesOnNodePolicyDescription), + InvalidDomain(ServicePlacementInvalidDomainPolicyDescription), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicyDescription), + PreferPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicyDescription), + RequireDomainDistribution(ServicePlacementRequireDomainDistributionPolicyDescription), + RequireDomain(ServicePlacementRequiredDomainPolicyDescription), +} pub type ServicePlacementPolicyDescriptionList = Vec; #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -15805,7 +16061,7 @@ pub struct ServiceProperties { pub replica_count: Option, #[doc = "The execution policy of the service"] #[serde(rename = "executionPolicy", default, skip_serializing_if = "Option::is_none")] - pub execution_policy: Option, + pub execution_policy: Option, #[doc = "Auto scaling policies"] #[serde( rename = "autoScalingPolicies", @@ -16004,6 +16260,12 @@ impl ServiceTypeDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ServiceTypeDescriptionUnion { + Stateful(StatefulServiceTypeDescription), + Stateless(StatelessServiceTypeDescription), +} #[doc = "Describes extension of a service type defined in the service manifest."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceTypeExtensionDescription { @@ -16067,7 +16329,7 @@ impl ServiceTypeHealthPolicyMapItem { pub struct ServiceTypeInfo { #[doc = "Describes a service type defined in the service manifest of a provisioned application type. The properties the ones defined in the service manifest."] #[serde(rename = "ServiceTypeDescription", default, skip_serializing_if = "Option::is_none")] - pub service_type_description: Option, + pub service_type_description: Option, #[doc = "The name of the service manifest."] #[serde(rename = "ServiceManifestName", default, skip_serializing_if = "Option::is_none")] pub service_manifest_name: Option, @@ -16192,6 +16454,12 @@ impl ServiceUpdateDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceUpdateDescriptionUnion { + Stateful(StatefulServiceUpdateDescription), + Stateless(StatelessServiceUpdateDescription), +} #[doc = "Information about how many replicas are completed or pending for a specific service during upgrade."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceUpgradeProgress { diff --git a/services/svc/servicefabric/src/v8_1/mod.rs b/services/svc/servicefabric/src/v8_1/mod.rs index 6509b14f9e..e90a5da5eb 100644 --- a/services/svc/servicefabric/src/v8_1/mod.rs +++ b/services/svc/servicefabric/src/v8_1/mod.rs @@ -657,7 +657,7 @@ impl Client { #[doc = "* `provision_application_type_description_base_required_body_param`: The base type of provision application type description which supports either image store-based provision or external store-based provision."] pub fn provision_application_type( &self, - provision_application_type_description_base_required_body_param: impl Into, + provision_application_type_description_base_required_body_param: impl Into, ) -> provision_application_type::RequestBuilder { provision_application_type::RequestBuilder { client: self.clone(), @@ -1168,7 +1168,7 @@ impl Client { pub fn create_service( &self, application_id: impl Into, - service_description: impl Into, + service_description: impl Into, ) -> create_service::RequestBuilder { create_service::RequestBuilder { client: self.clone(), @@ -1217,7 +1217,7 @@ impl Client { pub fn update_service( &self, service_id: impl Into, - service_update_description: impl Into, + service_update_description: impl Into, ) -> update_service::RequestBuilder { update_service::RequestBuilder { client: self.clone(), @@ -7980,7 +7980,7 @@ pub mod provision_application_type { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::Client, - pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBase, + pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBaseUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11280,9 +11280,9 @@ pub mod get_service_info { #[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::ServiceInfo = serde_json::from_slice(&bytes)?; + let body: models::ServiceInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11373,8 +11373,8 @@ pub mod get_service_info { } } 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`."] @@ -11545,7 +11545,7 @@ pub mod create_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) application_id: String, - pub(crate) service_description: models::ServiceDescription, + pub(crate) service_description: models::ServiceDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11842,7 +11842,7 @@ pub mod update_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) service_id: String, - pub(crate) service_update_description: models::ServiceUpdateDescription, + pub(crate) service_update_description: models::ServiceUpdateDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11896,9 +11896,9 @@ pub mod get_service_description { #[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::ServiceDescription = serde_json::from_slice(&bytes)?; + let body: models::ServiceDescriptionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11987,8 +11987,8 @@ pub mod get_service_description { } } 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`."] @@ -12934,9 +12934,9 @@ pub mod get_partition_info { #[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::ServicePartitionInfo = serde_json::from_slice(&bytes)?; + let body: models::ServicePartitionInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13021,8 +13021,8 @@ pub mod get_partition_info { } } 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`."] @@ -15574,9 +15574,9 @@ pub mod get_replica_info { #[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::ReplicaInfo = serde_json::from_slice(&bytes)?; + let body: models::ReplicaInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15667,8 +15667,8 @@ pub mod get_replica_info { } } 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`."] @@ -15688,9 +15688,9 @@ pub mod get_replica_health { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15792,8 +15792,8 @@ pub mod get_replica_health { } } 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`."] @@ -15813,9 +15813,9 @@ pub mod get_replica_health_using_policy { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15928,8 +15928,8 @@ pub mod get_replica_health_using_policy { } } 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`."] @@ -16194,9 +16194,9 @@ pub mod get_deployed_service_replica_detail_info { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16289,8 +16289,8 @@ pub mod get_deployed_service_replica_detail_info { } } 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`."] @@ -16310,9 +16310,9 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16403,8 +16403,8 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { } } 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`."] diff --git a/services/svc/servicefabric/src/v8_1/models.rs b/services/svc/servicefabric/src/v8_1/models.rs index 1f248d52ad..ca676c3031 100644 --- a/services/svc/servicefabric/src/v8_1/models.rs +++ b/services/svc/servicefabric/src/v8_1/models.rs @@ -1141,10 +1141,10 @@ pub struct ApplicationScopedVolume { pub volume_reference: VolumeReference, #[doc = "Describes parameters for creating application-scoped volumes."] #[serde(rename = "creationParameters")] - pub creation_parameters: ApplicationScopedVolumeCreationParameters, + pub creation_parameters: ApplicationScopedVolumeCreationParametersUnion, } impl ApplicationScopedVolume { - pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParameters) -> Self { + pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParametersUnion) -> Self { Self { volume_reference, creation_parameters, @@ -1165,6 +1165,11 @@ impl ApplicationScopedVolumeCreationParameters { Self { kind, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ApplicationScopedVolumeCreationParametersUnion { + ServiceFabricVolumeDisk(ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk), +} #[doc = "Describes parameters for creating application-scoped volumes provided by Service Fabric Volume Disks"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk { @@ -1902,6 +1907,11 @@ impl AutoScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMechanismUnion { + AddRemoveReplica(AddRemoveReplicaScalingMechanism), +} #[doc = "Enumerates the mechanisms for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMechanismKind")] @@ -1948,6 +1958,11 @@ impl AutoScalingMetric { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMetricUnion { + Resource(AutoScalingResourceMetric), +} #[doc = "Enumerates the metrics that are used for triggering auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMetricKind")] @@ -1989,12 +2004,12 @@ pub struct AutoScalingPolicy { #[doc = "The name of the auto scaling policy."] pub name: String, #[doc = "Describes the trigger for performing auto scaling operation."] - pub trigger: AutoScalingTrigger, + pub trigger: AutoScalingTriggerUnion, #[doc = "Describes the mechanism for performing auto scaling operation. Derived classes will describe the actual mechanism."] - pub mechanism: AutoScalingMechanism, + pub mechanism: AutoScalingMechanismUnion, } impl AutoScalingPolicy { - pub fn new(name: String, trigger: AutoScalingTrigger, mechanism: AutoScalingMechanism) -> Self { + pub fn new(name: String, trigger: AutoScalingTriggerUnion, mechanism: AutoScalingMechanismUnion) -> Self { Self { name, trigger, mechanism } } } @@ -2061,6 +2076,11 @@ impl AutoScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingTriggerUnion { + AverageLoad(AverageLoadScalingTrigger), +} #[doc = "Enumerates the triggers for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingTriggerKind")] @@ -2102,7 +2122,7 @@ pub struct AverageLoadScalingTrigger { #[serde(flatten)] pub auto_scaling_trigger: AutoScalingTrigger, #[doc = "Describes the metric that is used for triggering auto scaling operation. Derived classes will describe resources or metrics."] - pub metric: AutoScalingMetric, + pub metric: AutoScalingMetricUnion, #[doc = "Lower load threshold (if average load is below this threshold, service will scale down)."] #[serde(rename = "lowerLoadThreshold")] pub lower_load_threshold: f64, @@ -2116,7 +2136,7 @@ pub struct AverageLoadScalingTrigger { impl AverageLoadScalingTrigger { pub fn new( auto_scaling_trigger: AutoScalingTrigger, - metric: AutoScalingMetric, + metric: AutoScalingMetricUnion, lower_load_threshold: f64, upper_load_threshold: f64, scale_interval_in_seconds: i64, @@ -2285,6 +2305,13 @@ impl BackupConfigurationInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum BackupConfigurationInfoUnion { + Application(ApplicationBackupConfigurationInfo), + Partition(PartitionBackupConfigurationInfo), + Service(ServiceBackupConfigurationInfo), +} #[doc = "Describes the Service Fabric entity that is configured for backup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupEntity { @@ -2297,6 +2324,13 @@ impl BackupEntity { Self { entity_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "EntityKind")] +pub enum BackupEntityUnion { + Application(ApplicationBackupEntity), + Partition(PartitionBackupEntity), + Service(ServiceBackupEntity), +} #[doc = "The entity type of a Service Fabric entity such as Application, Service or a Partition where periodic backups can be enabled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupEntityKind")] @@ -2355,7 +2389,7 @@ pub struct BackupInfo { pub service_name: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, #[doc = "Location of the backup, relative to the backup store."] #[serde(rename = "BackupLocation", default, skip_serializing_if = "Option::is_none")] pub backup_location: Option, @@ -2388,7 +2422,7 @@ impl BackupInfo { pub struct BackupPartitionDescription { #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl BackupPartitionDescription { pub fn new() -> Self { @@ -2409,21 +2443,21 @@ pub struct BackupPolicyDescription { pub max_incremental_backups: i64, #[doc = "Describes the backup schedule parameters."] #[serde(rename = "Schedule")] - pub schedule: BackupScheduleDescription, + pub schedule: BackupScheduleDescriptionUnion, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the retention policy configured."] #[serde(rename = "RetentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl BackupPolicyDescription { pub fn new( name: String, auto_restore_on_data_loss: bool, max_incremental_backups: i64, - schedule: BackupScheduleDescription, - storage: BackupStorageDescription, + schedule: BackupScheduleDescriptionUnion, + storage: BackupStorageDescriptionUnion, ) -> Self { Self { name, @@ -2518,6 +2552,12 @@ impl BackupScheduleDescription { Self { schedule_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ScheduleKind")] +pub enum BackupScheduleDescriptionUnion { + FrequencyBased(FrequencyBasedBackupScheduleDescription), + TimeBased(TimeBasedBackupScheduleDescription), +} #[doc = "Describes the frequency with which to run the time based backup schedule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupScheduleFrequencyType")] @@ -2659,6 +2699,14 @@ impl BackupStorageDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "StorageKind")] +pub enum BackupStorageDescriptionUnion { + AzureBlobStore(AzureBlobBackupStorageDescription), + DsmsAzureBlobStore(DsmsAzureBlobBackupStorageDescription), + FileShare(FileShareBackupStorageDescription), + ManagedIdentityAzureBlobStore(ManagedIdentityAzureBlobBackupStorageDescription), +} #[doc = "The kind of backup storage, where backups are saved."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupStorageKind")] @@ -2933,6 +2981,16 @@ impl ChaosEvent { Self { kind, time_stamp_utc } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ChaosEventUnion { + ExecutingFaults(ExecutingFaultsChaosEvent), + Started(StartedChaosEvent), + Stopped(StoppedChaosEvent), + TestError(TestErrorChaosEvent), + ValidationFailed(ValidationFailedChaosEvent), + Waiting(WaitingChaosEvent), +} pub type ChaosEventHistory = Vec; #[doc = "The kind of Chaos event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -2986,7 +3044,7 @@ impl Serialize for ChaosEventKind { pub struct ChaosEventWrapper { #[doc = "Represents an event generated during a Chaos run."] #[serde(rename = "ChaosEvent", default, skip_serializing_if = "Option::is_none")] - pub chaos_event: Option, + pub chaos_event: Option, } impl ChaosEventWrapper { pub fn new() -> Self { @@ -3549,10 +3607,10 @@ pub struct CheckValuePropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl CheckValuePropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -5862,6 +5920,12 @@ impl DeployedServiceReplicaDetailInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaDetailInfoUnion { + Stateful(DeployedStatefulServiceReplicaDetailInfo), + Stateless(DeployedStatelessServiceInstanceDetailInfo), +} #[doc = "Information about a Service Fabric service replica deployed on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeployedServiceReplicaInfo { @@ -5912,6 +5976,12 @@ impl DeployedServiceReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaInfoUnion { + Stateful(DeployedStatefulServiceReplicaInfo), + Stateless(DeployedStatelessServiceInstanceInfo), +} pub type DeployedServiceReplicaInfoList = Vec; #[doc = "Information about service type deployed on a node, information such as the status of the service type registration on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] @@ -5957,7 +6027,7 @@ pub struct DeployedStatefulServiceReplicaDetailInfo { pub write_status: Option, #[doc = "Represents a base class for primary or secondary replicator status.\nContains information about the service fabric replicator like the replication/copy queue utilization, last acknowledgement received timestamp, etc."] #[serde(rename = "ReplicatorStatus", default, skip_serializing_if = "Option::is_none")] - pub replicator_status: Option, + pub replicator_status: Option, #[doc = "Key value store related information for the replica."] #[serde(rename = "ReplicaStatus", default, skip_serializing_if = "Option::is_none")] pub replica_status: Option, @@ -6101,7 +6171,7 @@ pub struct DiagnosticsDescription { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, #[doc = "Status of whether or not sinks are enabled."] #[serde(default, skip_serializing_if = "Option::is_none")] pub enabled: Option, @@ -6199,6 +6269,11 @@ impl DiagnosticsSinkProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DiagnosticsSinkPropertiesUnion { + AzureInternalMonitoringPipeline(AzureInternalMonitoringPipelineSinkDescription), +} #[doc = "It describes the body parameters while disabling backup of a backup entity(Application/Service/Partition)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DisableBackupDescription { @@ -6631,6 +6706,12 @@ impl ExecutionPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ExecutionPolicyUnion { + Default(DefaultExecutionPolicy), + RunToCompletion(RunToCompletionExecutionPolicy), +} #[doc = "Enumerates the execution policy types for services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ExecutionPolicyType")] @@ -7169,6 +7250,17 @@ impl FabricEvent { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum FabricEventUnion { + ApplicationEvent(ApplicationEvent), + ClusterEvent(ClusterEvent), + ContainerInstanceEvent(ContainerInstanceEvent), + NodeEvent(NodeEvent), + PartitionEvent(PartitionEvent), + ReplicaEvent(ReplicaEvent), + ServiceEvent(ServiceEvent), +} #[doc = "The kind of FabricEvent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "FabricEventKind")] @@ -7765,13 +7857,13 @@ pub struct GetBackupByStorageQueryDescription { pub latest: Option, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the Service Fabric entity that is configured for backup."] #[serde(rename = "BackupEntity")] - pub backup_entity: BackupEntity, + pub backup_entity: BackupEntityUnion, } impl GetBackupByStorageQueryDescription { - pub fn new(storage: BackupStorageDescription, backup_entity: BackupEntity) -> Self { + pub fn new(storage: BackupStorageDescriptionUnion, backup_entity: BackupEntityUnion) -> Self { Self { start_date_time_filter: None, end_date_time_filter: None, @@ -7837,6 +7929,32 @@ impl HealthEvaluation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum HealthEvaluationUnion { + Application(ApplicationHealthEvaluation), + ApplicationTypeApplications(ApplicationTypeApplicationsHealthEvaluation), + Applications(ApplicationsHealthEvaluation), + DeltaNodesCheck(DeltaNodesCheckHealthEvaluation), + DeployedApplication(DeployedApplicationHealthEvaluation), + DeployedApplications(DeployedApplicationsHealthEvaluation), + DeployedServicePackage(DeployedServicePackageHealthEvaluation), + DeployedServicePackages(DeployedServicePackagesHealthEvaluation), + Event(EventHealthEvaluation), + Node(NodeHealthEvaluation), + NodeTypeNodes(NodeTypeNodesHealthEvaluation), + Nodes(NodesHealthEvaluation), + Partition(PartitionHealthEvaluation), + Partitions(PartitionsHealthEvaluation), + Replica(ReplicaHealthEvaluation), + Replicas(ReplicasHealthEvaluation), + Service(ServiceHealthEvaluation), + Services(ServicesHealthEvaluation), + SystemApplication(SystemApplicationHealthEvaluation), + UpgradeDomainDeltaNodesCheck(UpgradeDomainDeltaNodesCheckHealthEvaluation), + UpgradeDomainDeployedApplications(UpgradeDomainDeployedApplicationsHealthEvaluation), + UpgradeDomainNodes(UpgradeDomainNodesHealthEvaluation), +} #[doc = "The health manager in the cluster performs health evaluations in determining the aggregated health state of an entity. This enumeration provides information on the kind of evaluation that was performed. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "HealthEvaluationKind")] @@ -7927,7 +8045,7 @@ impl Serialize for HealthEvaluationKind { pub struct HealthEvaluationWrapper { #[doc = "Represents a health evaluation which describes the data and the algorithm used by health manager to evaluate the health of an entity."] #[serde(rename = "HealthEvaluation", default, skip_serializing_if = "Option::is_none")] - pub health_evaluation: Option, + pub health_evaluation: Option, } impl HealthEvaluationWrapper { pub fn new() -> Self { @@ -9236,6 +9354,9 @@ impl NetworkResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum NetworkResourcePropertiesBaseUnion {} pub type NextUpgradeDomain = String; #[doc = "Node Aborted event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -10849,7 +10970,7 @@ pub struct PagedBackupConfigurationInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupConfigurationInfoList { pub fn new() -> Self { @@ -10869,7 +10990,7 @@ pub struct PagedBackupEntityList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupEntityList { pub fn new() -> Self { @@ -11052,7 +11173,7 @@ pub struct PagedReplicaInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedReplicaInfoList { pub fn new() -> Self { @@ -11112,7 +11233,7 @@ pub struct PagedServiceInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServiceInfoList { pub fn new() -> Self { @@ -11132,7 +11253,7 @@ pub struct PagedServicePartitionInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServicePartitionInfoList { pub fn new() -> Self { @@ -11389,7 +11510,7 @@ pub struct PartitionHealth { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub replica_health_states: Vec, + pub replica_health_states: Vec, } impl PartitionHealth { pub fn new() -> Self { @@ -11562,6 +11683,13 @@ impl PartitionInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServicePartitionKind")] +pub enum PartitionInformationUnion { + Int64Range(Int64RangePartitionInformation), + Named(NamedPartitionInformation), + Singleton(SingletonPartitionInformation), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -11956,6 +12084,13 @@ impl PartitionSchemeDescription { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "PartitionScheme")] +pub enum PartitionSchemeDescriptionUnion { + Named(NamedPartitionSchemeDescription), + Singleton(SingletonPartitionSchemeDescription), + UniformInt64Range(UniformInt64RangePartitionSchemeDescription), +} #[doc = "Represents health evaluation for the partitions of a service, containing health evaluations for each unhealthy partition that impacts current aggregated health state. Can be returned when evaluating service health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionsHealthEvaluation { @@ -12160,7 +12295,7 @@ pub struct PropertyBatchDescriptionList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub operations: Vec, + pub operations: Vec, } impl PropertyBatchDescriptionList { pub fn new() -> Self { @@ -12179,6 +12314,12 @@ impl PropertyBatchInfo { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchInfoUnion { + Failed(FailedPropertyBatchInfo), + Successful(SuccessfulPropertyBatchInfo), +} #[doc = "The kind of property batch info, determined by the results of a property batch. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchInfoKind")] @@ -12233,6 +12374,16 @@ impl PropertyBatchOperation { Self { kind, property_name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchOperationUnion { + CheckExists(CheckExistsPropertyBatchOperation), + CheckSequence(CheckSequencePropertyBatchOperation), + CheckValue(CheckValuePropertyBatchOperation), + Delete(DeletePropertyBatchOperation), + Get(GetPropertyBatchOperation), + Put(PutPropertyBatchOperation), +} #[doc = "The kind of property batch operation, determined by the operation to be performed. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchOperationKind")] @@ -12292,10 +12443,10 @@ pub struct PropertyDescription { pub custom_type_id: Option, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl PropertyDescription { - pub fn new(property_name: PropertyName, value: PropertyValue) -> Self { + pub fn new(property_name: PropertyName, value: PropertyValueUnion) -> Self { Self { property_name, custom_type_id: None, @@ -12311,7 +12462,7 @@ pub struct PropertyInfo { pub name: PropertyName, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value", default, skip_serializing_if = "Option::is_none")] - pub value: Option, + pub value: Option, #[doc = "The metadata associated with a property, including the property's name."] #[serde(rename = "Metadata")] pub metadata: PropertyMetadata, @@ -12365,6 +12516,15 @@ impl PropertyValue { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyValueUnion { + Binary(BinaryPropertyValue), + Double(DoublePropertyValue), + Guid(GuidPropertyValue), + Int64(Int64PropertyValue), + String(StringPropertyValue), +} #[doc = "The kind of property, determined by the type of data. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyValueKind")] @@ -12449,6 +12609,12 @@ impl ProvisionApplicationTypeDescriptionBase { Self { kind, async_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ProvisionApplicationTypeDescriptionBaseUnion { + ExternalStore(ExternalStoreProvisionApplicationTypeDescription), + ImageStorePath(ProvisionApplicationTypeDescription), +} #[doc = "The kind of application type registration or provision requested. The application package can be registered or provisioned either from the image store or from an external store. Following are the kinds of the application type provision."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ProvisionApplicationTypeKind")] @@ -12510,13 +12676,13 @@ pub struct PutPropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, #[doc = "The property's custom type ID. Using this property, the user is able to tag the type of the value of the property."] #[serde(rename = "CustomTypeId", default, skip_serializing_if = "Option::is_none")] pub custom_type_id: Option, } impl PutPropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -12760,6 +12926,11 @@ impl RepairImpactDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairImpactDescriptionBaseUnion { + Node(NodeRepairImpactDescription), +} #[doc = "Specifies the kind of the impact. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairImpactKind")] @@ -12809,6 +12980,11 @@ impl RepairTargetDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairTargetDescriptionBaseUnion { + Node(NodeRepairTargetDescription), +} #[doc = "Specifies the kind of the repair target. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairTargetKind")] @@ -12869,7 +13045,7 @@ pub struct RepairTask { pub action: String, #[doc = "Describes the entities targeted by a repair action.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Target", default, skip_serializing_if = "Option::is_none")] - pub target: Option, + pub target: Option, #[doc = "The name of the repair executor. Must be specified in Claimed and later states, and is immutable once set."] #[serde(rename = "Executor", default, skip_serializing_if = "Option::is_none")] pub executor: Option, @@ -12878,7 +13054,7 @@ pub struct RepairTask { pub executor_data: Option, #[doc = "Describes the expected impact of executing a repair task.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Impact", default, skip_serializing_if = "Option::is_none")] - pub impact: Option, + pub impact: Option, #[doc = "A value describing the overall result of the repair task execution. Must be specified in the Restoring and later states, and is immutable once set."] #[serde(rename = "ResultStatus", default, skip_serializing_if = "Option::is_none")] pub result_status: Option, @@ -13260,6 +13436,12 @@ impl ReplicaHealth { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthUnion { + Stateful(StatefulServiceReplicaHealth), + Stateless(StatelessServiceInstanceHealth), +} #[doc = "Represents health evaluation for a replica, containing information about the data and the algorithm used by health store to evaluate health. The evaluation is returned only when the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicaHealthEvaluation { @@ -13306,6 +13488,12 @@ impl ReplicaHealthState { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthStateUnion { + Stateful(StatefulServiceReplicaHealthState), + Stateless(StatelessServiceInstanceHealthState), +} #[doc = "Represents the health state chunk of a stateful service replica or a stateless service instance.\nThe replica health state contains the replica ID and its aggregated health state."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicaHealthStateChunk { @@ -13388,6 +13576,12 @@ impl ReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaInfoUnion { + Stateful(StatefulServiceReplicaInfo), + Stateless(StatelessServiceInstanceInfo), +} #[doc = "The role of a replica of a stateful service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ReplicaKind")] @@ -13571,6 +13765,11 @@ impl ReplicaStatusBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicaStatusBaseUnion { + KeyValueStore(KeyValueStoreReplicaStatus), +} #[doc = "Represents health evaluation for replicas, containing health evaluations for each unhealthy replica that impacted current aggregated health state. Can be returned when evaluating partition health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicasHealthEvaluation { @@ -13692,6 +13891,11 @@ impl ReplicatorStatus { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicatorStatusUnion { + Primary(PrimaryReplicatorStatus), +} #[doc = "Endpoint of a resolved service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResolvedServiceEndpoint { @@ -13716,7 +13920,7 @@ pub struct ResolvedServicePartition { pub name: ServiceName, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation")] - pub partition_information: PartitionInformation, + pub partition_information: PartitionInformationUnion, #[doc = "List of resolved service endpoints of a service partition."] #[serde(rename = "Endpoints")] pub endpoints: ResolvedServiceEndpointList, @@ -13727,7 +13931,7 @@ pub struct ResolvedServicePartition { impl ResolvedServicePartition { pub fn new( name: ServiceName, - partition_information: PartitionInformation, + partition_information: PartitionInformationUnion, endpoints: ResolvedServiceEndpointList, version: String, ) -> Self { @@ -13983,7 +14187,7 @@ pub struct RestorePartitionDescription { pub backup_location: String, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl RestorePartitionDescription { pub fn new(backup_id: String, backup_location: String) -> Self { @@ -14099,6 +14303,11 @@ impl RetentionPolicyDescription { Self { retention_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "RetentionPolicyType")] +pub enum RetentionPolicyDescriptionUnion { + Basic(BasicRetentionPolicyDescription), +} #[doc = "The type of retention policy. Currently only \"Basic\" retention policy is supported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RetentionPolicyType")] @@ -14261,6 +14470,11 @@ impl SafetyCheck { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum SafetyCheckUnion { + EnsureSeedNodeQuorum(SeedNodeSafetyCheck), +} pub type SafetyCheckInfoList = Vec; #[doc = "The kind of safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state. Following are the kinds of safety checks."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -14316,7 +14530,7 @@ impl Serialize for SafetyCheckKind { pub struct SafetyCheckWrapper { #[doc = "Represents a safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state."] #[serde(rename = "SafetyCheck", default, skip_serializing_if = "Option::is_none")] - pub safety_check: Option, + pub safety_check: Option, } impl SafetyCheckWrapper { pub fn new() -> Self { @@ -14335,6 +14549,12 @@ impl ScalingMechanismDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingMechanismDescriptionUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + PartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingMechanismKind")] @@ -14381,13 +14601,13 @@ impl Serialize for ScalingMechanismKind { pub struct ScalingPolicyDescription { #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "ScalingTrigger")] - pub scaling_trigger: ScalingTriggerDescription, + pub scaling_trigger: ScalingTriggerDescriptionUnion, #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "ScalingMechanism")] - pub scaling_mechanism: ScalingMechanismDescription, + pub scaling_mechanism: ScalingMechanismDescriptionUnion, } impl ScalingPolicyDescription { - pub fn new(scaling_trigger: ScalingTriggerDescription, scaling_mechanism: ScalingMechanismDescription) -> Self { + pub fn new(scaling_trigger: ScalingTriggerDescriptionUnion, scaling_mechanism: ScalingMechanismDescriptionUnion) -> Self { Self { scaling_trigger, scaling_mechanism, @@ -14407,6 +14627,12 @@ impl ScalingTriggerDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingTriggerDescriptionUnion { + AveragePartitionLoad(AveragePartitionLoadScalingTrigger), + AverageServiceLoad(AverageServiceLoadScalingTrigger), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingTriggerKind")] @@ -14606,6 +14832,9 @@ impl SecretResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecretResourcePropertiesBaseUnion {} #[doc = "This type represents the unencrypted value of the secret."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretValue { @@ -14915,7 +15144,7 @@ pub struct ServiceDescription { pub initialization_data: Option, #[doc = "Describes how the service is partitioned."] #[serde(rename = "PartitionDescription")] - pub partition_description: PartitionSchemeDescription, + pub partition_description: PartitionSchemeDescriptionUnion, #[doc = "The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: \"NodeColor == blue)\"."] #[serde(rename = "PlacementConstraints", default, skip_serializing_if = "Option::is_none")] pub placement_constraints: Option, @@ -14955,7 +15184,7 @@ impl ServiceDescription { service_kind: ServiceKind, service_name: ServiceName, service_type_name: ServiceTypeName, - partition_description: PartitionSchemeDescription, + partition_description: PartitionSchemeDescriptionUnion, ) -> Self { Self { service_kind, @@ -14978,6 +15207,12 @@ impl ServiceDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceDescriptionUnion { + Stateful(StatefulServiceDescription), + Stateless(StatelessServiceDescription), +} #[doc = "The role of the replica where the endpoint is reported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceEndpointRole")] @@ -15300,6 +15535,12 @@ impl ServiceInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceInfoUnion { + Stateful(StatefulServiceInfo), + Stateless(StatelessServiceInfo), +} #[doc = "The kind of service (Stateless or Stateful)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceKind")] @@ -15589,7 +15830,7 @@ pub struct ServicePartitionInfo { pub partition_status: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, } impl ServicePartitionInfo { pub fn new(service_kind: ServiceKind) -> Self { @@ -15601,6 +15842,12 @@ impl ServicePartitionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServicePartitionInfoUnion { + Stateful(StatefulServicePartitionInfo), + Stateless(StatelessServicePartitionInfo), +} #[doc = "The kind of partitioning scheme used to partition the service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePartitionKind")] @@ -15747,6 +15994,16 @@ impl ServicePlacementPolicyDescription { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Type")] +pub enum ServicePlacementPolicyDescriptionUnion { + AllowMultipleStatelessInstancesOnNode(ServicePlacementAllowMultipleStatelessInstancesOnNodePolicyDescription), + InvalidDomain(ServicePlacementInvalidDomainPolicyDescription), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicyDescription), + PreferPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicyDescription), + RequireDomainDistribution(ServicePlacementRequireDomainDistributionPolicyDescription), + RequireDomain(ServicePlacementRequiredDomainPolicyDescription), +} pub type ServicePlacementPolicyDescriptionList = Vec; #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -15863,7 +16120,7 @@ pub struct ServiceProperties { pub replica_count: Option, #[doc = "The execution policy of the service"] #[serde(rename = "executionPolicy", default, skip_serializing_if = "Option::is_none")] - pub execution_policy: Option, + pub execution_policy: Option, #[doc = "Auto scaling policies"] #[serde( rename = "autoScalingPolicies", @@ -16062,6 +16319,12 @@ impl ServiceTypeDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ServiceTypeDescriptionUnion { + Stateful(StatefulServiceTypeDescription), + Stateless(StatelessServiceTypeDescription), +} #[doc = "Describes extension of a service type defined in the service manifest."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceTypeExtensionDescription { @@ -16125,7 +16388,7 @@ impl ServiceTypeHealthPolicyMapItem { pub struct ServiceTypeInfo { #[doc = "Describes a service type defined in the service manifest of a provisioned application type. The properties the ones defined in the service manifest."] #[serde(rename = "ServiceTypeDescription", default, skip_serializing_if = "Option::is_none")] - pub service_type_description: Option, + pub service_type_description: Option, #[doc = "The name of the service manifest."] #[serde(rename = "ServiceManifestName", default, skip_serializing_if = "Option::is_none")] pub service_manifest_name: Option, @@ -16250,6 +16513,12 @@ impl ServiceUpdateDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceUpdateDescriptionUnion { + Stateful(StatefulServiceUpdateDescription), + Stateless(StatelessServiceUpdateDescription), +} #[doc = "Information about how many replicas are completed or pending for a specific service during upgrade."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceUpgradeProgress { diff --git a/services/svc/servicefabric/src/v8_2/mod.rs b/services/svc/servicefabric/src/v8_2/mod.rs index 5ef36113a9..24af4ba8aa 100644 --- a/services/svc/servicefabric/src/v8_2/mod.rs +++ b/services/svc/servicefabric/src/v8_2/mod.rs @@ -672,7 +672,7 @@ impl Client { #[doc = "* `provision_application_type_description_base_required_body_param`: The base type of provision application type description which supports either image store-based provision or external store-based provision."] pub fn provision_application_type( &self, - provision_application_type_description_base_required_body_param: impl Into, + provision_application_type_description_base_required_body_param: impl Into, ) -> provision_application_type::RequestBuilder { provision_application_type::RequestBuilder { client: self.clone(), @@ -1183,7 +1183,7 @@ impl Client { pub fn create_service( &self, application_id: impl Into, - service_description: impl Into, + service_description: impl Into, ) -> create_service::RequestBuilder { create_service::RequestBuilder { client: self.clone(), @@ -1232,7 +1232,7 @@ impl Client { pub fn update_service( &self, service_id: impl Into, - service_update_description: impl Into, + service_update_description: impl Into, ) -> update_service::RequestBuilder { update_service::RequestBuilder { client: self.clone(), @@ -8104,7 +8104,7 @@ pub mod provision_application_type { #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::Client, - pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBase, + pub(crate) provision_application_type_description_base_required_body_param: models::ProvisionApplicationTypeDescriptionBaseUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11404,9 +11404,9 @@ pub mod get_service_info { #[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::ServiceInfo = serde_json::from_slice(&bytes)?; + let body: models::ServiceInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11497,8 +11497,8 @@ pub mod get_service_info { } } 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`."] @@ -11669,7 +11669,7 @@ pub mod create_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) application_id: String, - pub(crate) service_description: models::ServiceDescription, + pub(crate) service_description: models::ServiceDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -11966,7 +11966,7 @@ pub mod update_service { pub struct RequestBuilder { pub(crate) client: super::Client, pub(crate) service_id: String, - pub(crate) service_update_description: models::ServiceUpdateDescription, + pub(crate) service_update_description: models::ServiceUpdateDescriptionUnion, pub(crate) timeout: Option, } impl RequestBuilder { @@ -12020,9 +12020,9 @@ pub mod get_service_description { #[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::ServiceDescription = serde_json::from_slice(&bytes)?; + let body: models::ServiceDescriptionUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12111,8 +12111,8 @@ pub mod get_service_description { } } 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`."] @@ -13058,9 +13058,9 @@ pub mod get_partition_info { #[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::ServicePartitionInfo = serde_json::from_slice(&bytes)?; + let body: models::ServicePartitionInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13145,8 +13145,8 @@ pub mod get_partition_info { } } 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`."] @@ -15698,9 +15698,9 @@ pub mod get_replica_info { #[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::ReplicaInfo = serde_json::from_slice(&bytes)?; + let body: models::ReplicaInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15791,8 +15791,8 @@ pub mod get_replica_info { } } 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`."] @@ -15812,9 +15812,9 @@ pub mod get_replica_health { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15916,8 +15916,8 @@ pub mod get_replica_health { } } 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`."] @@ -15937,9 +15937,9 @@ pub mod get_replica_health_using_policy { #[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::ReplicaHealth = serde_json::from_slice(&bytes)?; + let body: models::ReplicaHealthUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16052,8 +16052,8 @@ pub mod get_replica_health_using_policy { } } 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`."] @@ -16318,9 +16318,9 @@ pub mod get_deployed_service_replica_detail_info { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16413,8 +16413,8 @@ pub mod get_deployed_service_replica_detail_info { } } 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`."] @@ -16434,9 +16434,9 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { #[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::DeployedServiceReplicaDetailInfo = serde_json::from_slice(&bytes)?; + let body: models::DeployedServiceReplicaDetailInfoUnion = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16527,8 +16527,8 @@ pub mod get_deployed_service_replica_detail_info_by_partition_id { } } 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`."] diff --git a/services/svc/servicefabric/src/v8_2/models.rs b/services/svc/servicefabric/src/v8_2/models.rs index e4633154c2..0455c7042c 100644 --- a/services/svc/servicefabric/src/v8_2/models.rs +++ b/services/svc/servicefabric/src/v8_2/models.rs @@ -1141,10 +1141,10 @@ pub struct ApplicationScopedVolume { pub volume_reference: VolumeReference, #[doc = "Describes parameters for creating application-scoped volumes."] #[serde(rename = "creationParameters")] - pub creation_parameters: ApplicationScopedVolumeCreationParameters, + pub creation_parameters: ApplicationScopedVolumeCreationParametersUnion, } impl ApplicationScopedVolume { - pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParameters) -> Self { + pub fn new(volume_reference: VolumeReference, creation_parameters: ApplicationScopedVolumeCreationParametersUnion) -> Self { Self { volume_reference, creation_parameters, @@ -1165,6 +1165,11 @@ impl ApplicationScopedVolumeCreationParameters { Self { kind, description: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum ApplicationScopedVolumeCreationParametersUnion { + ServiceFabricVolumeDisk(ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk), +} #[doc = "Describes parameters for creating application-scoped volumes provided by Service Fabric Volume Disks"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk { @@ -1911,6 +1916,11 @@ impl AutoScalingMechanism { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMechanismUnion { + AddRemoveReplica(AddRemoveReplicaScalingMechanism), +} #[doc = "Enumerates the mechanisms for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMechanismKind")] @@ -1957,6 +1967,11 @@ impl AutoScalingMetric { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingMetricUnion { + Resource(AutoScalingResourceMetric), +} #[doc = "Enumerates the metrics that are used for triggering auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingMetricKind")] @@ -1998,12 +2013,12 @@ pub struct AutoScalingPolicy { #[doc = "The name of the auto scaling policy."] pub name: String, #[doc = "Describes the trigger for performing auto scaling operation."] - pub trigger: AutoScalingTrigger, + pub trigger: AutoScalingTriggerUnion, #[doc = "Describes the mechanism for performing auto scaling operation. Derived classes will describe the actual mechanism."] - pub mechanism: AutoScalingMechanism, + pub mechanism: AutoScalingMechanismUnion, } impl AutoScalingPolicy { - pub fn new(name: String, trigger: AutoScalingTrigger, mechanism: AutoScalingMechanism) -> Self { + pub fn new(name: String, trigger: AutoScalingTriggerUnion, mechanism: AutoScalingMechanismUnion) -> Self { Self { name, trigger, mechanism } } } @@ -2070,6 +2085,11 @@ impl AutoScalingTrigger { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum AutoScalingTriggerUnion { + AverageLoad(AverageLoadScalingTrigger), +} #[doc = "Enumerates the triggers for auto scaling."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AutoScalingTriggerKind")] @@ -2111,7 +2131,7 @@ pub struct AverageLoadScalingTrigger { #[serde(flatten)] pub auto_scaling_trigger: AutoScalingTrigger, #[doc = "Describes the metric that is used for triggering auto scaling operation. Derived classes will describe resources or metrics."] - pub metric: AutoScalingMetric, + pub metric: AutoScalingMetricUnion, #[doc = "Lower load threshold (if average load is below this threshold, service will scale down)."] #[serde(rename = "lowerLoadThreshold")] pub lower_load_threshold: f64, @@ -2125,7 +2145,7 @@ pub struct AverageLoadScalingTrigger { impl AverageLoadScalingTrigger { pub fn new( auto_scaling_trigger: AutoScalingTrigger, - metric: AutoScalingMetric, + metric: AutoScalingMetricUnion, lower_load_threshold: f64, upper_load_threshold: f64, scale_interval_in_seconds: i64, @@ -2294,6 +2314,13 @@ impl BackupConfigurationInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum BackupConfigurationInfoUnion { + Application(ApplicationBackupConfigurationInfo), + Partition(PartitionBackupConfigurationInfo), + Service(ServiceBackupConfigurationInfo), +} #[doc = "Describes the Service Fabric entity that is configured for backup."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupEntity { @@ -2306,6 +2333,13 @@ impl BackupEntity { Self { entity_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "EntityKind")] +pub enum BackupEntityUnion { + Application(ApplicationBackupEntity), + Partition(PartitionBackupEntity), + Service(ServiceBackupEntity), +} #[doc = "The entity type of a Service Fabric entity such as Application, Service or a Partition where periodic backups can be enabled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupEntityKind")] @@ -2364,7 +2398,7 @@ pub struct BackupInfo { pub service_name: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, #[doc = "Location of the backup, relative to the backup store."] #[serde(rename = "BackupLocation", default, skip_serializing_if = "Option::is_none")] pub backup_location: Option, @@ -2397,7 +2431,7 @@ impl BackupInfo { pub struct BackupPartitionDescription { #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl BackupPartitionDescription { pub fn new() -> Self { @@ -2418,21 +2452,21 @@ pub struct BackupPolicyDescription { pub max_incremental_backups: i64, #[doc = "Describes the backup schedule parameters."] #[serde(rename = "Schedule")] - pub schedule: BackupScheduleDescription, + pub schedule: BackupScheduleDescriptionUnion, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the retention policy configured."] #[serde(rename = "RetentionPolicy", default, skip_serializing_if = "Option::is_none")] - pub retention_policy: Option, + pub retention_policy: Option, } impl BackupPolicyDescription { pub fn new( name: String, auto_restore_on_data_loss: bool, max_incremental_backups: i64, - schedule: BackupScheduleDescription, - storage: BackupStorageDescription, + schedule: BackupScheduleDescriptionUnion, + storage: BackupStorageDescriptionUnion, ) -> Self { Self { name, @@ -2527,6 +2561,12 @@ impl BackupScheduleDescription { Self { schedule_kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ScheduleKind")] +pub enum BackupScheduleDescriptionUnion { + FrequencyBased(FrequencyBasedBackupScheduleDescription), + TimeBased(TimeBasedBackupScheduleDescription), +} #[doc = "Describes the frequency with which to run the time based backup schedule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupScheduleFrequencyType")] @@ -2668,6 +2708,14 @@ impl BackupStorageDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "StorageKind")] +pub enum BackupStorageDescriptionUnion { + AzureBlobStore(AzureBlobBackupStorageDescription), + DsmsAzureBlobStore(DsmsAzureBlobBackupStorageDescription), + FileShare(FileShareBackupStorageDescription), + ManagedIdentityAzureBlobStore(ManagedIdentityAzureBlobBackupStorageDescription), +} #[doc = "The kind of backup storage, where backups are saved."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BackupStorageKind")] @@ -2942,6 +2990,16 @@ impl ChaosEvent { Self { kind, time_stamp_utc } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ChaosEventUnion { + ExecutingFaults(ExecutingFaultsChaosEvent), + Started(StartedChaosEvent), + Stopped(StoppedChaosEvent), + TestError(TestErrorChaosEvent), + ValidationFailed(ValidationFailedChaosEvent), + Waiting(WaitingChaosEvent), +} pub type ChaosEventHistory = Vec; #[doc = "The kind of Chaos event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -2995,7 +3053,7 @@ impl Serialize for ChaosEventKind { pub struct ChaosEventWrapper { #[doc = "Represents an event generated during a Chaos run."] #[serde(rename = "ChaosEvent", default, skip_serializing_if = "Option::is_none")] - pub chaos_event: Option, + pub chaos_event: Option, } impl ChaosEventWrapper { pub fn new() -> Self { @@ -3558,10 +3616,10 @@ pub struct CheckValuePropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl CheckValuePropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -5899,6 +5957,12 @@ impl DeployedServiceReplicaDetailInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaDetailInfoUnion { + Stateful(DeployedStatefulServiceReplicaDetailInfo), + Stateless(DeployedStatelessServiceInstanceDetailInfo), +} #[doc = "Information about a Service Fabric service replica deployed on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeployedServiceReplicaInfo { @@ -5949,6 +6013,12 @@ impl DeployedServiceReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum DeployedServiceReplicaInfoUnion { + Stateful(DeployedStatefulServiceReplicaInfo), + Stateless(DeployedStatelessServiceInstanceInfo), +} pub type DeployedServiceReplicaInfoList = Vec; #[doc = "Information about service type deployed on a node, information such as the status of the service type registration on a node."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] @@ -5994,7 +6064,7 @@ pub struct DeployedStatefulServiceReplicaDetailInfo { pub write_status: Option, #[doc = "Represents a base class for primary or secondary replicator status.\nContains information about the service fabric replicator like the replication/copy queue utilization, last acknowledgement received timestamp, etc."] #[serde(rename = "ReplicatorStatus", default, skip_serializing_if = "Option::is_none")] - pub replicator_status: Option, + pub replicator_status: Option, #[doc = "Key value store related information for the replica."] #[serde(rename = "ReplicaStatus", default, skip_serializing_if = "Option::is_none")] pub replica_status: Option, @@ -6138,7 +6208,7 @@ pub struct DiagnosticsDescription { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, #[doc = "Status of whether or not sinks are enabled."] #[serde(default, skip_serializing_if = "Option::is_none")] pub enabled: Option, @@ -6236,6 +6306,11 @@ impl DiagnosticsSinkProperties { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum DiagnosticsSinkPropertiesUnion { + AzureInternalMonitoringPipeline(AzureInternalMonitoringPipelineSinkDescription), +} #[doc = "It describes the body parameters while disabling backup of a backup entity(Application/Service/Partition)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DisableBackupDescription { @@ -6668,6 +6743,12 @@ impl ExecutionPolicy { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ExecutionPolicyUnion { + Default(DefaultExecutionPolicy), + RunToCompletion(RunToCompletionExecutionPolicy), +} #[doc = "Enumerates the execution policy types for services."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ExecutionPolicyType")] @@ -7206,6 +7287,17 @@ impl FabricEvent { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum FabricEventUnion { + ApplicationEvent(ApplicationEvent), + ClusterEvent(ClusterEvent), + ContainerInstanceEvent(ContainerInstanceEvent), + NodeEvent(NodeEvent), + PartitionEvent(PartitionEvent), + ReplicaEvent(ReplicaEvent), + ServiceEvent(ServiceEvent), +} #[doc = "The kind of FabricEvent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "FabricEventKind")] @@ -7802,13 +7894,13 @@ pub struct GetBackupByStorageQueryDescription { pub latest: Option, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "Storage")] - pub storage: BackupStorageDescription, + pub storage: BackupStorageDescriptionUnion, #[doc = "Describes the Service Fabric entity that is configured for backup."] #[serde(rename = "BackupEntity")] - pub backup_entity: BackupEntity, + pub backup_entity: BackupEntityUnion, } impl GetBackupByStorageQueryDescription { - pub fn new(storage: BackupStorageDescription, backup_entity: BackupEntity) -> Self { + pub fn new(storage: BackupStorageDescriptionUnion, backup_entity: BackupEntityUnion) -> Self { Self { start_date_time_filter: None, end_date_time_filter: None, @@ -7874,6 +7966,32 @@ impl HealthEvaluation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum HealthEvaluationUnion { + Application(ApplicationHealthEvaluation), + ApplicationTypeApplications(ApplicationTypeApplicationsHealthEvaluation), + Applications(ApplicationsHealthEvaluation), + DeltaNodesCheck(DeltaNodesCheckHealthEvaluation), + DeployedApplication(DeployedApplicationHealthEvaluation), + DeployedApplications(DeployedApplicationsHealthEvaluation), + DeployedServicePackage(DeployedServicePackageHealthEvaluation), + DeployedServicePackages(DeployedServicePackagesHealthEvaluation), + Event(EventHealthEvaluation), + Node(NodeHealthEvaluation), + NodeTypeNodes(NodeTypeNodesHealthEvaluation), + Nodes(NodesHealthEvaluation), + Partition(PartitionHealthEvaluation), + Partitions(PartitionsHealthEvaluation), + Replica(ReplicaHealthEvaluation), + Replicas(ReplicasHealthEvaluation), + Service(ServiceHealthEvaluation), + Services(ServicesHealthEvaluation), + SystemApplication(SystemApplicationHealthEvaluation), + UpgradeDomainDeltaNodesCheck(UpgradeDomainDeltaNodesCheckHealthEvaluation), + UpgradeDomainDeployedApplications(UpgradeDomainDeployedApplicationsHealthEvaluation), + UpgradeDomainNodes(UpgradeDomainNodesHealthEvaluation), +} #[doc = "The health manager in the cluster performs health evaluations in determining the aggregated health state of an entity. This enumeration provides information on the kind of evaluation that was performed. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "HealthEvaluationKind")] @@ -7964,7 +8082,7 @@ impl Serialize for HealthEvaluationKind { pub struct HealthEvaluationWrapper { #[doc = "Represents a health evaluation which describes the data and the algorithm used by health manager to evaluate the health of an entity."] #[serde(rename = "HealthEvaluation", default, skip_serializing_if = "Option::is_none")] - pub health_evaluation: Option, + pub health_evaluation: Option, } impl HealthEvaluationWrapper { pub fn new() -> Self { @@ -9273,6 +9391,9 @@ impl NetworkResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum NetworkResourcePropertiesBaseUnion {} pub type NextUpgradeDomain = String; #[doc = "Node Aborted event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -10896,7 +11017,7 @@ pub struct PagedBackupConfigurationInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupConfigurationInfoList { pub fn new() -> Self { @@ -10916,7 +11037,7 @@ pub struct PagedBackupEntityList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedBackupEntityList { pub fn new() -> Self { @@ -11099,7 +11220,7 @@ pub struct PagedReplicaInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedReplicaInfoList { pub fn new() -> Self { @@ -11159,7 +11280,7 @@ pub struct PagedServiceInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServiceInfoList { pub fn new() -> Self { @@ -11179,7 +11300,7 @@ pub struct PagedServicePartitionInfoList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub items: Vec, + pub items: Vec, } impl PagedServicePartitionInfoList { pub fn new() -> Self { @@ -11436,7 +11557,7 @@ pub struct PartitionHealth { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub replica_health_states: Vec, + pub replica_health_states: Vec, } impl PartitionHealth { pub fn new() -> Self { @@ -11609,6 +11730,13 @@ impl PartitionInformation { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServicePartitionKind")] +pub enum PartitionInformationUnion { + Int64Range(Int64RangePartitionInformation), + Named(NamedPartitionInformation), + Singleton(SingletonPartitionInformation), +} #[doc = "Represents a scaling mechanism for adding or removing instances of stateless service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionInstanceCountScaleMechanism { @@ -12003,6 +12131,13 @@ impl PartitionSchemeDescription { Self { partition_scheme } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "PartitionScheme")] +pub enum PartitionSchemeDescriptionUnion { + Named(NamedPartitionSchemeDescription), + Singleton(SingletonPartitionSchemeDescription), + UniformInt64Range(UniformInt64RangePartitionSchemeDescription), +} #[doc = "Represents health evaluation for the partitions of a service, containing health evaluations for each unhealthy partition that impacts current aggregated health state. Can be returned when evaluating service health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PartitionsHealthEvaluation { @@ -12207,7 +12342,7 @@ pub struct PropertyBatchDescriptionList { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub operations: Vec, + pub operations: Vec, } impl PropertyBatchDescriptionList { pub fn new() -> Self { @@ -12226,6 +12361,12 @@ impl PropertyBatchInfo { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchInfoUnion { + Failed(FailedPropertyBatchInfo), + Successful(SuccessfulPropertyBatchInfo), +} #[doc = "The kind of property batch info, determined by the results of a property batch. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchInfoKind")] @@ -12280,6 +12421,16 @@ impl PropertyBatchOperation { Self { kind, property_name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyBatchOperationUnion { + CheckExists(CheckExistsPropertyBatchOperation), + CheckSequence(CheckSequencePropertyBatchOperation), + CheckValue(CheckValuePropertyBatchOperation), + Delete(DeletePropertyBatchOperation), + Get(GetPropertyBatchOperation), + Put(PutPropertyBatchOperation), +} #[doc = "The kind of property batch operation, determined by the operation to be performed. The following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyBatchOperationKind")] @@ -12339,10 +12490,10 @@ pub struct PropertyDescription { pub custom_type_id: Option, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, } impl PropertyDescription { - pub fn new(property_name: PropertyName, value: PropertyValue) -> Self { + pub fn new(property_name: PropertyName, value: PropertyValueUnion) -> Self { Self { property_name, custom_type_id: None, @@ -12358,7 +12509,7 @@ pub struct PropertyInfo { pub name: PropertyName, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value", default, skip_serializing_if = "Option::is_none")] - pub value: Option, + pub value: Option, #[doc = "The metadata associated with a property, including the property's name."] #[serde(rename = "Metadata")] pub metadata: PropertyMetadata, @@ -12412,6 +12563,15 @@ impl PropertyValue { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum PropertyValueUnion { + Binary(BinaryPropertyValue), + Double(DoublePropertyValue), + Guid(GuidPropertyValue), + Int64(Int64PropertyValue), + String(StringPropertyValue), +} #[doc = "The kind of property, determined by the type of data. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PropertyValueKind")] @@ -12496,6 +12656,12 @@ impl ProvisionApplicationTypeDescriptionBase { Self { kind, async_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ProvisionApplicationTypeDescriptionBaseUnion { + ExternalStore(ExternalStoreProvisionApplicationTypeDescription), + ImageStorePath(ProvisionApplicationTypeDescription), +} #[doc = "The kind of application type registration or provision requested. The application package can be registered or provisioned either from the image store or from an external store. Following are the kinds of the application type provision."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ProvisionApplicationTypeKind")] @@ -12557,13 +12723,13 @@ pub struct PutPropertyBatchOperation { pub property_batch_operation: PropertyBatchOperation, #[doc = "Describes a Service Fabric property value."] #[serde(rename = "Value")] - pub value: PropertyValue, + pub value: PropertyValueUnion, #[doc = "The property's custom type ID. Using this property, the user is able to tag the type of the value of the property."] #[serde(rename = "CustomTypeId", default, skip_serializing_if = "Option::is_none")] pub custom_type_id: Option, } impl PutPropertyBatchOperation { - pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValue) -> Self { + pub fn new(property_batch_operation: PropertyBatchOperation, value: PropertyValueUnion) -> Self { Self { property_batch_operation, value, @@ -12807,6 +12973,11 @@ impl RepairImpactDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairImpactDescriptionBaseUnion { + Node(NodeRepairImpactDescription), +} #[doc = "Specifies the kind of the impact. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairImpactKind")] @@ -12856,6 +13027,11 @@ impl RepairTargetDescriptionBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum RepairTargetDescriptionBaseUnion { + Node(NodeRepairTargetDescription), +} #[doc = "Specifies the kind of the repair target. This type supports the Service Fabric platform; it is not meant to be used directly from your code.'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RepairTargetKind")] @@ -12916,7 +13092,7 @@ pub struct RepairTask { pub action: String, #[doc = "Describes the entities targeted by a repair action.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Target", default, skip_serializing_if = "Option::is_none")] - pub target: Option, + pub target: Option, #[doc = "The name of the repair executor. Must be specified in Claimed and later states, and is immutable once set."] #[serde(rename = "Executor", default, skip_serializing_if = "Option::is_none")] pub executor: Option, @@ -12925,7 +13101,7 @@ pub struct RepairTask { pub executor_data: Option, #[doc = "Describes the expected impact of executing a repair task.\n\nThis type supports the Service Fabric platform; it is not meant to be used directly from your code."] #[serde(rename = "Impact", default, skip_serializing_if = "Option::is_none")] - pub impact: Option, + pub impact: Option, #[doc = "A value describing the overall result of the repair task execution. Must be specified in the Restoring and later states, and is immutable once set."] #[serde(rename = "ResultStatus", default, skip_serializing_if = "Option::is_none")] pub result_status: Option, @@ -13307,6 +13483,12 @@ impl ReplicaHealth { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthUnion { + Stateful(StatefulServiceReplicaHealth), + Stateless(StatelessServiceInstanceHealth), +} #[doc = "Represents health evaluation for a replica, containing information about the data and the algorithm used by health store to evaluate health. The evaluation is returned only when the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicaHealthEvaluation { @@ -13353,6 +13535,12 @@ impl ReplicaHealthState { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaHealthStateUnion { + Stateful(StatefulServiceReplicaHealthState), + Stateless(StatelessServiceInstanceHealthState), +} #[doc = "Represents the health state chunk of a stateful service replica or a stateless service instance.\nThe replica health state contains the replica ID and its aggregated health state."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReplicaHealthStateChunk { @@ -13435,6 +13623,12 @@ impl ReplicaInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ReplicaInfoUnion { + Stateful(StatefulServiceReplicaInfo), + Stateless(StatelessServiceInstanceInfo), +} #[doc = "The role of a replica of a stateful service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ReplicaKind")] @@ -13618,6 +13812,11 @@ impl ReplicaStatusBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicaStatusBaseUnion { + KeyValueStore(KeyValueStoreReplicaStatus), +} #[doc = "Represents health evaluation for replicas, containing health evaluations for each unhealthy replica that impacted current aggregated health state. Can be returned when evaluating partition health and the aggregated health state is either Error or Warning."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplicasHealthEvaluation { @@ -13739,6 +13938,11 @@ impl ReplicatorStatus { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ReplicatorStatusUnion { + Primary(PrimaryReplicatorStatus), +} #[doc = "Endpoint of a resolved service partition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResolvedServiceEndpoint { @@ -13763,7 +13967,7 @@ pub struct ResolvedServicePartition { pub name: ServiceName, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation")] - pub partition_information: PartitionInformation, + pub partition_information: PartitionInformationUnion, #[doc = "List of resolved service endpoints of a service partition."] #[serde(rename = "Endpoints")] pub endpoints: ResolvedServiceEndpointList, @@ -13774,7 +13978,7 @@ pub struct ResolvedServicePartition { impl ResolvedServicePartition { pub fn new( name: ServiceName, - partition_information: PartitionInformation, + partition_information: PartitionInformationUnion, endpoints: ResolvedServiceEndpointList, version: String, ) -> Self { @@ -14030,7 +14234,7 @@ pub struct RestorePartitionDescription { pub backup_location: String, #[doc = "Describes the parameters for the backup storage."] #[serde(rename = "BackupStorage", default, skip_serializing_if = "Option::is_none")] - pub backup_storage: Option, + pub backup_storage: Option, } impl RestorePartitionDescription { pub fn new(backup_id: String, backup_location: String) -> Self { @@ -14146,6 +14350,11 @@ impl RetentionPolicyDescription { Self { retention_policy_type } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "RetentionPolicyType")] +pub enum RetentionPolicyDescriptionUnion { + Basic(BasicRetentionPolicyDescription), +} #[doc = "The type of retention policy. Currently only \"Basic\" retention policy is supported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RetentionPolicyType")] @@ -14308,6 +14517,11 @@ impl SafetyCheck { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum SafetyCheckUnion { + EnsureSeedNodeQuorum(SeedNodeSafetyCheck), +} pub type SafetyCheckInfoList = Vec; #[doc = "The kind of safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state. Following are the kinds of safety checks."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -14363,7 +14577,7 @@ impl Serialize for SafetyCheckKind { pub struct SafetyCheckWrapper { #[doc = "Represents a safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state."] #[serde(rename = "SafetyCheck", default, skip_serializing_if = "Option::is_none")] - pub safety_check: Option, + pub safety_check: Option, } impl SafetyCheckWrapper { pub fn new() -> Self { @@ -14382,6 +14596,12 @@ impl ScalingMechanismDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingMechanismDescriptionUnion { + AddRemoveIncrementalNamedPartition(AddRemoveIncrementalNamedPartitionScalingMechanism), + PartitionInstanceCount(PartitionInstanceCountScaleMechanism), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingMechanismKind")] @@ -14428,13 +14648,13 @@ impl Serialize for ScalingMechanismKind { pub struct ScalingPolicyDescription { #[doc = "Describes the trigger for performing a scaling operation."] #[serde(rename = "ScalingTrigger")] - pub scaling_trigger: ScalingTriggerDescription, + pub scaling_trigger: ScalingTriggerDescriptionUnion, #[doc = "Describes the mechanism for performing a scaling operation."] #[serde(rename = "ScalingMechanism")] - pub scaling_mechanism: ScalingMechanismDescription, + pub scaling_mechanism: ScalingMechanismDescriptionUnion, } impl ScalingPolicyDescription { - pub fn new(scaling_trigger: ScalingTriggerDescription, scaling_mechanism: ScalingMechanismDescription) -> Self { + pub fn new(scaling_trigger: ScalingTriggerDescriptionUnion, scaling_mechanism: ScalingMechanismDescriptionUnion) -> Self { Self { scaling_trigger, scaling_mechanism, @@ -14454,6 +14674,12 @@ impl ScalingTriggerDescription { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ScalingTriggerDescriptionUnion { + AveragePartitionLoad(AveragePartitionLoadScalingTrigger), + AverageServiceLoad(AverageServiceLoadScalingTrigger), +} #[doc = "Enumerates the ways that a service can be scaled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScalingTriggerKind")] @@ -14653,6 +14879,9 @@ impl SecretResourcePropertiesBase { Self { kind } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum SecretResourcePropertiesBaseUnion {} #[doc = "This type represents the unencrypted value of the secret."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecretValue { @@ -14962,7 +15191,7 @@ pub struct ServiceDescription { pub initialization_data: Option, #[doc = "Describes how the service is partitioned."] #[serde(rename = "PartitionDescription")] - pub partition_description: PartitionSchemeDescription, + pub partition_description: PartitionSchemeDescriptionUnion, #[doc = "The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: \"NodeColor == blue)\"."] #[serde(rename = "PlacementConstraints", default, skip_serializing_if = "Option::is_none")] pub placement_constraints: Option, @@ -15002,7 +15231,7 @@ impl ServiceDescription { service_kind: ServiceKind, service_name: ServiceName, service_type_name: ServiceTypeName, - partition_description: PartitionSchemeDescription, + partition_description: PartitionSchemeDescriptionUnion, ) -> Self { Self { service_kind, @@ -15025,6 +15254,12 @@ impl ServiceDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceDescriptionUnion { + Stateful(StatefulServiceDescription), + Stateless(StatelessServiceDescription), +} #[doc = "The role of the replica where the endpoint is reported."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceEndpointRole")] @@ -15390,6 +15625,12 @@ impl ServiceInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceInfoUnion { + Stateful(StatefulServiceInfo), + Stateless(StatelessServiceInfo), +} #[doc = "The kind of service (Stateless or Stateful)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServiceKind")] @@ -15679,7 +15920,7 @@ pub struct ServicePartitionInfo { pub partition_status: Option, #[doc = "Information about the partition identity, partitioning scheme and keys supported by it."] #[serde(rename = "PartitionInformation", default, skip_serializing_if = "Option::is_none")] - pub partition_information: Option, + pub partition_information: Option, } impl ServicePartitionInfo { pub fn new(service_kind: ServiceKind) -> Self { @@ -15691,6 +15932,12 @@ impl ServicePartitionInfo { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServicePartitionInfoUnion { + Stateful(StatefulServicePartitionInfo), + Stateless(StatelessServicePartitionInfo), +} #[doc = "The kind of partitioning scheme used to partition the service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ServicePartitionKind")] @@ -15837,6 +16084,16 @@ impl ServicePlacementPolicyDescription { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Type")] +pub enum ServicePlacementPolicyDescriptionUnion { + AllowMultipleStatelessInstancesOnNode(ServicePlacementAllowMultipleStatelessInstancesOnNodePolicyDescription), + InvalidDomain(ServicePlacementInvalidDomainPolicyDescription), + NonPartiallyPlaceService(ServicePlacementNonPartiallyPlaceServicePolicyDescription), + PreferPrimaryDomain(ServicePlacementPreferPrimaryDomainPolicyDescription), + RequireDomainDistribution(ServicePlacementRequireDomainDistributionPolicyDescription), + RequireDomain(ServicePlacementRequiredDomainPolicyDescription), +} pub type ServicePlacementPolicyDescriptionList = Vec; #[doc = "The type of placement policy for a service fabric service. Following are the possible values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -15953,7 +16210,7 @@ pub struct ServiceProperties { pub replica_count: Option, #[doc = "The execution policy of the service"] #[serde(rename = "executionPolicy", default, skip_serializing_if = "Option::is_none")] - pub execution_policy: Option, + pub execution_policy: Option, #[doc = "Auto scaling policies"] #[serde( rename = "autoScalingPolicies", @@ -16152,6 +16409,12 @@ impl ServiceTypeDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "Kind")] +pub enum ServiceTypeDescriptionUnion { + Stateful(StatefulServiceTypeDescription), + Stateless(StatelessServiceTypeDescription), +} #[doc = "Describes extension of a service type defined in the service manifest."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceTypeExtensionDescription { @@ -16215,7 +16478,7 @@ impl ServiceTypeHealthPolicyMapItem { pub struct ServiceTypeInfo { #[doc = "Describes a service type defined in the service manifest of a provisioned application type. The properties the ones defined in the service manifest."] #[serde(rename = "ServiceTypeDescription", default, skip_serializing_if = "Option::is_none")] - pub service_type_description: Option, + pub service_type_description: Option, #[doc = "The name of the service manifest."] #[serde(rename = "ServiceManifestName", default, skip_serializing_if = "Option::is_none")] pub service_manifest_name: Option, @@ -16340,6 +16603,12 @@ impl ServiceUpdateDescription { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "ServiceKind")] +pub enum ServiceUpdateDescriptionUnion { + Stateful(StatefulServiceUpdateDescription), + Stateless(StatelessServiceUpdateDescription), +} #[doc = "Information about how many replicas are completed or pending for a specific service during upgrade."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceUpgradeProgress { diff --git a/services/svc/timeseriesinsights/src/package_2020_07_31/models.rs b/services/svc/timeseriesinsights/src/package_2020_07_31/models.rs index e126c12341..ede26635f4 100644 --- a/services/svc/timeseriesinsights/src/package_2020_07_31/models.rs +++ b/services/svc/timeseriesinsights/src/package_2020_07_31/models.rs @@ -1538,3 +1538,13 @@ impl Variable { Self { kind, filter: None } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind")] +pub enum VariableUnion { + #[serde(rename = "aggregate")] + Aggregate(AggregateVariable), + #[serde(rename = "categorical")] + Categorical(CategoricalVariable), + #[serde(rename = "numeric")] + Numeric(NumericVariable), +} diff --git a/services/svc/videoanalyzer/src/package_ava_edge_1_0_0_preview/models.rs b/services/svc/videoanalyzer/src/package_ava_edge_1_0_0_preview/models.rs index ea71f62cb4..22f3999030 100644 --- a/services/svc/videoanalyzer/src/package_ava_edge_1_0_0_preview/models.rs +++ b/services/svc/videoanalyzer/src/package_ava_edge_1_0_0_preview/models.rs @@ -15,13 +15,19 @@ impl CertificateSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum CertificateSourceUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.PemCertificateList")] + MicrosoftVideoAnalyzerPemCertificateList(PemCertificateList), +} #[doc = "A processor that allows the pipeline topology to send video frames to a Cognitive Services Vision extension. Inference results are relayed to downstream nodes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CognitiveServicesVisionProcessor { #[serde(flatten)] pub processor_node_base: ProcessorNodeBase, #[doc = "Base class for endpoints."] - pub endpoint: EndpointBase, + pub endpoint: EndpointBaseUnion, #[doc = "Image transformations and formatting options to be applied to the video frame(s)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub image: Option, @@ -29,10 +35,10 @@ pub struct CognitiveServicesVisionProcessor { #[serde(rename = "samplingOptions", default, skip_serializing_if = "Option::is_none")] pub sampling_options: Option, #[doc = "Base class for Azure Cognitive Services Spatial Analysis operations."] - pub operation: SpatialAnalysisOperationBase, + pub operation: SpatialAnalysisOperationBaseUnion, } impl CognitiveServicesVisionProcessor { - pub fn new(processor_node_base: ProcessorNodeBase, endpoint: EndpointBase, operation: SpatialAnalysisOperationBase) -> Self { + pub fn new(processor_node_base: ProcessorNodeBase, endpoint: EndpointBaseUnion, operation: SpatialAnalysisOperationBaseUnion) -> Self { Self { processor_node_base, endpoint, @@ -54,6 +60,14 @@ impl CredentialsBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum CredentialsBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.HttpHeaderCredentials")] + MicrosoftVideoAnalyzerHttpHeaderCredentials(HttpHeaderCredentials), + #[serde(rename = "#Microsoft.VideoAnalyzer.UsernamePasswordCredentials")] + MicrosoftVideoAnalyzerUsernamePasswordCredentials(UsernamePasswordCredentials), +} #[doc = "Base class for endpoints."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EndpointBase { @@ -62,7 +76,7 @@ pub struct EndpointBase { pub type_: String, #[doc = "Base class for credential objects."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, + pub credentials: Option, #[doc = "The endpoint URL for Video Analyzer to connect to."] pub url: String, } @@ -75,13 +89,21 @@ impl EndpointBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum EndpointBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.TlsEndpoint")] + MicrosoftVideoAnalyzerTlsEndpoint(TlsEndpoint), + #[serde(rename = "#Microsoft.VideoAnalyzer.UnsecuredEndpoint")] + MicrosoftVideoAnalyzerUnsecuredEndpoint(UnsecuredEndpoint), +} #[doc = "Base class for pipeline extension processors. Pipeline extensions allow for custom media analysis and processing to be plugged into the Video Analyzer pipeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExtensionProcessorBase { #[serde(flatten)] pub processor_node_base: ProcessorNodeBase, #[doc = "Base class for endpoints."] - pub endpoint: EndpointBase, + pub endpoint: EndpointBaseUnion, #[doc = "Image transformations and formatting options to be applied to the video frame(s)."] pub image: ImageProperties, #[doc = "Defines how often media is submitted to the extension plugin."] @@ -89,7 +111,7 @@ pub struct ExtensionProcessorBase { pub sampling_options: Option, } impl ExtensionProcessorBase { - pub fn new(processor_node_base: ProcessorNodeBase, endpoint: EndpointBase, image: ImageProperties) -> Self { + pub fn new(processor_node_base: ProcessorNodeBase, endpoint: EndpointBaseUnion, image: ImageProperties) -> Self { Self { processor_node_base, endpoint, @@ -286,6 +308,18 @@ impl ImageFormatProperties { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum ImageFormatPropertiesUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.ImageFormatBmp")] + MicrosoftVideoAnalyzerImageFormatBmp(ImageFormatBmp), + #[serde(rename = "#Microsoft.VideoAnalyzer.ImageFormatJpeg")] + MicrosoftVideoAnalyzerImageFormatJpeg(ImageFormatJpeg), + #[serde(rename = "#Microsoft.VideoAnalyzer.ImageFormatPng")] + MicrosoftVideoAnalyzerImageFormatPng(ImageFormatPng), + #[serde(rename = "#Microsoft.VideoAnalyzer.ImageFormatRaw")] + MicrosoftVideoAnalyzerImageFormatRaw(ImageFormatRaw), +} #[doc = "Raw image formatting."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageFormatRaw { @@ -380,7 +414,7 @@ pub struct ImageProperties { pub scale: Option, #[doc = "Base class for image formatting properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, } impl ImageProperties { pub fn new() -> Self { @@ -490,10 +524,10 @@ pub struct LineCrossingProcessor { #[serde(flatten)] pub processor_node_base: ProcessorNodeBase, #[doc = "An array of lines used to compute line crossing events."] - pub lines: Vec, + pub lines: Vec, } impl LineCrossingProcessor { - pub fn new(processor_node_base: ProcessorNodeBase, lines: Vec) -> Self { + pub fn new(processor_node_base: ProcessorNodeBase, lines: Vec) -> Self { Self { processor_node_base, lines, @@ -736,6 +770,18 @@ pub mod method_request { N1_0, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "methodName")] +pub enum MethodRequestUnion { + #[serde(rename = "livePipelineList")] + LivePipelineList(LivePipelineListRequest), + #[serde(rename = "livePipelineSet")] + LivePipelineSet(LivePipelineSetRequest), + #[serde(rename = "pipelineTopologyList")] + PipelineTopologyList(PipelineTopologyListRequest), + #[serde(rename = "pipelineTopologySet")] + PipelineTopologySet(PipelineTopologySetRequest), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MethodRequestEmptyBodyBase { #[serde(flatten)] @@ -832,6 +878,12 @@ impl NamedLineBase { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum NamedLineBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.NamedLineString")] + MicrosoftVideoAnalyzerNamedLineString(NamedLineString), +} #[doc = "Describes a line configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NamedLineString { @@ -859,6 +911,12 @@ impl NamedPolygonBase { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum NamedPolygonBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.NamedPolygonString")] + MicrosoftVideoAnalyzerNamedPolygonString(NamedPolygonString), +} #[doc = "Describes a closed polygon configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NamedPolygonString { @@ -1258,21 +1316,21 @@ pub struct PipelineTopologyProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sources: Vec, + pub sources: Vec, #[doc = "List of the topology processor nodes. Processor nodes enable pipeline data to be analyzed, processed or transformed."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub processors: Vec, + pub processors: Vec, #[doc = "List of the topology sink nodes. Sink nodes allow pipeline data to be stored or exported."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, } impl PipelineTopologyProperties { pub fn new() -> Self { @@ -1328,6 +1386,22 @@ impl ProcessorNodeBase { Self { type_, name, inputs } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum ProcessorNodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.CognitiveServicesVisionProcessor")] + MicrosoftVideoAnalyzerCognitiveServicesVisionProcessor(CognitiveServicesVisionProcessor), + #[serde(rename = "#Microsoft.VideoAnalyzer.ExtensionProcessorBase")] + MicrosoftVideoAnalyzerExtensionProcessorBase(ExtensionProcessorBase), + #[serde(rename = "#Microsoft.VideoAnalyzer.LineCrossingProcessor")] + MicrosoftVideoAnalyzerLineCrossingProcessor(LineCrossingProcessor), + #[serde(rename = "#Microsoft.VideoAnalyzer.MotionDetectionProcessor")] + MicrosoftVideoAnalyzerMotionDetectionProcessor(MotionDetectionProcessor), + #[serde(rename = "#Microsoft.VideoAnalyzer.ObjectTrackingProcessor")] + MicrosoftVideoAnalyzerObjectTrackingProcessor(ObjectTrackingProcessor), + #[serde(rename = "#Microsoft.VideoAnalyzer.SignalGateProcessor")] + MicrosoftVideoAnalyzerSignalGateProcessor(SignalGateProcessor), +} #[doc = "RTSP source allows for media from an RTSP camera or generic RTSP server to be ingested into a live pipeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RtspSource { @@ -1337,10 +1411,10 @@ pub struct RtspSource { #[serde(default, skip_serializing_if = "Option::is_none")] pub transport: Option, #[doc = "Base class for endpoints."] - pub endpoint: EndpointBase, + pub endpoint: EndpointBaseUnion, } impl RtspSource { - pub fn new(source_node_base: SourceNodeBase, endpoint: EndpointBase) -> Self { + pub fn new(source_node_base: SourceNodeBase, endpoint: EndpointBaseUnion) -> Self { Self { source_node_base, transport: None, @@ -1450,6 +1524,16 @@ impl SinkNodeBase { Self { type_, name, inputs } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum SinkNodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.FileSink")] + MicrosoftVideoAnalyzerFileSink(FileSink), + #[serde(rename = "#Microsoft.VideoAnalyzer.IotHubMessageSink")] + MicrosoftVideoAnalyzerIotHubMessageSink(IotHubMessageSink), + #[serde(rename = "#Microsoft.VideoAnalyzer.VideoSink")] + MicrosoftVideoAnalyzerVideoSink(VideoSink), +} #[doc = "Base class for topology source nodes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SourceNodeBase { @@ -1464,6 +1548,14 @@ impl SourceNodeBase { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum SourceNodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.IotHubMessageSource")] + MicrosoftVideoAnalyzerIotHubMessageSource(IotHubMessageSource), + #[serde(rename = "#Microsoft.VideoAnalyzer.RtspSource")] + MicrosoftVideoAnalyzerRtspSource(RtspSource), +} #[doc = "Defines a Spatial Analysis custom operation. This requires the Azure Cognitive Services Spatial analysis module to be deployed alongside the Video Analyzer module, please see https://aka.ms/ava-spatial-analysis for more information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisCustomOperation { @@ -1493,6 +1585,12 @@ impl SpatialAnalysisOperationBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum SpatialAnalysisOperationBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.SpatialAnalysisCustomOperation")] + MicrosoftVideoAnalyzerSpatialAnalysisCustomOperation(SpatialAnalysisCustomOperation), +} #[doc = "Defines the Azure Cognitive Services Spatial Analysis operation eventing configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SpatialAnalysisOperationEventBase { @@ -1634,7 +1732,7 @@ impl SpatialAnalysisPersonCountOperation { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisPersonCountZoneEvents { #[doc = "Describes the named polygon."] - pub zone: NamedPolygonBase, + pub zone: NamedPolygonBaseUnion, #[doc = "The event configuration."] #[serde( default, @@ -1644,7 +1742,7 @@ pub struct SpatialAnalysisPersonCountZoneEvents { pub events: Vec, } impl SpatialAnalysisPersonCountZoneEvents { - pub fn new(zone: NamedPolygonBase) -> Self { + pub fn new(zone: NamedPolygonBaseUnion) -> Self { Self { zone, events: Vec::new() } } } @@ -1735,7 +1833,7 @@ impl SpatialAnalysisPersonDistanceOperation { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisPersonDistanceZoneEvents { #[doc = "Describes the named polygon."] - pub zone: NamedPolygonBase, + pub zone: NamedPolygonBaseUnion, #[doc = "The event configuration."] #[serde( default, @@ -1745,7 +1843,7 @@ pub struct SpatialAnalysisPersonDistanceZoneEvents { pub events: Vec, } impl SpatialAnalysisPersonDistanceZoneEvents { - pub fn new(zone: NamedPolygonBase) -> Self { + pub fn new(zone: NamedPolygonBaseUnion) -> Self { Self { zone, events: Vec::new() } } } @@ -1763,7 +1861,7 @@ impl SpatialAnalysisPersonLineCrossingEvent { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisPersonLineCrossingLineEvents { #[doc = "Base class for named lines."] - pub line: NamedLineBase, + pub line: NamedLineBaseUnion, #[doc = "The event configuration."] #[serde( default, @@ -1773,7 +1871,7 @@ pub struct SpatialAnalysisPersonLineCrossingLineEvents { pub events: Vec, } impl SpatialAnalysisPersonLineCrossingLineEvents { - pub fn new(line: NamedLineBase) -> Self { + pub fn new(line: NamedLineBaseUnion) -> Self { Self { line, events: Vec::new() } } } @@ -1874,7 +1972,7 @@ impl SpatialAnalysisPersonZoneCrossingOperation { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisPersonZoneCrossingZoneEvents { #[doc = "Describes the named polygon."] - pub zone: NamedPolygonBase, + pub zone: NamedPolygonBaseUnion, #[doc = "The event configuration."] #[serde( default, @@ -1884,7 +1982,7 @@ pub struct SpatialAnalysisPersonZoneCrossingZoneEvents { pub events: Vec, } impl SpatialAnalysisPersonZoneCrossingZoneEvents { - pub fn new(zone: NamedPolygonBase) -> Self { + pub fn new(zone: NamedPolygonBaseUnion) -> Self { Self { zone, events: Vec::new() } } } @@ -1939,7 +2037,7 @@ pub struct TlsEndpoint { pub endpoint_base: EndpointBase, #[doc = "Base class for certificate sources."] #[serde(rename = "trustedCertificates", default, skip_serializing_if = "Option::is_none")] - pub trusted_certificates: Option, + pub trusted_certificates: Option, #[doc = "Options for controlling the validation of TLS endpoints."] #[serde(rename = "validationOptions", default, skip_serializing_if = "Option::is_none")] pub validation_options: Option, diff --git a/services/svc/videoanalyzer/src/package_preview_1_1_0/models.rs b/services/svc/videoanalyzer/src/package_preview_1_1_0/models.rs index 5a5955dc3c..c5ff05d260 100644 --- a/services/svc/videoanalyzer/src/package_preview_1_1_0/models.rs +++ b/services/svc/videoanalyzer/src/package_preview_1_1_0/models.rs @@ -15,13 +15,19 @@ impl CertificateSource { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum CertificateSourceUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.PemCertificateList")] + MicrosoftVideoAnalyzerPemCertificateList(PemCertificateList), +} #[doc = "A processor that allows the pipeline topology to send video frames to a Cognitive Services Vision extension. Inference results are relayed to downstream nodes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CognitiveServicesVisionProcessor { #[serde(flatten)] pub processor_node_base: ProcessorNodeBase, #[doc = "Base class for endpoints."] - pub endpoint: EndpointBase, + pub endpoint: EndpointBaseUnion, #[doc = "Image transformations and formatting options to be applied to the video frame(s)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub image: Option, @@ -29,10 +35,10 @@ pub struct CognitiveServicesVisionProcessor { #[serde(rename = "samplingOptions", default, skip_serializing_if = "Option::is_none")] pub sampling_options: Option, #[doc = "Base class for Azure Cognitive Services Spatial Analysis operations."] - pub operation: SpatialAnalysisOperationBase, + pub operation: SpatialAnalysisOperationBaseUnion, } impl CognitiveServicesVisionProcessor { - pub fn new(processor_node_base: ProcessorNodeBase, endpoint: EndpointBase, operation: SpatialAnalysisOperationBase) -> Self { + pub fn new(processor_node_base: ProcessorNodeBase, endpoint: EndpointBaseUnion, operation: SpatialAnalysisOperationBaseUnion) -> Self { Self { processor_node_base, endpoint, @@ -54,6 +60,16 @@ impl CredentialsBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum CredentialsBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.HttpHeaderCredentials")] + MicrosoftVideoAnalyzerHttpHeaderCredentials(HttpHeaderCredentials), + #[serde(rename = "#Microsoft.VideoAnalyzer.SymmetricKeyCredentials")] + MicrosoftVideoAnalyzerSymmetricKeyCredentials(SymmetricKeyCredentials), + #[serde(rename = "#Microsoft.VideoAnalyzer.UsernamePasswordCredentials")] + MicrosoftVideoAnalyzerUsernamePasswordCredentials(UsernamePasswordCredentials), +} #[doc = "The discovered properties of the ONVIF device that are returned during the discovery."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiscoveredOnvifDevice { @@ -107,7 +123,7 @@ pub struct EndpointBase { pub type_: String, #[doc = "Base class for credential objects."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, + pub credentials: Option, #[doc = "The endpoint URL for Video Analyzer to connect to."] pub url: String, } @@ -120,13 +136,21 @@ impl EndpointBase { } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum EndpointBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.TlsEndpoint")] + MicrosoftVideoAnalyzerTlsEndpoint(TlsEndpoint), + #[serde(rename = "#Microsoft.VideoAnalyzer.UnsecuredEndpoint")] + MicrosoftVideoAnalyzerUnsecuredEndpoint(UnsecuredEndpoint), +} #[doc = "Base class for pipeline extension processors. Pipeline extensions allow for custom media analysis and processing to be plugged into the Video Analyzer pipeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ExtensionProcessorBase { #[serde(flatten)] pub processor_node_base: ProcessorNodeBase, #[doc = "Base class for endpoints."] - pub endpoint: EndpointBase, + pub endpoint: EndpointBaseUnion, #[doc = "Image transformations and formatting options to be applied to the video frame(s)."] pub image: ImageProperties, #[doc = "Defines how often media is submitted to the extension plugin."] @@ -134,7 +158,7 @@ pub struct ExtensionProcessorBase { pub sampling_options: Option, } impl ExtensionProcessorBase { - pub fn new(processor_node_base: ProcessorNodeBase, endpoint: EndpointBase, image: ImageProperties) -> Self { + pub fn new(processor_node_base: ProcessorNodeBase, endpoint: EndpointBaseUnion, image: ImageProperties) -> Self { Self { processor_node_base, endpoint, @@ -390,6 +414,18 @@ impl ImageFormatProperties { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum ImageFormatPropertiesUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.ImageFormatBmp")] + MicrosoftVideoAnalyzerImageFormatBmp(ImageFormatBmp), + #[serde(rename = "#Microsoft.VideoAnalyzer.ImageFormatJpeg")] + MicrosoftVideoAnalyzerImageFormatJpeg(ImageFormatJpeg), + #[serde(rename = "#Microsoft.VideoAnalyzer.ImageFormatPng")] + MicrosoftVideoAnalyzerImageFormatPng(ImageFormatPng), + #[serde(rename = "#Microsoft.VideoAnalyzer.ImageFormatRaw")] + MicrosoftVideoAnalyzerImageFormatRaw(ImageFormatRaw), +} #[doc = "Raw image formatting."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageFormatRaw { @@ -484,7 +520,7 @@ pub struct ImageProperties { pub scale: Option, #[doc = "Base class for image formatting properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, } impl ImageProperties { pub fn new() -> Self { @@ -562,7 +598,7 @@ pub struct IotHubDeviceConnection { pub device_id: String, #[doc = "Base class for credential objects."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, + pub credentials: Option, } impl IotHubDeviceConnection { pub fn new(device_id: String) -> Self { @@ -612,10 +648,10 @@ pub struct LineCrossingProcessor { #[serde(flatten)] pub processor_node_base: ProcessorNodeBase, #[doc = "An array of lines used to compute line crossing events."] - pub lines: Vec, + pub lines: Vec, } impl LineCrossingProcessor { - pub fn new(processor_node_base: ProcessorNodeBase, lines: Vec) -> Self { + pub fn new(processor_node_base: ProcessorNodeBase, lines: Vec) -> Self { Self { processor_node_base, lines, @@ -945,6 +981,26 @@ pub mod method_request { N1_1, } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "methodName")] +pub enum MethodRequestUnion { + #[serde(rename = "livePipelineList")] + LivePipelineList(LivePipelineListRequest), + #[serde(rename = "livePipelineSet")] + LivePipelineSet(LivePipelineSetRequest), + #[serde(rename = "onvifDeviceDiscover")] + OnvifDeviceDiscover(OnvifDeviceDiscoverRequest), + #[serde(rename = "onvifDeviceGet")] + OnvifDeviceGet(OnvifDeviceGetRequest), + #[serde(rename = "pipelineTopologyList")] + PipelineTopologyList(PipelineTopologyListRequest), + #[serde(rename = "pipelineTopologySet")] + PipelineTopologySet(PipelineTopologySetRequest), + #[serde(rename = "remoteDeviceAdapterList")] + RemoteDeviceAdapterList(RemoteDeviceAdapterListRequest), + #[serde(rename = "remoteDeviceAdapterSet")] + RemoteDeviceAdapterSet(RemoteDeviceAdapterSetRequest), +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MethodRequestEmptyBodyBase { #[serde(flatten)] @@ -1041,6 +1097,12 @@ impl NamedLineBase { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum NamedLineBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.NamedLineString")] + MicrosoftVideoAnalyzerNamedLineString(NamedLineString), +} #[doc = "Describes a line configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NamedLineString { @@ -1068,6 +1130,12 @@ impl NamedPolygonBase { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum NamedPolygonBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.NamedPolygonString")] + MicrosoftVideoAnalyzerNamedPolygonString(NamedPolygonString), +} #[doc = "Describes a closed polygon configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NamedPolygonString { @@ -1218,10 +1286,10 @@ pub struct OnvifDeviceGetRequest { #[serde(flatten)] pub method_request: MethodRequest, #[doc = "Base class for endpoints."] - pub endpoint: EndpointBase, + pub endpoint: EndpointBaseUnion, } impl OnvifDeviceGetRequest { - pub fn new(method_request: MethodRequest, endpoint: EndpointBase) -> Self { + pub fn new(method_request: MethodRequest, endpoint: EndpointBaseUnion) -> Self { Self { method_request, endpoint } } } @@ -1624,21 +1692,21 @@ pub struct PipelineTopologyProperties { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sources: Vec, + pub sources: Vec, #[doc = "List of the topology processor nodes. Processor nodes enable pipeline data to be analyzed, processed or transformed."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub processors: Vec, + pub processors: Vec, #[doc = "List of the topology sink nodes. Sink nodes allow pipeline data to be stored or exported."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub sinks: Vec, + pub sinks: Vec, } impl PipelineTopologyProperties { pub fn new() -> Self { @@ -1694,6 +1762,22 @@ impl ProcessorNodeBase { Self { type_, name, inputs } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum ProcessorNodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.CognitiveServicesVisionProcessor")] + MicrosoftVideoAnalyzerCognitiveServicesVisionProcessor(CognitiveServicesVisionProcessor), + #[serde(rename = "#Microsoft.VideoAnalyzer.ExtensionProcessorBase")] + MicrosoftVideoAnalyzerExtensionProcessorBase(ExtensionProcessorBase), + #[serde(rename = "#Microsoft.VideoAnalyzer.LineCrossingProcessor")] + MicrosoftVideoAnalyzerLineCrossingProcessor(LineCrossingProcessor), + #[serde(rename = "#Microsoft.VideoAnalyzer.MotionDetectionProcessor")] + MicrosoftVideoAnalyzerMotionDetectionProcessor(MotionDetectionProcessor), + #[serde(rename = "#Microsoft.VideoAnalyzer.ObjectTrackingProcessor")] + MicrosoftVideoAnalyzerObjectTrackingProcessor(ObjectTrackingProcessor), + #[serde(rename = "#Microsoft.VideoAnalyzer.SignalGateProcessor")] + MicrosoftVideoAnalyzerSignalGateProcessor(SignalGateProcessor), +} #[doc = "Class representing the video's rate control."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RateControl { @@ -1866,10 +1950,10 @@ pub struct RtspSource { #[serde(default, skip_serializing_if = "Option::is_none")] pub transport: Option, #[doc = "Base class for endpoints."] - pub endpoint: EndpointBase, + pub endpoint: EndpointBaseUnion, } impl RtspSource { - pub fn new(source_node_base: SourceNodeBase, endpoint: EndpointBase) -> Self { + pub fn new(source_node_base: SourceNodeBase, endpoint: EndpointBaseUnion) -> Self { Self { source_node_base, transport: None, @@ -1979,6 +2063,16 @@ impl SinkNodeBase { Self { type_, name, inputs } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum SinkNodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.FileSink")] + MicrosoftVideoAnalyzerFileSink(FileSink), + #[serde(rename = "#Microsoft.VideoAnalyzer.IotHubMessageSink")] + MicrosoftVideoAnalyzerIotHubMessageSink(IotHubMessageSink), + #[serde(rename = "#Microsoft.VideoAnalyzer.VideoSink")] + MicrosoftVideoAnalyzerVideoSink(VideoSink), +} #[doc = "Base class for topology source nodes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SourceNodeBase { @@ -1993,6 +2087,14 @@ impl SourceNodeBase { Self { type_, name } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum SourceNodeBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.IotHubMessageSource")] + MicrosoftVideoAnalyzerIotHubMessageSource(IotHubMessageSource), + #[serde(rename = "#Microsoft.VideoAnalyzer.RtspSource")] + MicrosoftVideoAnalyzerRtspSource(RtspSource), +} #[doc = "Defines a Spatial Analysis custom operation. This requires the Azure Cognitive Services Spatial analysis module to be deployed alongside the Video Analyzer module, please see https://aka.ms/ava-spatial-analysis for more information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisCustomOperation { @@ -2022,6 +2124,12 @@ impl SpatialAnalysisOperationBase { Self { type_ } } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "@type")] +pub enum SpatialAnalysisOperationBaseUnion { + #[serde(rename = "#Microsoft.VideoAnalyzer.SpatialAnalysisCustomOperation")] + MicrosoftVideoAnalyzerSpatialAnalysisCustomOperation(SpatialAnalysisCustomOperation), +} #[doc = "Defines the Azure Cognitive Services Spatial Analysis operation eventing configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SpatialAnalysisOperationEventBase { @@ -2163,7 +2271,7 @@ impl SpatialAnalysisPersonCountOperation { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisPersonCountZoneEvents { #[doc = "Describes the named polygon."] - pub zone: NamedPolygonBase, + pub zone: NamedPolygonBaseUnion, #[doc = "The event configuration."] #[serde( default, @@ -2173,7 +2281,7 @@ pub struct SpatialAnalysisPersonCountZoneEvents { pub events: Vec, } impl SpatialAnalysisPersonCountZoneEvents { - pub fn new(zone: NamedPolygonBase) -> Self { + pub fn new(zone: NamedPolygonBaseUnion) -> Self { Self { zone, events: Vec::new() } } } @@ -2264,7 +2372,7 @@ impl SpatialAnalysisPersonDistanceOperation { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisPersonDistanceZoneEvents { #[doc = "Describes the named polygon."] - pub zone: NamedPolygonBase, + pub zone: NamedPolygonBaseUnion, #[doc = "The event configuration."] #[serde( default, @@ -2274,7 +2382,7 @@ pub struct SpatialAnalysisPersonDistanceZoneEvents { pub events: Vec, } impl SpatialAnalysisPersonDistanceZoneEvents { - pub fn new(zone: NamedPolygonBase) -> Self { + pub fn new(zone: NamedPolygonBaseUnion) -> Self { Self { zone, events: Vec::new() } } } @@ -2292,7 +2400,7 @@ impl SpatialAnalysisPersonLineCrossingEvent { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisPersonLineCrossingLineEvents { #[doc = "Base class for named lines."] - pub line: NamedLineBase, + pub line: NamedLineBaseUnion, #[doc = "The event configuration."] #[serde( default, @@ -2302,7 +2410,7 @@ pub struct SpatialAnalysisPersonLineCrossingLineEvents { pub events: Vec, } impl SpatialAnalysisPersonLineCrossingLineEvents { - pub fn new(line: NamedLineBase) -> Self { + pub fn new(line: NamedLineBaseUnion) -> Self { Self { line, events: Vec::new() } } } @@ -2403,7 +2511,7 @@ impl SpatialAnalysisPersonZoneCrossingOperation { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpatialAnalysisPersonZoneCrossingZoneEvents { #[doc = "Describes the named polygon."] - pub zone: NamedPolygonBase, + pub zone: NamedPolygonBaseUnion, #[doc = "The event configuration."] #[serde( default, @@ -2413,7 +2521,7 @@ pub struct SpatialAnalysisPersonZoneCrossingZoneEvents { pub events: Vec, } impl SpatialAnalysisPersonZoneCrossingZoneEvents { - pub fn new(zone: NamedPolygonBase) -> Self { + pub fn new(zone: NamedPolygonBaseUnion) -> Self { Self { zone, events: Vec::new() } } } @@ -2493,7 +2601,7 @@ pub struct TlsEndpoint { pub endpoint_base: EndpointBase, #[doc = "Base class for certificate sources."] #[serde(rename = "trustedCertificates", default, skip_serializing_if = "Option::is_none")] - pub trusted_certificates: Option, + pub trusted_certificates: Option, #[doc = "Options for controlling the validation of TLS endpoints."] #[serde(rename = "validationOptions", default, skip_serializing_if = "Option::is_none")] pub validation_options: Option,