diff --git a/.gitignore b/.gitignore index a6652518f..624437e03 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ _book/ .vscode/ .idea/ /rust-toolchain.toml +testgen/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fdf2ebf7..fe29b280f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.4] - 2024-10-23 +### Fixed +- Various cli-ng fixes. [PR#547](https://github.com/paperclip-rs/paperclip/pull/547) + ## [0.9.3] - 2024-10-21 ### Added - Experimental openapiv3 cli codegen. [PR#506](https://github.com/paperclip-rs/paperclip/pull/506) @@ -86,7 +90,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Allow automatically adding the module path to the openapi component name, via a feature "path-in-definition" [PR#373](https://github.com/paperclip-rs/paperclip/pull/373) - Add missing ip, ipv4 and ipv6 string format types - Add support for actix-web 4 - - Middleware support does not support non-`BoxBody` response payload types. + - Middleware support does not support non-`BoxBody` response payload types. As a workaround you can use `actix-web::middlware::Compat`. - Add support for Schemas wrapping Generic types (e.g. `DataResponse` where `T` also derives `Apiv2Schema`) [PR#332](https://github.com/paperclip-rs/paperclip/pull/332) diff --git a/Cargo.toml b/Cargo.toml index 84367f588..27d65f1f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "paperclip" -version = "0.9.3" +version = "0.9.4" edition = "2018" description = "OpenAPI tooling library for type-safe compile-time checked HTTP APIs" documentation = "https://paperclip-rs.github.io/paperclip/paperclip" diff --git a/cli-ng/Cargo.toml b/cli-ng/Cargo.toml index a8fdb5204..c42555574 100644 --- a/cli-ng/Cargo.toml +++ b/cli-ng/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "paperclip-ng" -version = "0.1.0" +version = "0.1.1" edition = "2018" license = "MIT OR Apache-2.0" keywords = [ "openapi", "openapiv3", "cli", "codegen" ] diff --git a/cli-ng/src/v3/mod.rs b/cli-ng/src/v3/mod.rs index 99cd0cdeb..dad38c87d 100644 --- a/cli-ng/src/v3/mod.rs +++ b/cli-ng/src/v3/mod.rs @@ -77,6 +77,9 @@ struct SupportingTpl<'a> { package_version: &'a str, package_libname: &'a str, package_edition: &'a str, + // todo: should be configurable. + api_doc_path: &'a str, + model_doc_path: &'a str, } #[derive(Clone, Content)] #[ramhorns(rename_all = "camelCase")] @@ -98,12 +101,14 @@ struct OperationsTpl<'a> { pub(super) struct OperationsApiTpl<'a> { classname: &'a str, class_filename: &'a str, + has_auth_methods: bool, operations: OperationsTpl<'a>, } pub(super) struct OperationsApi { classname: String, class_filename: String, + has_auth_methods: bool, operations: Vec, } @@ -119,6 +124,7 @@ impl OpenApiV3 { .map(|o| OperationsApiTpl { classname: o.classname(), class_filename: o.class_filename(), + has_auth_methods: o.has_auth_methods, operations: OperationsTpl { operation: &o.operations, }, @@ -244,6 +250,8 @@ impl OpenApiV3 { package_version: self.package_info.version.as_str(), package_libname: self.package_info.libname.as_str(), package_edition: self.package_info.edition.as_str(), + api_doc_path: "docs/apis/", + model_doc_path: "docs/models/", }, )?; @@ -322,10 +330,17 @@ impl OpenApiV3 { .api .operations() .map(|(path, method, operation)| Operation::new(self, path, method, operation)) + .sorted_by(Self::sort_op_id) .collect::>(); Ok(operation) } + fn sort_op_id(a: &Operation, b: &Operation) -> std::cmp::Ordering { + a.operation_id_original + .clone() + .unwrap_or_default() + .cmp(&b.operation_id_original.clone().unwrap()) + } fn apis(&self, operations: &Vec) -> Result, std::io::Error> { let mut tags = std::collections::HashMap::::new(); for op in operations { @@ -485,6 +500,7 @@ impl From<&Operation> for OperationsApi { class_filename: src.class_filename().into(), classname: src.classname().into(), operations: vec![src.clone()], + has_auth_methods: src.has_auth_methods, } } } diff --git a/cli-ng/src/v3/operation.rs b/cli-ng/src/v3/operation.rs index 26e26db11..c7bcb07db 100644 --- a/cli-ng/src/v3/operation.rs +++ b/cli-ng/src/v3/operation.rs @@ -3,6 +3,7 @@ use std::collections::HashMap; use super::{OpenApiV3, Parameter, Property}; use heck::{ToLowerCamelCase, ToSnakeCase, ToUpperCamelCase}; +use itertools::Itertools; use ramhorns_derive::Content; use log::debug; @@ -38,7 +39,7 @@ pub(crate) struct Operation { path: String, operation_id: Option, - return_type: String, + return_type: Option, return_format: String, http_method: String, return_base_type: String, @@ -54,8 +55,6 @@ pub(crate) struct Operation { has_produces: bool, prioritized_content_types: Vec>, - body_param: Parameter, - all_params: Vec, has_params: bool, path_params: Vec, @@ -64,6 +63,8 @@ pub(crate) struct Operation { has_query_params: bool, header_params: Vec, has_header_params: bool, + has_body_param: bool, + body_param: Option, implicit_headers_params: Vec, has_implicit_headers_params: bool, form_params: Vec, @@ -72,8 +73,8 @@ pub(crate) struct Operation { has_required_params: bool, optional_params: Vec, has_optional_params: bool, - auth_methods: Vec, - has_auth_methods: bool, + auth_methods: Vec, + pub(crate) has_auth_methods: bool, tags: Vec, responses: Vec<()>, @@ -84,9 +85,15 @@ pub(crate) struct Operation { vendor_extensions: HashMap, - operation_id_original: Option, + pub(crate) operation_id_original: Option, operation_id_camel_case: Option, + operation_id_lower_case: Option, support_multiple_responses: bool, + + description: Option, + + api_doc_path: &'static str, + model_doc_path: &'static str, } fn query_param(api: &OpenApiV3, value: &openapiv3::Parameter) -> Option { @@ -117,6 +124,9 @@ fn header_param(api: &OpenApiV3, value: &openapiv3::Parameter) -> Option None, } } +fn body_param(api: &OpenApiV3, value: &openapiv3::RequestBody) -> Option { + Parameter::from_body(api, value) +} impl Operation { /// Create an Operation based on the deserialized openapi operation. @@ -161,22 +171,33 @@ impl Operation { openapiv3::ReferenceOr::Item(item) => path_param(root, item), } }) + .sorted_by(|a, b| b.required().cmp(&a.required())) .collect::>(); + let body_param = operation.request_body.as_ref().and_then(|p| { + match p { + // todo: need to handle this + openapiv3::ReferenceOr::Reference { .. } => todo!(), + openapiv3::ReferenceOr::Item(item) => body_param(root, item), + } + }); let mut ext_path = path.to_string(); for param in &path_params { if param.data_format() == "url" { - //info!("path: {path}"); - //info!("path_params: {param:?}"); ext_path = path.replace(param.name(), &format!("{}:.*", param.base_name())); vendor_extensions.insert("x-actix-query-string".into(), "true".into()); } } vendor_extensions.insert("x-actixPath".into(), ext_path); - let all_params = query_params + let all_params = path_params .iter() - .chain(&path_params) + .chain( + query_params + .iter() + .sorted_by(|a, b| b.required().cmp(&a.required())), + ) + .chain(&body_param) .cloned() .collect::>(); // todo: support multiple responses @@ -200,11 +221,13 @@ impl Operation { None => (String::new(), String::new()), }; Self { + description: operation.description.as_ref().map(|d| d.replace('\n', " ")), classname: class, class_filename: class_file, summary: operation.summary.clone(), tags: operation.tags.clone(), is_deprecated: Some(operation.deprecated), + operation_id_lower_case: operation.operation_id.as_ref().map(|o| o.to_lowercase()), operation_id_camel_case: operation .operation_id .as_ref() @@ -219,12 +242,45 @@ impl Operation { query_params, header_params: vec![], has_header_params: false, + has_body_param: body_param.is_some(), + body_param, path: path.to_string(), http_method: method.to_upper_camel_case(), support_multiple_responses: false, - return_type: return_model.data_type(), + return_type: { + let data_type = return_model.data_type(); + if data_type == "()" { + None + } else { + Some(data_type) + } + }, has_auth_methods: operation.security.is_some(), + auth_methods: match &operation.security { + None => vec![], + Some(sec) => sec + .iter() + .flat_map(|a| { + a.iter() + .map(|(key, _)| match key.as_str() { + "JWT" => AuthMethod { + scheme: "JWT".to_string(), + is_basic: true, + is_basic_bearer: true, + }, + scheme => AuthMethod { + scheme: scheme.to_string(), + is_basic: false, + is_basic_bearer: false, + }, + }) + .collect::>() + }) + .collect::>(), + }, vendor_extensions, + api_doc_path: "docs/apis/", + model_doc_path: "docs/models/", ..Default::default() } } @@ -241,3 +297,12 @@ impl Operation { &self.class_filename } } + +#[derive(Default, Content, Clone, Debug)] +#[ramhorns(rename_all = "camelCase")] +struct AuthMethod { + scheme: String, + + is_basic: bool, + is_basic_bearer: bool, +} diff --git a/cli-ng/src/v3/parameter.rs b/cli-ng/src/v3/parameter.rs index a7a80651e..f8bbf71a5 100644 --- a/cli-ng/src/v3/parameter.rs +++ b/cli-ng/src/v3/parameter.rs @@ -10,6 +10,7 @@ pub(crate) struct Parameter { param_name: String, base_name: String, example: Option, + description: Option, examples: Vec, required: bool, deprecated: Option, @@ -17,6 +18,7 @@ pub(crate) struct Parameter { is_string: bool, is_array: bool, is_uuid: bool, + is_uri: bool, is_primitive_type: bool, is_container: bool, data_type: String, @@ -26,16 +28,87 @@ pub(crate) struct Parameter { } impl Parameter { + /// Create a new Parameter from a request body. + pub(super) fn from_body(api: &OpenApiV3, body: &openapiv3::RequestBody) -> Option { + let (_, media) = body.content.first()?; + + let schema_back; + let mut body_type = None; + let schema = match media.schema.as_ref()? { + openapiv3::ReferenceOr::Reference { reference } => { + let schema_ref = reference.replace("#/components/schemas/", ""); + let schema = api + .api + .components + .as_ref() + .and_then(|c| c.schemas.get(&schema_ref)); + body_type = Some(schema_ref); + match schema { + None => { + api.missing_schema_ref(reference); + schema_back = openapiv3::Schema { + schema_data: Default::default(), + schema_kind: openapiv3::SchemaKind::Any(openapiv3::AnySchema::default()), + }; + &schema_back + } + Some(ref_or) => match ref_or { + openapiv3::ReferenceOr::Reference { .. } => { + panic!("double reference not supported"); + } + openapiv3::ReferenceOr::Item(schema) => schema, + }, + } + } + openapiv3::ReferenceOr::Item(schema) => schema, + }; + let property = Property::from_schema(api, None, schema, None, body_type.as_deref()); + if property.is_any_type() { + body_type = Some("body".to_string()); + } + let body_type = body_type.as_deref().unwrap_or("unknown"); + let property = super::OpenApiV3::post_process(property); + Some(Self { + // todo: should have snake case param + param_name: body_type.to_snake_case(), + base_name: body_type.to_snake_case(), + example: media.example.as_ref().map(|v| v.to_string()), + examples: vec![], + description: body.description.as_ref().map(|s| s.replace('\n', " ")), + required: body.required, + deprecated: None, + is_nullable: schema.schema_data.nullable, + is_string: property.is_string(), + is_array: property.is_array(), + is_uuid: property.is_uuid(), + is_uri: property.is_uri(), + is_primitive_type: property.is_primitive_type(), + is_container: property.is_container(), + items: property.items().clone(), + data_type: property.data_type(), + data_format: property.data_format(), + vendor_extensions: body + .extensions + .iter() + .map(|(k, v)| (k.clone(), v.to_string())) + .collect(), + }) + } /// Create a new Parameter based on the deserialized parameter data. pub(super) fn new(api: &OpenApiV3, param: &openapiv3::ParameterData) -> Self { let schema_back; + let mut schema_type = None; let schema = match ¶m.format { openapiv3::ParameterSchemaOrContent::Schema(ref_s) => match ref_s { openapiv3::ReferenceOr::Reference { reference } => { - match api.api.components.as_ref().and_then(|c| { - c.schemas - .get(&reference.replace("#/components/schemas/", "")) - }) { + let schema_ref = reference.replace("#/components/schemas/", ""); + let schema = api + .api + .components + .as_ref() + .and_then(|c| c.schemas.get(&schema_ref)); + schema_type = Some(schema_ref); + match schema { None => { api.missing_schema_ref(reference); schema_back = openapiv3::Schema { @@ -60,7 +133,8 @@ impl Parameter { todo!() } }; - let property = Property::from_schema(api, None, schema, Some(¶m.name), None); + let property = + Property::from_schema(api, None, schema, Some(¶m.name), schema_type.as_deref()); let property = super::OpenApiV3::post_process(property); Self { // todo: should have snake case param @@ -68,12 +142,14 @@ impl Parameter { base_name: param.name.clone(), example: param.example.as_ref().map(|v| v.to_string()), examples: vec![], + description: param.description.as_ref().map(|s| s.replace('\n', " ")), required: param.required, deprecated: param.deprecated, is_nullable: schema.schema_data.nullable, is_string: property.is_string(), is_array: property.is_array(), is_uuid: property.is_uuid(), + is_uri: property.is_uri(), is_primitive_type: property.is_primitive_type(), is_container: property.is_container(), items: property.items().clone(), @@ -98,4 +174,8 @@ impl Parameter { pub fn name(&self) -> &str { &self.param_name } + /// Is the parameter required or optional. + pub fn required(&self) -> bool { + self.required + } } diff --git a/cli-ng/src/v3/property.rs b/cli-ng/src/v3/property.rs index 57a140a02..cff3f901f 100644 --- a/cli-ng/src/v3/property.rs +++ b/cli-ng/src/v3/property.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, fmt::Display, ops::Deref, rc::Rc}; +use std::{collections::HashMap, convert::TryInto, fmt::Display, ops::Deref, rc::Rc}; use heck::{ToSnakeCase, ToUpperCamelCase}; use ramhorns_derive::Content; @@ -92,7 +92,7 @@ impl PropertyDataType { self.set_if_unresolved(Self::Enum(name.to_string(), data_type.to_string())); } fn set_any(&mut self) { - self.set_if_unresolved(Self::Any); + *self = Self::Any; } fn set_if_unresolved(&mut self, to: Self) { if !matches!(self, Self::Resolved(_, _)) { @@ -169,7 +169,6 @@ pub(crate) struct Property { data_format: String, /// The type_ coming from component schema. type_: String, - unescaped_description: String, /// Booleans for is_$-like type checking. is_string: bool, @@ -190,6 +189,7 @@ pub(crate) struct Property { is_primitive_type: bool, is_boolean: bool, is_uuid: bool, + is_uri: bool, is_any_type: bool, is_enum: bool, is_array: bool, @@ -290,10 +290,7 @@ impl Property { self.is_nullable = data.nullable; self.is_deprecated = data.deprecated; self.title = data.title.clone(); - self.description = data - .description - .as_ref() - .map(|s| s.escape_default().to_string().replace("\\n", " ")); + self.description = data.description.as_ref().map(|s| s.replace('\n', " ")); self.example = data.example.as_ref().map(ToString::to_string); self } @@ -347,6 +344,8 @@ impl Property { fn with_data_type_any(mut self, is_add_props: bool) -> Self { self.data_type.set_any(); self.is_any_type = true; + self.is_model = false; + self.is_container = true; self.additional_properties_is_any_type = is_add_props; self } @@ -403,7 +402,12 @@ impl Property { ) -> Self { let name = name.unwrap_or_default(); let type_ = type_.unwrap_or_default(); - trace!("PropertyFromSchema: {}/{}", name, type_); + trace!( + "PropertyFromSchema: {}/{}/{}", + name, + type_, + Self::schema_kind_str(schema) + ); let prop = Property::from(&schema.schema_data) .with_name(name) .with_parent(&parent) @@ -413,6 +417,17 @@ impl Property { prop.with_kind(root, schema, &schema.schema_kind, parent, name, type_) } + fn schema_kind_str(schema: &openapiv3::Schema) -> &str { + match &schema.schema_kind { + openapiv3::SchemaKind::Type(_) => "type", + openapiv3::SchemaKind::OneOf { .. } => "oneOf", + openapiv3::SchemaKind::AllOf { .. } => "allOf", + openapiv3::SchemaKind::AnyOf { .. } => "anyOf", + openapiv3::SchemaKind::Not { .. } => "not", + openapiv3::SchemaKind::Any(..) => "any", + } + } + fn with_kind( mut self, root: &super::OpenApiV3, @@ -523,6 +538,7 @@ impl Property { } openapiv3::VariantOrUnknownOrEmpty::Unknown(format) => match format.as_str() { "uuid" => data_type.resolve("uuid::Uuid"), + "uri" => data_type.resolve("url::Url"), _ => data_type.resolve_format("String", format), }, openapiv3::VariantOrUnknownOrEmpty::Empty => { @@ -540,7 +556,7 @@ impl Property { } PropertyDataType::Boolean => data_type.resolve("bool"), PropertyDataType::Integer(type_) => { - let (signed, bits, format) = match type_.format { + let (signed, mut bits, format) = match type_.format { openapiv3::VariantOrUnknownOrEmpty::Item(item) => match item { openapiv3::IntegerFormat::Int32 => (true, 32, Some("int32".into())), openapiv3::IntegerFormat::Int64 => (true, 64, Some("int64".into())), @@ -557,6 +573,12 @@ impl Property { _ => (true, 0, None), }; let signed = type_.minimum.map(|m| m < 0).unwrap_or(signed); + if let Some(max) = type_.maximum { + let r_bits = floor_log2(max.try_into().unwrap()); + if bits == 0 || bits > r_bits { + bits = r_bits; + } + } // no format specified let bits = if bits == 0 { @@ -730,10 +752,18 @@ impl Property { pub fn is_uuid(&self) -> bool { self.is_uuid } + /// Check if the property is a string uri. + pub fn is_uri(&self) -> bool { + self.is_uri + } /// Check if the property is a container. pub fn is_container(&self) -> bool { self.is_container } + /// Check if the property is of any type. + pub fn is_any_type(&self) -> bool { + self.is_any_type + } /// Check if the property is a primitive type. pub fn is_primitive_type(&self) -> bool { self.is_primitive_type @@ -768,8 +798,6 @@ impl Property { self.min_properties = by.min_properties; self.max_properties = by.max_properties; - self.is_model = true; - let vars = by .properties .iter() @@ -813,6 +841,7 @@ impl Property { .filter(|o| o.required.len() == 1) .for_each(|o| vars_.retain(|v| v.name != o.required[0])); + self.is_model = true; self.one_of = vec![self.clone()]; self } @@ -940,6 +969,7 @@ impl Property { }, openapiv3::VariantOrUnknownOrEmpty::Unknown(format) => match format.as_str() { "uuid" => self.is_uuid = true, + "uri" => self.is_string = true, "date" => self.is_date = true, "date-time" => self.is_date_time = true, _ => { @@ -963,6 +993,7 @@ impl Property { .collect::>(); self.is_model = true; + self.is_string = false; self.allowable_values.insert("enumVars".into(), enum_vars); self.data_type.set_enum(&self.name, &self.type_); } else { @@ -979,3 +1010,7 @@ pub(crate) struct EnumValue { name: String, value: String, } + +fn floor_log2(x: u64) -> u64 { + 65 - (x.leading_zeros() as u64) +} diff --git a/cli-ng/src/v3/templates/default/Cargo.mustache b/cli-ng/src/v3/templates/default/Cargo.mustache index 32f59ccad..a6a84879d 100644 --- a/cli-ng/src/v3/templates/default/Cargo.mustache +++ b/cli-ng/src/v3/templates/default/Cargo.mustache @@ -58,4 +58,4 @@ tracing-opentelemetry = { version = "0.23.0", optional = true } opentelemetry = { version = "0.22.0", optional = true } opentelemetry-http = { version = "0.11.1", optional = true } tracing = { version = "0.1.37", optional = true } -tracing-subscriber = { version = "0.3.18", optional = true } \ No newline at end of file +tracing-subscriber = { version = "0.3.18", optional = true } diff --git a/cli-ng/src/v3/templates/default/README.md b/cli-ng/src/v3/templates/default/README.mustache similarity index 100% rename from cli-ng/src/v3/templates/default/README.md rename to cli-ng/src/v3/templates/default/README.mustache diff --git a/cli-ng/src/v3/templates/default/actix/client/api_clients.mustache b/cli-ng/src/v3/templates/default/actix/client/api_clients.mustache index f386bdbe3..d804f2579 100644 --- a/cli-ng/src/v3/templates/default/actix/client/api_clients.mustache +++ b/cli-ng/src/v3/templates/default/actix/client/api_clients.mustache @@ -25,10 +25,10 @@ pub trait {{{classname}}}: Clone { {{#operations}} {{#operation}} {{#description}} - /// {{{.}}} + /// {{{description}}} {{/description}} {{#notes}} - /// {{{.}}} + /// {{{notes}}} {{/notes}} async fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}{{/supportMultipleResponses}}, Error>; {{/operation}} @@ -166,7 +166,7 @@ impl {{{classname}}} for {{{classname}}}Client { {{/hasBodyParam}} let local_var_status = local_var_resp.status(); - + if local_var_status.is_success() { {{^supportMultipleResponses}} {{^returnType}} diff --git a/cli-ng/src/v3/templates/default/actix/server/api.mustache b/cli-ng/src/v3/templates/default/actix/server/api.mustache index 714c23f45..ceac383d3 100644 --- a/cli-ng/src/v3/templates/default/actix/server/api.mustache +++ b/cli-ng/src/v3/templates/default/actix/server/api.mustache @@ -8,12 +8,12 @@ pub trait {{{classname}}} { {{#operations}} {{#operation}} {{#description}} - /// {{{.}}} + /// {{{description}}} {{/description}} {{#notes}} - /// {{{.}}} + /// {{{nodes}}} {{/notes}} - async fn {{{operationId}}}({{#vendorExtensions.x-actix-query-string}}query: &str{{#hasParams}}, {{/hasParams}}{{/vendorExtensions.x-actix-query-string}}{{#hasPathParams}}Path({{#pathParams.1}}({{/pathParams.1}}{{#pathParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/pathParams}}{{#pathParams.1}}){{/pathParams.1}}): Path<{{#pathParams.1}}({{/pathParams.1}}{{#pathParams}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/pathParams}}{{#pathParams.1}}){{/pathParams.1}}>{{/hasPathParams}}{{#hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}Query({{#queryParams.1}}({{/queryParams.1}}{{#queryParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/queryParams}}{{#queryParams.1}}){{/queryParams.1}}): Query<{{#queryParams.1}}({{/queryParams.1}}{{#queryParams}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{{dataType}}}{{/isString}}{{#isUuid}}uuid::Uuid{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/queryParams}}{{#queryParams.1}}){{/queryParams.1}}>{{/hasQueryParams}}{{#hasBodyParam}}{{#hasQueryParams}}, {{/hasQueryParams}}{{^hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}{{/hasQueryParams}}{{#bodyParam}}Body({{{paramName}}}): Body<{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}>{{/bodyParam}}{{/hasBodyParam}}) -> Result<{{#returnType}}{{/returnType}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}{{/supportMultipleResponses}}, RestError>; + async fn {{{operationId}}}({{#vendorExtensions}}{{#x-actix-query-string}}query: &str{{#hasParams}}, {{/hasParams}}{{/x-actix-query-string}}{{/vendorExtensions}}{{#hasPathParams}}Path({{#pathParams}}{{#-1}}({{/-1}}{{/pathParams}}{{#pathParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/pathParams}}{{#pathParams}}{{#-1}}){{/-1}}{{/pathParams}}): Path<{{#pathParams}}{{#-1}}({{/-1}}{{/pathParams}}{{#pathParams}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/pathParams}}{{#pathParams}}{{#-1}}){{/-1}}{{/pathParams}}>{{/hasPathParams}}{{#hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}Query({{#queryParams}}{{#-1}}({{/-1}}{{/queryParams}}{{#queryParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/queryParams}}{{#queryParams}}{{#-1}}){{/-1}}{{/queryParams}}): Query<{{#queryParams}}{{#-1}}({{/-1}}{{/queryParams}}{{#queryParams}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{{dataType}}}{{/isString}}{{#isUuid}}uuid::Uuid{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/queryParams}}{{#queryParams}}{{#-1}}){{/-1}}{{/queryParams}}>{{/hasQueryParams}}{{#hasBodyParam}}{{#hasQueryParams}}, {{/hasQueryParams}}{{^hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}{{/hasQueryParams}}{{#bodyParam}}Body({{{paramName}}}): Body<{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}>{{/bodyParam}}{{/hasBodyParam}}) -> Result<{{#returnType}}{{/returnType}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}{{/supportMultipleResponses}}, RestError>; {{/operation}} {{/operations}} } diff --git a/cli-ng/src/v3/templates/default/actix/server/handlers.mustache b/cli-ng/src/v3/templates/default/actix/server/handlers.mustache index 03b44b79d..d1d4ada85 100644 --- a/cli-ng/src/v3/templates/default/actix/server/handlers.mustache +++ b/cli-ng/src/v3/templates/default/actix/server/handlers.mustache @@ -19,7 +19,7 @@ pub fn configure)) @@ -46,14 +46,14 @@ struct {{{operationId}}}QueryParams { {{#operations}} {{#operation}} {{#description}} -/// {{{.}}} +/// {{{description}}} {{/description}} {{#notes}} -/// {{{.}}} +/// {{{notes}}} {{/notes}} -async fn {{{operationId}}}({{#vendorExtensions.x-actix-query-string}}request: HttpRequest{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#hasAuthMethods}}, {{/hasAuthMethods}}{{/hasParams}}{{/vendorExtensions.x-actix-query-string}}{{#hasAuthMethods}}_token: A{{#hasParams}}, {{/hasParams}}{{/hasAuthMethods}}{{#hasPathParams}}path: Path<{{#pathParams.1}}({{/pathParams.1}}{{#pathParams}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/pathParams}}{{#pathParams.1}}){{/pathParams.1}}>{{/hasPathParams}}{{#hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}query: Query<{{{operationId}}}QueryParams>{{/hasQueryParams}}{{#hasBodyParam}}{{#hasQueryParams}}, {{/hasQueryParams}}{{^hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}{{/hasQueryParams}}{{#bodyParam}}Json({{{paramName}}}): Json<{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{{dataType}}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}>{{/bodyParam}}{{/hasBodyParam}}) -> Result<{{#supportMultipleResponses}}Json>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}NoContent{{/returnType}}{{#returnType}}Json<{{{returnType}}}>{{/returnType}}{{/supportMultipleResponses}}, RestError> { +async fn {{{operationId}}}({{#vendorExtensions}}{{#x-actix-query-string}}request: HttpRequest{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#hasAuthMethods}}, {{/hasAuthMethods}}{{/hasParams}}{{/x-actix-query-string}}{{/vendorExtensions}}{{#hasAuthMethods}}_token: A{{#hasParams}}, {{/hasParams}}{{/hasAuthMethods}}{{#hasPathParams}}path: Path<{{#pathParams}}{{#-1}}({{/-1}}{{/pathParams}}{{#pathParams}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/pathParams}}{{#pathParams}}{{#-1}}){{/-1}}{{/pathParams}}>{{/hasPathParams}}{{#hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}query: Query<{{{operationId}}}QueryParams>{{/hasQueryParams}}{{#hasBodyParam}}{{#hasQueryParams}}, {{/hasQueryParams}}{{^hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}{{/hasQueryParams}}{{#bodyParam}}Json({{{paramName}}}): Json<{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{{dataType}}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}>{{/bodyParam}}{{/hasBodyParam}}) -> Result<{{#supportMultipleResponses}}Json>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}NoContent{{/returnType}}{{#returnType}}Json<{{{returnType}}}>{{/returnType}}{{/supportMultipleResponses}}, RestError> { {{#hasQueryParams}}let query = query.into_inner(); - {{/hasQueryParams}}T::{{{operationId}}}({{#vendorExtensions.x-actix-query-string}}request.query_string(){{#hasParams}}, {{/hasParams}}{{/vendorExtensions.x-actix-query-string}}{{#hasPathParams}}crate::apis::actix_server::Path(path.into_inner()){{/hasPathParams}}{{#hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}crate::apis::actix_server::Query({{#queryParams.1}}({{/queryParams.1}}{{#queryParams}}query.{{{paramName}}}{{^-last}}, {{/-last}}{{/queryParams}}{{#queryParams.1}}){{/queryParams.1}}){{/hasQueryParams}}{{#hasBodyParam}}{{#hasQueryParams}}, {{/hasQueryParams}}{{^hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}{{/hasQueryParams}}{{#bodyParam}}Body({{{paramName}}}){{/bodyParam}}{{/hasBodyParam}}).await.map(Json){{^supportMultipleResponses}}{{^returnType}}.map(Into::into){{/returnType}}{{/supportMultipleResponses}} + {{/hasQueryParams}}T::{{{operationId}}}({{#vendorExtensions}}{{#x-actix-query-string}}request.query_string(){{#hasParams}}, {{/hasParams}}{{/x-actix-query-string}}{{/vendorExtensions}}{{#hasPathParams}}crate::apis::actix_server::Path(path.into_inner()){{/hasPathParams}}{{#hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}crate::apis::actix_server::Query({{#queryParams}}{{#-1}}({{/-1}}{{/queryParams}}{{#queryParams}}query.{{{paramName}}}{{^-last}}, {{/-last}}{{/queryParams}}{{#queryParams}}{{#-1}}){{/-1}}{{/queryParams}}){{/hasQueryParams}}{{#hasBodyParam}}{{#hasQueryParams}}, {{/hasQueryParams}}{{^hasQueryParams}}{{#hasPathParams}}, {{/hasPathParams}}{{/hasQueryParams}}{{#bodyParam}}Body({{{paramName}}}){{/bodyParam}}{{/hasBodyParam}}).await.map(Json){{^supportMultipleResponses}}{{^returnType}}.map(Into::into){{/returnType}}{{/supportMultipleResponses}} } {{/operation}} diff --git a/cli-ng/src/v3/templates/default/api_doc.mustache b/cli-ng/src/v3/templates/default/api_doc.mustache index 250db3fc5..b45e0274b 100644 --- a/cli-ng/src/v3/templates/default/api_doc.mustache +++ b/cli-ng/src/v3/templates/default/api_doc.mustache @@ -34,14 +34,14 @@ Name | Type | Description | Required | Notes ### Authorization -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} ### HTTP request headers - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) {{/operation}} {{/operations}} \ No newline at end of file diff --git a/cli-ng/src/v3/templates/default/model_doc.mustache b/cli-ng/src/v3/templates/default/model_doc.mustache index c0cc2980f..b643834e3 100644 --- a/cli-ng/src/v3/templates/default/model_doc.mustache +++ b/cli-ng/src/v3/templates/default/model_doc.mustache @@ -7,6 +7,6 @@ Name | Type | Description | Notes {{#vars}}**{{{name}}}** | {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{complexType}}}.md){{/isPrimitiveType}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}} | {{{description}}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} {{/vars}} -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) {{/model}}{{/models}} \ No newline at end of file diff --git a/cli-ng/src/v3/templates/default/tower-hyper/client/api_clients.mustache b/cli-ng/src/v3/templates/default/tower-hyper/client/api_clients.mustache index 0cd755be9..c754c4732 100644 --- a/cli-ng/src/v3/templates/default/tower-hyper/client/api_clients.mustache +++ b/cli-ng/src/v3/templates/default/tower-hyper/client/api_clients.mustache @@ -33,10 +33,10 @@ pub trait {{{classname}}}: Clone + Send + Sync { {{#operations}} {{#operation}} {{#description}} - /// {{{.}}} + /// {{{description}}} {{/description}} {{#notes}} - /// {{{.}}} + /// {{{notes}}} {{/notes}} async fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}ResponseContent<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}>{{/supportMultipleResponses}}, Error>; {{/operation}} @@ -51,10 +51,10 @@ pub mod direct { {{#operations}} {{#operation}} {{#description}} - /// {{{.}}} + /// {{{description}}} {{/description}} {{#notes}} - /// {{{.}}} + /// {{{notes}}} {{/notes}} async fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}{{/supportMultipleResponses}}, super::Error>; {{/operation}} @@ -233,7 +233,7 @@ impl {{{classname}}} for {{{classname}}}Client { .map_err(RequestError::Request)? }; let local_var_status = local_var_resp.status(); - + if local_var_status.is_success() { {{^supportMultipleResponses}} {{^returnType}} @@ -283,7 +283,7 @@ impl {{{classname}}} for {{{classname}}}Client { error, })), } - + } } {{/operation}} diff --git a/cli-ng/src/v3/templates/mod.rs b/cli-ng/src/v3/templates/mod.rs index f8e02e8d8..c31d977a1 100644 --- a/cli-ng/src/v3/templates/mod.rs +++ b/cli-ng/src/v3/templates/mod.rs @@ -219,39 +219,39 @@ pub(super) fn default_templates( // Actix ApiTemplateFile::new( path_or_builtin!(tpl_path, "default/actix/client/api_clients.mustache"), - "apis", + "src/apis", "actix/client/mod.rs", ), ApiTemplateFile::new( path_or_builtin!(tpl_path, "default/actix/server/handlers.mustache"), - "apis", + "src/apis", "actix/server/handlers.rs", ), ApiTemplateFile::new( path_or_builtin!(tpl_path, "default/actix/mod.mustache"), - "apis", + "src/apis", "actix/mod.rs", ), ApiTemplateFile::new( path_or_builtin!(tpl_path, "default/actix/server/api.mustache"), - "apis", + "src/apis", "actix/server/mod.rs", ), // Tower-hyper ApiTemplateFile::new( path_or_builtin!(tpl_path, "default/tower-hyper/mod.mustache"), - "apis", + "src/apis", "tower/mod.rs", ), ApiTemplateFile::new( path_or_builtin!(tpl_path, "default/tower-hyper/client/api_clients.mustache"), - "apis", + "src/apis", "tower/client/mod.rs", ), // Common ApiTemplateFile::new( path_or_builtin!(tpl_path, "default/mod.mustache"), - "apis", + "src/apis", "mod.rs", ), ApiTemplateFile::new( @@ -265,7 +265,7 @@ pub(super) fn default_templates( let model_templates = vec![ ModelTemplateFile::new( path_or_builtin!(tpl_path, "default/model.mustache"), - "models", + "src/models", ".rs", ), ModelTemplateFile::new( @@ -278,45 +278,55 @@ pub(super) fn default_templates( let supporting_templates = vec![ SuppTemplateFile::new( path_or_builtin!(tpl_path, "default/model_mod.mustache"), - "models", + "src/models", "mod.rs", ), + SuppTemplateFile::new( + path_or_builtin!(tpl_path, "default/actix/client/configuration.mustache"), + "src/clients/actix", + "configuration.rs", + ), SuppTemplateFile::new( path_or_builtin!( tpl_path, "default/tower-hyper/client/configuration.mustache" ), - "clients/tower", + "src/clients/tower", "configuration.rs", ), + SuppTemplateFile::new( + path_or_builtin!(tpl_path, "default/actix/client/client.mustache"), + "src/clients/actix", + "mod.rs", + ), SuppTemplateFile::new( path_or_builtin!(tpl_path, "default/tower-hyper/client/client.mustache"), - "clients/tower", + "src/clients/tower", "mod.rs", ), SuppTemplateFile::new( path_or_builtin!(tpl_path, "default/tower-hyper/client/body.mustache"), - "clients/tower", + "src/clients/tower", "body.rs", ), SuppTemplateFile::new( path_or_builtin!(tpl_path, "default/api_mod.mustache"), - "apis", + "src/apis", "mod.rs", ), SuppTemplateFile::new( path_or_builtin!(tpl_path, "default/mod_clients.mustache"), - "clients", + "src/clients", "mod.rs", ), SuppTemplateFile::new( path_or_builtin!(tpl_path, "default/lib.mustache"), - "", - "mod.rs", + "src/", + "lib.rs", ), SuppTemplateFile::new( path_or_builtin!(tpl_path, "default/actix/server/api_mod.mustache"), - "apis", + "src/apis", "actix_server.rs", ), SuppTemplateFile::new( @@ -331,9 +341,14 @@ pub(super) fn default_templates( ), SuppTemplateFile::new( path_or_builtin!(tpl_path, "default/openapi.mustache"), - "apis", + "src/apis", "openapi.yaml", ), + SuppTemplateFile::new( + path_or_builtin!(tpl_path, "default/README.mustache"), + "", + "README.md", + ), ]; Ok((api_templates, model_templates, supporting_templates)) } diff --git a/testgen/src/autogen/.gitignore b/testgen/src/autogen/.gitignore deleted file mode 100644 index a79a8002d..000000000 --- a/testgen/src/autogen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target/ -**/*.rs.bk \ No newline at end of file diff --git a/testgen/src/autogen/Cargo.toml b/testgen/src/autogen/Cargo.toml deleted file mode 100644 index bd18afcfc..000000000 --- a/testgen/src/autogen/Cargo.toml +++ /dev/null @@ -1,61 +0,0 @@ -[package] -name = "paper" -version = "1.0.0" -edition = "2018" - -[lib] -name = "paper" -path = "src/lib.rs" - -[features] -default = [ "tower-client-rls", "tower-trace" ] -actix-server = [ "actix" ] -actix-client = [ "actix", "actix-web-opentelemetry", "awc" ] -actix = [ "actix-web", "rustls" ] -tower-client-rls = [ "tower-client", "rustls_feat" ] -tower-client-tls = [ "tower-client", "hyper_tls_feat" ] -tower-client = [ "tower-hyper" ] -tower-hyper = [ "hyper", "tower", "tower-http", "http-body", "futures", "pin-project", "tokio" ] -hyper_tls_feat = [ "hyper-tls", "tokio-native-tls" ] -rustls_feat = [ "rustls", "webpki", "hyper-rustls" ] -tower-trace = [ "opentelemetry-jaeger", "tracing-opentelemetry", "opentelemetry", "opentelemetry-http", "tracing", "tracing-subscriber" ] - -[dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_json = "^1.0" -url = { version = "^2.4", features = ["serde"] } -async-trait = "0.1.73" -dyn-clonable = "0.9.0" -uuid = { version = "1.4.1", features = ["serde", "v4"] } -serde_urlencoded = "0.7" - -# actix dependencies -actix-web = { version = "4.4.0", features = ["rustls-0_21"], optional = true } -actix-web-opentelemetry = { version = "0.17.0", optional = true } -awc = { version = "3.2.0", optional = true } - -# tower and hyper dependencies -hyper = { version = "0.14.27", features = [ "client", "http1", "http2", "tcp", "stream" ], optional = true } -tower = { version = "0.4.13", features = [ "timeout", "util", "limit" ], optional = true } -tower-http = { version = "0.4.4", features = [ "trace", "map-response-body", "auth" ], optional = true } -tokio = { version = "1.32.0", features = ["full"], optional = true } -http-body = { version = "0.4.5", optional = true } -futures = { version = "0.3.28", optional = true } -pin-project = { version = "1.1.3", optional = true } - -# SSL -rustls = { version = "0.21.12", optional = true, features = [ "dangerous_configuration" ] } -rustls-pemfile = "1.0.3" -webpki = { version = "0.22.2", optional = true } -hyper-rustls = { version = "0.24.1", optional = true } -hyper-tls = { version = "0.5.0", optional = true } -tokio-native-tls = { version = "0.3.1", optional = true } - -# tracing and telemetry -opentelemetry-jaeger = { version = "0.21.0", features = ["rt-tokio-current-thread"], optional = true } -tracing-opentelemetry = { version = "0.23.0", optional = true } -opentelemetry = { version = "0.22.0", optional = true } -opentelemetry-http = { version = "0.11.1", optional = true } -tracing = { version = "0.1.37", optional = true } -tracing-subscriber = { version = "0.3.18", optional = true } \ No newline at end of file diff --git a/testgen/src/autogen/apis/actix_server.rs b/testgen/src/autogen/apis/actix_server.rs deleted file mode 100644 index a8ff272b1..000000000 --- a/testgen/src/autogen/apis/actix_server.rs +++ /dev/null @@ -1,679 +0,0 @@ -use actix_web::http::StatusCode; -use actix_web::{web::ServiceConfig, FromRequest, HttpResponse, ResponseError}; -use serde::Serialize; -use std::{ - fmt::{self, Debug, Display, Formatter}, - ops, -}; - - - - - - - - - - - - -pub use crate::apis::app_nodes_api::actix::server::AppNodes; - - - - - - - -pub use crate::apis::block_devices_api::actix::server::BlockDevices; - - - - - - - - - - - - - - - - - - - - - -pub use crate::apis::children_api::actix::server::Children; - - - - - - - -pub use crate::apis::json_grpc_api::actix::server::JsonGrpc; - - - - - - - - - - - - - - - - - - - - - - - -pub use crate::apis::nexuses_api::actix::server::Nexuses; - - - - - - - - - - - - - - - - - - - -pub use crate::apis::nodes_api::actix::server::Nodes; - - - - - - - - - - - - - - - - - - - -pub use crate::apis::pools_api::actix::server::Pools; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -pub use crate::apis::replicas_api::actix::server::Replicas; - - - - - - - - - - - - - - - - - - - -pub use crate::apis::snapshots_api::actix::server::Snapshots; - - - - - - - -pub use crate::apis::specs_api::actix::server::Specs; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -pub use crate::apis::volumes_api::actix::server::Volumes; - - - - - - - - - - - -pub use crate::apis::watches_api::actix::server::Watches; - - - - - - -/// Rest Error wrapper with a status code and a JSON error -/// Note: Only a single error type for each handler is supported at the moment -pub struct RestError { - status_code: StatusCode, - error_response: T, -} - -impl RestError { - pub fn new(status_code: StatusCode, error_response: T) -> Self { - Self { - status_code, - error_response - } - } -} - -impl Debug for RestError { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - f.debug_struct("RestError") - .field("status_code", &self.status_code) - .field("error_response", &self.error_response) - .finish() - } -} - -impl Display for RestError { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!(f, "{self:?}") - } -} - -impl ResponseError for RestError { - fn status_code(&self) -> StatusCode { - self.status_code - } - - fn error_response(&self) -> HttpResponse { - HttpResponse::build(self.status_code).json(&self.error_response) - } -} - -/// 204 Response with no content -#[derive(Default)] -pub(crate) struct NoContent; - -impl From> for NoContent { - fn from(_: actix_web::web::Json<()>) -> Self { - NoContent {} - } -} -impl From<()> for NoContent { - fn from(_: ()) -> Self { - NoContent {} - } -} -impl actix_web::Responder for NoContent { - type Body = actix_web::body::BoxBody; - - fn respond_to(self, _: &actix_web::HttpRequest) -> actix_web::HttpResponse { - actix_web::HttpResponse::NoContent().finish() - } -} - -/// Wrapper type used as tag to easily distinguish the 3 different parameter types: -/// 1. Path 2. Query 3. Body -/// Example usage: -/// fn delete_resource(Path((p1, p2)): Path<(String, u64)>) { ... } -pub struct Path(pub T); - -impl Path { - /// Deconstruct to an inner value - pub fn into_inner(self) -> T { - self.0 - } -} - -impl AsRef for Path { - fn as_ref(&self) -> &T { - &self.0 - } -} - -impl ops::Deref for Path { - type Target = T; - - fn deref(&self) -> &T { - &self.0 - } -} - -impl ops::DerefMut for Path { - fn deref_mut(&mut self) -> &mut T { - &mut self.0 - } -} - -/// Wrapper type used as tag to easily distinguish the 3 different parameter types: -/// 1. Path 2. Query 3. Body -/// Example usage: -/// fn delete_resource(Path((p1, p2)): Path<(String, u64)>) { ... } -pub struct Query(pub T); - -impl Query { - /// Deconstruct to an inner value - pub fn into_inner(self) -> T { - self.0 - } -} - -impl AsRef for Query { - fn as_ref(&self) -> &T { - &self.0 - } -} - -impl ops::Deref for Query { - type Target = T; - - fn deref(&self) -> &T { - &self.0 - } -} - -impl ops::DerefMut for Query { - fn deref_mut(&mut self) -> &mut T { - &mut self.0 - } -} - -/// Wrapper type used as tag to easily distinguish the 3 different parameter types: -/// 1. Path 2. Query 3. Body -/// Example usage: -/// fn delete_resource(Path((p1, p2)): Path<(String, u64)>) { ... } -pub struct Body(pub T); - -impl Body { - /// Deconstruct to an inner value - pub fn into_inner(self) -> T { - self.0 - } -} - -impl AsRef for Body { - fn as_ref(&self) -> &T { - &self.0 - } -} - -impl ops::Deref for Body { - type Target = T; - - fn deref(&self) -> &T { - &self.0 - } -} - -impl ops::DerefMut for Body { - fn deref_mut(&mut self) -> &mut T { - &mut self.0 - } -} - -/// Configure all actix server handlers -pub fn configure(cfg: &mut ServiceConfig) { - - - - - - - - - - - - crate::apis::app_nodes_api::actix::server::handlers::configure::(cfg); - - - - - - - - crate::apis::block_devices_api::actix::server::handlers::configure::(cfg); - - - - - - - - - - - - - - - - - - - - - - crate::apis::children_api::actix::server::handlers::configure::(cfg); - - - - - - - - crate::apis::json_grpc_api::actix::server::handlers::configure::(cfg); - - - - - - - - - - - - - - - - - - - - - - - - crate::apis::nexuses_api::actix::server::handlers::configure::(cfg); - - - - - - - - - - - - - - - - - - - - crate::apis::nodes_api::actix::server::handlers::configure::(cfg); - - - - - - - - - - - - - - - - - - - - crate::apis::pools_api::actix::server::handlers::configure::(cfg); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - crate::apis::replicas_api::actix::server::handlers::configure::(cfg); - - - - - - - - - - - - - - - - - - - - crate::apis::snapshots_api::actix::server::handlers::configure::(cfg); - - - - - - - - crate::apis::specs_api::actix::server::handlers::configure::(cfg); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - crate::apis::volumes_api::actix::server::handlers::configure::(cfg); - - - - - - - - - - - - crate::apis::watches_api::actix::server::handlers::configure::(cfg); - - - - - -} - -/// Used with Query to deserialize into Vec. -#[allow(dead_code)] -pub(crate) fn deserialize_stringified_list<'de, D, I>( - deserializer: D, -) -> std::result::Result, D::Error> -where - D: serde::de::Deserializer<'de>, - I: serde::de::DeserializeOwned, -{ - struct StringVecVisitor(std::marker::PhantomData); - - impl<'de, I> serde::de::Visitor<'de> for StringVecVisitor - where - I: serde::de::DeserializeOwned, - { - type Value = Vec; - - fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { - formatter.write_str("a string containing a list") - } - - fn visit_str(self, v: &str) -> std::result::Result - where - E: serde::de::Error, - { - let mut list = Vec::new(); - if !v.is_empty() { - for item in v.split(',') { - let item = I::deserialize(serde::de::IntoDeserializer::into_deserializer(item))?; - list.push(item); - } - } - Ok(list) - } - } - - deserializer.deserialize_any(StringVecVisitor(std::marker::PhantomData::)) -} - -/// Used with Query to deserialize into Option>. -#[allow(dead_code)] -pub(crate) fn deserialize_option_stringified_list<'de, D, I>( - deserializer: D, -) -> std::result::Result>, D::Error> -where - D: serde::de::Deserializer<'de>, - I: serde::de::DeserializeOwned, -{ - let list = deserialize_stringified_list(deserializer)?; - match list.is_empty() { - true => Ok(None), - false => Ok(Some(list)), - } -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/app_nodes_api/actix/client/mod.rs b/testgen/src/autogen/apis/app_nodes_api/actix/client/mod.rs deleted file mode 100644 index 6f96b0fe6..000000000 --- a/testgen/src/autogen/apis/app_nodes_api/actix/client/mod.rs +++ /dev/null @@ -1,295 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct AppNodesClient { - configuration: Rc, -} - -impl AppNodesClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait AppNodes: Clone { - - - - - async fn get_app_nodes(&self, max_entries: isize, starting_token: Option) -> Result>; - - - - async fn get_app_node(&self, app_node_id: &str) -> Result>; - - - - async fn register_app_node(&self, app_node_id: &str) -> Result<(), Error>; - - - - async fn deregister_app_node(&self, app_node_id: &str) -> Result<(), Error>; - - -} - -#[async_trait::async_trait(?Send)] -impl AppNodes for AppNodesClient { - - - - - async fn get_app_nodes(&self, max_entries: isize, starting_token: Option) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/app-nodes", configuration.base_path); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - query_params.push(("max_entries", max_entries.to_string())); - - - - - - if let Some(ref local_var_str) = starting_token { - query_params.push(("starting_token", local_var_str.to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_app_node(&self, app_node_id: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/app-nodes/{app_node_id}", configuration.base_path, app_node_id=crate::apis::urlencode(app_node_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn register_app_node(&self, app_node_id: &str) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/app-nodes/{app_node_id}", configuration.base_path, app_node_id=crate::apis::urlencode(app_node_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn deregister_app_node(&self, app_node_id: &str) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/app-nodes/{app_node_id}", configuration.base_path, app_node_id=crate::apis::urlencode(app_node_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/app_nodes_api/actix/mod.rs b/testgen/src/autogen/apis/app_nodes_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/app_nodes_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/app_nodes_api/actix/server/handlers.rs b/testgen/src/autogen/apis/app_nodes_api/actix/server/handlers.rs deleted file mode 100644 index ff07c51e9..000000000 --- a/testgen/src/autogen/apis/app_nodes_api/actix/server/handlers.rs +++ /dev/null @@ -1,107 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - app_nodes_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the AppNodes resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/app-nodes") - .name("get_app_nodes") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_app_nodes::)) - ) - - .service( - actix_web::web::resource("/app-nodes/{app_node_id}") - .name("get_app_node") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_app_node::)) - ) - - .service( - actix_web::web::resource("/app-nodes/{app_node_id}") - .name("register_app_node") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(register_app_node::)) - ) - - .service( - actix_web::web::resource("/app-nodes/{app_node_id}") - .name("deregister_app_node") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(deregister_app_node::)) - ); - - -} - - - - -#[derive(serde::Deserialize)] -struct get_app_nodesQueryParams { - - - #[serde(rename = "max_entries")] - pub max_entries: isize, - - - #[serde(rename = "starting_token", default, skip_serializing_if = "Option::is_none")] - pub starting_token: Option, - -} - - - - - - - - - - - - - - -async fn get_app_nodes(_token: A, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::get_app_nodes(crate::apis::actix_server::Query(query.max_entries, query.starting_token)).await.map(Json) -} - - - - -async fn get_app_node(_token: A, path: Path) -> Result, RestError> { - T::get_app_node(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn register_app_node(_token: A, path: Path) -> Result, RestError> { - T::register_app_node(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn deregister_app_node(_token: A, path: Path) -> Result, RestError> { - T::deregister_app_node(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/app_nodes_api/actix/server/mod.rs b/testgen/src/autogen/apis/app_nodes_api/actix/server/mod.rs deleted file mode 100644 index 11efd9e1d..000000000 --- a/testgen/src/autogen/apis/app_nodes_api/actix/server/mod.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait AppNodes { - - - - - async fn get_app_nodes(Query(max_entries, starting_token): Query>) -> Result>; - - - - async fn get_app_node(Path(app_node_id): Path) -> Result>; - - - - async fn register_app_node(Path(app_node_id): Path) -> Result<(), RestError>; - - - - async fn deregister_app_node(Path(app_node_id): Path) -> Result<(), RestError>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/app_nodes_api/mod.rs b/testgen/src/autogen/apis/app_nodes_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/app_nodes_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/app_nodes_api/tower/client/mod.rs b/testgen/src/autogen/apis/app_nodes_api/tower/client/mod.rs deleted file mode 100644 index b8e8a1bfe..000000000 --- a/testgen/src/autogen/apis/app_nodes_api/tower/client/mod.rs +++ /dev/null @@ -1,472 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct AppNodesClient { - configuration: Arc, -} - -impl AppNodesClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for AppNodesClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait AppNodes: Clone + Send + Sync { - - - - - async fn get_app_nodes(&self, max_entries: isize, starting_token: Option) -> Result, Error>; - - - - async fn get_app_node(&self, app_node_id: &str) -> Result, Error>; - - - - async fn register_app_node(&self, app_node_id: &str) -> Result, Error>; - - - - async fn deregister_app_node(&self, app_node_id: &str) -> Result, Error>; - - -} - -/// Same as `AppNodes` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait AppNodes: Clone + Send + Sync { - - - - - async fn get_app_nodes(&self, max_entries: isize, starting_token: Option) -> Result>; - - - - async fn get_app_node(&self, app_node_id: &str) -> Result>; - - - - async fn register_app_node(&self, app_node_id: &str) -> Result<(), super::Error>; - - - - async fn deregister_app_node(&self, app_node_id: &str) -> Result<(), super::Error>; - - - } -} - -#[async_trait::async_trait] -impl direct::AppNodes for AppNodesClient { - - - - - async fn get_app_nodes(&self, max_entries: isize, starting_token: Option) -> Result> { - - AppNodes::get_app_nodes(self, max_entries, starting_token).await.map(|r| r.into_body()) - } - - - - async fn get_app_node(&self, app_node_id: &str) -> Result> { - - AppNodes::get_app_node(self, app_node_id).await.map(|r| r.into_body()) - } - - - - async fn register_app_node(&self, app_node_id: &str) -> Result<(), Error> { - - AppNodes::register_app_node(self, app_node_id).await.map(|r| r.into_body()) - } - - - - async fn deregister_app_node(&self, app_node_id: &str) -> Result<(), Error> { - - AppNodes::deregister_app_node(self, app_node_id).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl AppNodes for AppNodesClient { - - - - - async fn get_app_nodes(&self, max_entries: isize, starting_token: Option) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/app-nodes", configuration.base_path); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - let query_params: Option = None; - - - let query_params = match query_params { - None => Some(format!("max_entries={}", max_entries.to_string())), - Some(previous) => Some(format!("{previous}&max_entries={}", max_entries.to_string())) - }; - - - - - - let query_params = if let Some(local_var_str) = starting_token { - match query_params { - None => Some(format!("starting_token={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&starting_token={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::AppNodes = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_app_node(&self, app_node_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/app-nodes/{app_node_id}", configuration.base_path, app_node_id=crate::apis::urlencode(app_node_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::AppNode = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn register_app_node(&self, app_node_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/app-nodes/{app_node_id}", configuration.base_path, app_node_id=crate::apis::urlencode(app_node_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn deregister_app_node(&self, app_node_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/app-nodes/{app_node_id}", configuration.base_path, app_node_id=crate::apis::urlencode(app_node_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/app_nodes_api/tower/mod.rs b/testgen/src/autogen/apis/app_nodes_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/app_nodes_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/block_devices_api/actix/client/mod.rs b/testgen/src/autogen/apis/block_devices_api/actix/client/mod.rs deleted file mode 100644 index 160ff98a5..000000000 --- a/testgen/src/autogen/apis/block_devices_api/actix/client/mod.rs +++ /dev/null @@ -1,107 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct BlockDevicesClient { - configuration: Rc, -} - -impl BlockDevicesClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait BlockDevices: Clone { - - - - - async fn get_node_block_devices(&self, all: Option, node: &str) -> Result, Error>; - - -} - -#[async_trait::async_trait(?Send)] -impl BlockDevices for BlockDevicesClient { - - - - - async fn get_node_block_devices(&self, all: Option, node: &str) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node}/block_devices", configuration.base_path, node=crate::apis::urlencode(node)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - - if let Some(ref local_var_str) = all { - query_params.push(("all", local_var_str.to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/block_devices_api/actix/mod.rs b/testgen/src/autogen/apis/block_devices_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/block_devices_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/block_devices_api/actix/server/handlers.rs b/testgen/src/autogen/apis/block_devices_api/actix/server/handlers.rs deleted file mode 100644 index 7772d82f7..000000000 --- a/testgen/src/autogen/apis/block_devices_api/actix/server/handlers.rs +++ /dev/null @@ -1,55 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - block_devices_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the BlockDevices resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/nodes/{node}/block_devices") - .name("get_node_block_devices") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_block_devices::)) - ); - - -} - - - - -#[derive(serde::Deserialize)] -struct get_node_block_devicesQueryParams { - - - #[serde(rename = "all", default, skip_serializing_if = "Option::is_none")] - pub all: Option, - -} - - - - - - - - -async fn get_node_block_devices(_token: A, path: Path, query: Query) -> Result>, RestError> { - let query = query.into_inner(); - T::get_node_block_devices(crate::apis::actix_server::Path(path.into_inner()), crate::apis::actix_server::Query(query.all)).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/block_devices_api/actix/server/mod.rs b/testgen/src/autogen/apis/block_devices_api/actix/server/mod.rs deleted file mode 100644 index 17d298afe..000000000 --- a/testgen/src/autogen/apis/block_devices_api/actix/server/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait BlockDevices { - - - - - async fn get_node_block_devices(Path(node): Path, Query(all): Query>) -> Result, RestError>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/block_devices_api/mod.rs b/testgen/src/autogen/apis/block_devices_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/block_devices_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/block_devices_api/tower/client/mod.rs b/testgen/src/autogen/apis/block_devices_api/tower/client/mod.rs deleted file mode 100644 index 8b02d6b1a..000000000 --- a/testgen/src/autogen/apis/block_devices_api/tower/client/mod.rs +++ /dev/null @@ -1,176 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct BlockDevicesClient { - configuration: Arc, -} - -impl BlockDevicesClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for BlockDevicesClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait BlockDevices: Clone + Send + Sync { - - - - - async fn get_node_block_devices(&self, all: Option, node: &str) -> Result>, Error>; - - -} - -/// Same as `BlockDevices` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait BlockDevices: Clone + Send + Sync { - - - - - async fn get_node_block_devices(&self, all: Option, node: &str) -> Result, super::Error>; - - - } -} - -#[async_trait::async_trait] -impl direct::BlockDevices for BlockDevicesClient { - - - - - async fn get_node_block_devices(&self, all: Option, node: &str) -> Result, Error> { - - BlockDevices::get_node_block_devices(self, all, node).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl BlockDevices for BlockDevicesClient { - - - - - async fn get_node_block_devices(&self, all: Option, node: &str) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node}/block_devices", configuration.base_path, node=crate::apis::urlencode(node)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - let query_params: Option = None; - - - - let query_params = if let Some(local_var_str) = all { - match query_params { - None => Some(format!("all={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&all={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/block_devices_api/tower/mod.rs b/testgen/src/autogen/apis/block_devices_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/block_devices_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/children_api/actix/client/mod.rs b/testgen/src/autogen/apis/children_api/actix/client/mod.rs deleted file mode 100644 index 2b6ec3817..000000000 --- a/testgen/src/autogen/apis/children_api/actix/client/mod.rs +++ /dev/null @@ -1,523 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct ChildrenClient { - configuration: Rc, -} - -impl ChildrenClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait Children: Clone { - - - - - async fn get_nexus_children(&self, nexus_id: &uuid::Uuid) -> Result, Error>; - - - - async fn get_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result>; - - - - async fn put_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result>; - - - - async fn del_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result<(), Error>; - - - - async fn get_node_nexus_children(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error>; - - - - async fn get_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result>; - - - - async fn put_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result>; - - - - async fn del_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result<(), Error>; - - -} - -#[async_trait::async_trait(?Send)] -impl Children for ChildrenClient { - - - - - async fn get_nexus_children(&self, nexus_id: &uuid::Uuid) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}/children", configuration.base_path, nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_node_nexus_children(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/children", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/children_api/actix/mod.rs b/testgen/src/autogen/apis/children_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/children_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/children_api/actix/server/handlers.rs b/testgen/src/autogen/apis/children_api/actix/server/handlers.rs deleted file mode 100644 index ff052f580..000000000 --- a/testgen/src/autogen/apis/children_api/actix/server/handlers.rs +++ /dev/null @@ -1,157 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - children_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the Children resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/nexuses/{nexus_id}/children") - .name("get_nexus_children") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_nexus_children::)) - ) - - .service( - actix_web::web::resource("/nexuses/{nexus_id}/children/{child_id}") - .name("get_nexus_child") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_nexus_child::)) - ) - - .service( - actix_web::web::resource("/nexuses/{nexus_id}/children/{child_id}") - .name("put_nexus_child") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_nexus_child::)) - ) - - .service( - actix_web::web::resource("/nexuses/{nexus_id}/children/{child_id}") - .name("del_nexus_child") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_nexus_child::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/nexuses/{nexus_id}/children") - .name("get_node_nexus_children") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_nexus_children::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/nexuses/{nexus_id}/children/{child_id}") - .name("get_node_nexus_child") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_nexus_child::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/nexuses/{nexus_id}/children/{child_id}") - .name("put_node_nexus_child") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_nexus_child::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/nexuses/{nexus_id}/children/{child_id}") - .name("del_node_nexus_child") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_node_nexus_child::)) - ); - - -} - - - - - - - - - - - - - - - - - - - - - - - - - -async fn get_nexus_children(_token: A, path: Path) -> Result>, RestError> { - T::get_nexus_children(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_nexus_child(_token: A, path: Path) -> Result, RestError> { - T::get_nexus_child(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_nexus_child(_token: A, path: Path) -> Result, RestError> { - T::put_nexus_child(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_nexus_child(_token: A, path: Path) -> Result, RestError> { - T::del_nexus_child(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_node_nexus_children(_token: A, path: Path) -> Result>, RestError> { - T::get_node_nexus_children(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_node_nexus_child(_token: A, path: Path) -> Result, RestError> { - T::get_node_nexus_child(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_node_nexus_child(_token: A, path: Path) -> Result, RestError> { - T::put_node_nexus_child(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_node_nexus_child(_token: A, path: Path) -> Result, RestError> { - T::del_node_nexus_child(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/children_api/actix/server/mod.rs b/testgen/src/autogen/apis/children_api/actix/server/mod.rs deleted file mode 100644 index f9323f218..000000000 --- a/testgen/src/autogen/apis/children_api/actix/server/mod.rs +++ /dev/null @@ -1,45 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait Children { - - - - - async fn get_nexus_children(Path(nexus_id): Path) -> Result, RestError>; - - - - async fn get_nexus_child(Path(nexus_id, child_id): Path) -> Result>; - - - - async fn put_nexus_child(Path(nexus_id, child_id): Path) -> Result>; - - - - async fn del_nexus_child(Path(nexus_id, child_id): Path) -> Result<(), RestError>; - - - - async fn get_node_nexus_children(Path(node_id, nexus_id): Path) -> Result, RestError>; - - - - async fn get_node_nexus_child(Path(node_id, nexus_id, child_id): Path) -> Result>; - - - - async fn put_node_nexus_child(Path(node_id, nexus_id, child_id): Path) -> Result>; - - - - async fn del_node_nexus_child(Path(node_id, nexus_id, child_id): Path) -> Result<(), RestError>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/children_api/mod.rs b/testgen/src/autogen/apis/children_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/children_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/children_api/tower/client/mod.rs b/testgen/src/autogen/apis/children_api/tower/client/mod.rs deleted file mode 100644 index 4aea31cd6..000000000 --- a/testgen/src/autogen/apis/children_api/tower/client/mod.rs +++ /dev/null @@ -1,829 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct ChildrenClient { - configuration: Arc, -} - -impl ChildrenClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for ChildrenClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait Children: Clone + Send + Sync { - - - - - async fn get_nexus_children(&self, nexus_id: &uuid::Uuid) -> Result>, Error>; - - - - async fn get_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error>; - - - - async fn put_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error>; - - - - async fn del_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error>; - - - - async fn get_node_nexus_children(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result>, Error>; - - - - async fn get_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error>; - - - - async fn put_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error>; - - - - async fn del_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error>; - - -} - -/// Same as `Children` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait Children: Clone + Send + Sync { - - - - - async fn get_nexus_children(&self, nexus_id: &uuid::Uuid) -> Result, super::Error>; - - - - async fn get_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result>; - - - - async fn put_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result>; - - - - async fn del_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result<(), super::Error>; - - - - async fn get_node_nexus_children(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, super::Error>; - - - - async fn get_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result>; - - - - async fn put_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result>; - - - - async fn del_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result<(), super::Error>; - - - } -} - -#[async_trait::async_trait] -impl direct::Children for ChildrenClient { - - - - - async fn get_nexus_children(&self, nexus_id: &uuid::Uuid) -> Result, Error> { - - Children::get_nexus_children(self, nexus_id).await.map(|r| r.into_body()) - } - - - - async fn get_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result> { - - Children::get_nexus_child(self, nexus_id, child_id).await.map(|r| r.into_body()) - } - - - - async fn put_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result> { - - Children::put_nexus_child(self, nexus_id, child_id).await.map(|r| r.into_body()) - } - - - - async fn del_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result<(), Error> { - - Children::del_nexus_child(self, nexus_id, child_id).await.map(|r| r.into_body()) - } - - - - async fn get_node_nexus_children(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error> { - - Children::get_node_nexus_children(self, node_id, nexus_id).await.map(|r| r.into_body()) - } - - - - async fn get_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result> { - - Children::get_node_nexus_child(self, node_id, nexus_id, child_id).await.map(|r| r.into_body()) - } - - - - async fn put_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result> { - - Children::put_node_nexus_child(self, node_id, nexus_id, child_id).await.map(|r| r.into_body()) - } - - - - async fn del_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result<(), Error> { - - Children::del_node_nexus_child(self, node_id, nexus_id, child_id).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl Children for ChildrenClient { - - - - - async fn get_nexus_children(&self, nexus_id: &uuid::Uuid) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}/children", configuration.base_path, nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Child = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Child = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_nexus_child(&self, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_node_nexus_children(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/children", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Child = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Child = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_node_nexus_child(&self, node_id: &str, nexus_id: &uuid::Uuid, child_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/children/{child_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string(), child_id=crate::apis::urlencode(child_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/children_api/tower/mod.rs b/testgen/src/autogen/apis/children_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/children_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/json_grpc_api/actix/client/mod.rs b/testgen/src/autogen/apis/json_grpc_api/actix/client/mod.rs deleted file mode 100644 index e1fe9dc8e..000000000 --- a/testgen/src/autogen/apis/json_grpc_api/actix/client/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct JsonGrpcClient { - configuration: Rc, -} - -impl JsonGrpcClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait JsonGrpc: Clone { - - - - - async fn put_node_jsongrpc(&self, node: &str, method: &str) -> Result>; - - -} - -#[async_trait::async_trait(?Send)] -impl JsonGrpc for JsonGrpcClient { - - - - - async fn put_node_jsongrpc(&self, node: &str, method: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node}/jsongrpc/{method}", configuration.base_path, node=crate::apis::urlencode(node), method=crate::apis::urlencode(method)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/json_grpc_api/actix/mod.rs b/testgen/src/autogen/apis/json_grpc_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/json_grpc_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/json_grpc_api/actix/server/handlers.rs b/testgen/src/autogen/apis/json_grpc_api/actix/server/handlers.rs deleted file mode 100644 index 68bb3d3f3..000000000 --- a/testgen/src/autogen/apis/json_grpc_api/actix/server/handlers.rs +++ /dev/null @@ -1,45 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - json_grpc_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the JsonGrpc resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/nodes/{node}/jsongrpc/{method}") - .name("put_node_jsongrpc") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_jsongrpc::)) - ); - - -} - - - - - - - - - - - -async fn put_node_jsongrpc(_token: A, path: Path) -> Result, RestError> { - T::put_node_jsongrpc(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/json_grpc_api/actix/server/mod.rs b/testgen/src/autogen/apis/json_grpc_api/actix/server/mod.rs deleted file mode 100644 index 2edc86df8..000000000 --- a/testgen/src/autogen/apis/json_grpc_api/actix/server/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait JsonGrpc { - - - - - async fn put_node_jsongrpc(Path(node, method): Path) -> Result>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/json_grpc_api/mod.rs b/testgen/src/autogen/apis/json_grpc_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/json_grpc_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/json_grpc_api/tower/client/mod.rs b/testgen/src/autogen/apis/json_grpc_api/tower/client/mod.rs deleted file mode 100644 index c6bb2f545..000000000 --- a/testgen/src/autogen/apis/json_grpc_api/tower/client/mod.rs +++ /dev/null @@ -1,157 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct JsonGrpcClient { - configuration: Arc, -} - -impl JsonGrpcClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for JsonGrpcClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait JsonGrpc: Clone + Send + Sync { - - - - - async fn put_node_jsongrpc(&self, node: &str, method: &str) -> Result, Error>; - - -} - -/// Same as `JsonGrpc` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait JsonGrpc: Clone + Send + Sync { - - - - - async fn put_node_jsongrpc(&self, node: &str, method: &str) -> Result>; - - - } -} - -#[async_trait::async_trait] -impl direct::JsonGrpc for JsonGrpcClient { - - - - - async fn put_node_jsongrpc(&self, node: &str, method: &str) -> Result> { - - JsonGrpc::put_node_jsongrpc(self, node, method).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl JsonGrpc for JsonGrpcClient { - - - - - async fn put_node_jsongrpc(&self, node: &str, method: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node}/jsongrpc/{method}", configuration.base_path, node=crate::apis::urlencode(node), method=crate::apis::urlencode(method)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: serde_json::Value = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/json_grpc_api/tower/mod.rs b/testgen/src/autogen/apis/json_grpc_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/json_grpc_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/mod.rs b/testgen/src/autogen/apis/mod.rs deleted file mode 100644 index baf387c1f..000000000 --- a/testgen/src/autogen/apis/mod.rs +++ /dev/null @@ -1,77 +0,0 @@ - - -pub mod app_nodes_api; - -pub mod block_devices_api; - -pub mod children_api; - -pub mod json_grpc_api; - -pub mod nexuses_api; - -pub mod nodes_api; - -pub mod pools_api; - -pub mod replicas_api; - -pub mod snapshots_api; - -pub mod specs_api; - -pub mod volumes_api; - -pub mod watches_api; - - - -/// Actix server. -#[cfg(feature = "actix-server")] -pub mod actix_server; - -#[cfg(feature = "tower-hyper")] -pub use hyper::http::StatusCode; - -#[cfg(not(feature = "tower-hyper"))] -#[cfg(feature = "actix")] -pub use actix_web::http::StatusCode; - -/// Url. -pub use url::Url; -/// Uuid. -pub use uuid::Uuid; - -/// Encode string to use in a URL. -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -/// Helper to convert from Vec into Vec. -pub trait IntoVec: Sized { - /// Performs the conversion. - fn into_vec(self) -> Vec; -} - -impl, T> IntoVec for Vec { - fn into_vec(self) -> Vec { - self.into_iter().map(Into::into).collect() - } -} - -/// Helper to convert from Vec or Option> into Option>. -pub trait IntoOptVec: Sized { - /// Performs the conversion. - fn into_opt_vec(self) -> Option>; -} - -impl, T> IntoOptVec for Vec { - fn into_opt_vec(self) -> Option> { - Some(self.into_iter().map(Into::into).collect()) - } -} -impl, T> IntoOptVec for Option> { - fn into_opt_vec(self) -> Option> { - self.map(|s| s.into_iter().map(Into::into).collect()) - } -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/nexuses_api/actix/client/mod.rs b/testgen/src/autogen/apis/nexuses_api/actix/client/mod.rs deleted file mode 100644 index 325d20f1e..000000000 --- a/testgen/src/autogen/apis/nexuses_api/actix/client/mod.rs +++ /dev/null @@ -1,584 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct NexusesClient { - configuration: Rc, -} - -impl NexusesClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait Nexuses: Clone { - - - - - async fn get_nexuses(&self, ) -> Result, Error>; - - - - async fn get_nexus(&self, nexus_id: &uuid::Uuid) -> Result>; - - - - async fn del_nexus(&self, nexus_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn get_node_nexuses(&self, id: &str) -> Result, Error>; - - - - async fn get_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result>; - - - - async fn put_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result>; - - - - async fn del_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn del_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn put_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid, protocol: &str) -> Result>; - - -} - -#[async_trait::async_trait(?Send)] -impl Nexuses for NexusesClient { - - - - - async fn get_nexuses(&self, ) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nexuses", configuration.base_path); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_nexus(&self, nexus_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}", configuration.base_path, nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_nexus(&self, nexus_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}", configuration.base_path, nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_node_nexuses(&self, id: &str) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{id}/nexuses", configuration.base_path, id=crate::apis::urlencode(id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/share", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid, protocol: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/share/{protocol}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string(), protocol=crate::apis::urlencode(protocol)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/nexuses_api/actix/mod.rs b/testgen/src/autogen/apis/nexuses_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/nexuses_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/nexuses_api/actix/server/handlers.rs b/testgen/src/autogen/apis/nexuses_api/actix/server/handlers.rs deleted file mode 100644 index 3b0e044a9..000000000 --- a/testgen/src/autogen/apis/nexuses_api/actix/server/handlers.rs +++ /dev/null @@ -1,173 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - nexuses_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the Nexuses resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/nexuses") - .name("get_nexuses") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_nexuses::)) - ) - - .service( - actix_web::web::resource("/nexuses/{nexus_id}") - .name("get_nexus") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_nexus::)) - ) - - .service( - actix_web::web::resource("/nexuses/{nexus_id}") - .name("del_nexus") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_nexus::)) - ) - - .service( - actix_web::web::resource("/nodes/{id}/nexuses") - .name("get_node_nexuses") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_nexuses::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/nexuses/{nexus_id}") - .name("get_node_nexus") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_nexus::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/nexuses/{nexus_id}") - .name("put_node_nexus") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_nexus::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/nexuses/{nexus_id}") - .name("del_node_nexus") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_node_nexus::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/nexuses/{nexus_id}/share") - .name("del_node_nexus_share") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_node_nexus_share::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/nexuses/{nexus_id}/share/{protocol}") - .name("put_node_nexus_share") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_nexus_share::)) - ); - - -} - - - - - - - - - - - - - - - - - - - - - - - - - - - -async fn get_nexuses(_token: A) -> Result>, RestError> { - T::get_nexuses().await.map(Json) -} - - - - -async fn get_nexus(_token: A, path: Path) -> Result, RestError> { - T::get_nexus(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_nexus(_token: A, path: Path) -> Result, RestError> { - T::del_nexus(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_node_nexuses(_token: A, path: Path) -> Result>, RestError> { - T::get_node_nexuses(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_node_nexus(_token: A, path: Path) -> Result, RestError> { - T::get_node_nexus(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_node_nexus(_token: A, path: Path) -> Result, RestError> { - T::put_node_nexus(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_node_nexus(_token: A, path: Path) -> Result, RestError> { - T::del_node_nexus(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_node_nexus_share(_token: A, path: Path) -> Result, RestError> { - T::del_node_nexus_share(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_node_nexus_share(_token: A, path: Path) -> Result, RestError> { - T::put_node_nexus_share(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/nexuses_api/actix/server/mod.rs b/testgen/src/autogen/apis/nexuses_api/actix/server/mod.rs deleted file mode 100644 index cdbe04326..000000000 --- a/testgen/src/autogen/apis/nexuses_api/actix/server/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait Nexuses { - - - - - async fn get_nexuses() -> Result, RestError>; - - - - async fn get_nexus(Path(nexus_id): Path) -> Result>; - - - - async fn del_nexus(Path(nexus_id): Path) -> Result<(), RestError>; - - - - async fn get_node_nexuses(Path(id): Path) -> Result, RestError>; - - - - async fn get_node_nexus(Path(node_id, nexus_id): Path) -> Result>; - - - - async fn put_node_nexus(Path(node_id, nexus_id): Path) -> Result>; - - - - async fn del_node_nexus(Path(node_id, nexus_id): Path) -> Result<(), RestError>; - - - - async fn del_node_nexus_share(Path(node_id, nexus_id): Path) -> Result<(), RestError>; - - - - async fn put_node_nexus_share(Path(node_id, nexus_id, protocol): Path) -> Result>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/nexuses_api/mod.rs b/testgen/src/autogen/apis/nexuses_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/nexuses_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/nexuses_api/tower/client/mod.rs b/testgen/src/autogen/apis/nexuses_api/tower/client/mod.rs deleted file mode 100644 index 397b293e0..000000000 --- a/testgen/src/autogen/apis/nexuses_api/tower/client/mod.rs +++ /dev/null @@ -1,925 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct NexusesClient { - configuration: Arc, -} - -impl NexusesClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for NexusesClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait Nexuses: Clone + Send + Sync { - - - - - async fn get_nexuses(&self, ) -> Result>, Error>; - - - - async fn get_nexus(&self, nexus_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_nexus(&self, nexus_id: &uuid::Uuid) -> Result, Error>; - - - - async fn get_node_nexuses(&self, id: &str) -> Result>, Error>; - - - - async fn get_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid, protocol: &str) -> Result, Error>; - - -} - -/// Same as `Nexuses` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait Nexuses: Clone + Send + Sync { - - - - - async fn get_nexuses(&self, ) -> Result, super::Error>; - - - - async fn get_nexus(&self, nexus_id: &uuid::Uuid) -> Result>; - - - - async fn del_nexus(&self, nexus_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn get_node_nexuses(&self, id: &str) -> Result, super::Error>; - - - - async fn get_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result>; - - - - async fn put_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result>; - - - - async fn del_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn del_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn put_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid, protocol: &str) -> Result>; - - - } -} - -#[async_trait::async_trait] -impl direct::Nexuses for NexusesClient { - - - - - async fn get_nexuses(&self, ) -> Result, Error> { - - Nexuses::get_nexuses(self, ).await.map(|r| r.into_body()) - } - - - - async fn get_nexus(&self, nexus_id: &uuid::Uuid) -> Result> { - - Nexuses::get_nexus(self, nexus_id).await.map(|r| r.into_body()) - } - - - - async fn del_nexus(&self, nexus_id: &uuid::Uuid) -> Result<(), Error> { - - Nexuses::del_nexus(self, nexus_id).await.map(|r| r.into_body()) - } - - - - async fn get_node_nexuses(&self, id: &str) -> Result, Error> { - - Nexuses::get_node_nexuses(self, id).await.map(|r| r.into_body()) - } - - - - async fn get_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result> { - - Nexuses::get_node_nexus(self, node_id, nexus_id).await.map(|r| r.into_body()) - } - - - - async fn put_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result> { - - Nexuses::put_node_nexus(self, node_id, nexus_id).await.map(|r| r.into_body()) - } - - - - async fn del_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result<(), Error> { - - Nexuses::del_node_nexus(self, node_id, nexus_id).await.map(|r| r.into_body()) - } - - - - async fn del_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result<(), Error> { - - Nexuses::del_node_nexus_share(self, node_id, nexus_id).await.map(|r| r.into_body()) - } - - - - async fn put_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid, protocol: &str) -> Result> { - - Nexuses::put_node_nexus_share(self, node_id, nexus_id, protocol).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl Nexuses for NexusesClient { - - - - - async fn get_nexuses(&self, ) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nexuses", configuration.base_path); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_nexus(&self, nexus_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}", configuration.base_path, nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Nexus = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_nexus(&self, nexus_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nexuses/{nexus_id}", configuration.base_path, nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_node_nexuses(&self, id: &str) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{id}/nexuses", configuration.base_path, id=crate::apis::urlencode(id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Nexus = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Nexus = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_node_nexus(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/share", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_node_nexus_share(&self, node_id: &str, nexus_id: &uuid::Uuid, protocol: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/nexuses/{nexus_id}/share/{protocol}", configuration.base_path, node_id=crate::apis::urlencode(node_id), nexus_id=nexus_id.to_string(), protocol=crate::apis::urlencode(protocol)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: String = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/nexuses_api/tower/mod.rs b/testgen/src/autogen/apis/nexuses_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/nexuses_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/nodes_api/actix/client/mod.rs b/testgen/src/autogen/apis/nodes_api/actix/client/mod.rs deleted file mode 100644 index cbd85bb94..000000000 --- a/testgen/src/autogen/apis/nodes_api/actix/client/mod.rs +++ /dev/null @@ -1,484 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct NodesClient { - configuration: Rc, -} - -impl NodesClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait Nodes: Clone { - - - - - async fn get_nodes(&self, node_id: Option<&str>) -> Result, Error>; - - - - async fn get_node(&self, id: &str) -> Result>; - - - - async fn put_node_cordon(&self, id: &str, label: &str) -> Result>; - - - - async fn delete_node_cordon(&self, id: &str, label: &str) -> Result>; - - - - async fn put_node_drain(&self, id: &str, label: &str) -> Result>; - - - - async fn put_node_label(&self, overwrite: Option, id: &str, key: &str, value: &str) -> Result>; - - - - async fn delete_node_label(&self, id: &str, key: &str) -> Result>; - - -} - -#[async_trait::async_trait(?Send)] -impl Nodes for NodesClient { - - - - - async fn get_nodes(&self, node_id: Option<&str>) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes", configuration.base_path); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - - if let Some(ref local_var_str) = node_id { - query_params.push(("node_id", local_var_str.to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_node(&self, id: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{id}", configuration.base_path, id=crate::apis::urlencode(id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_node_cordon(&self, id: &str, label: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{id}/cordon/{label}", configuration.base_path, id=crate::apis::urlencode(id), label=crate::apis::urlencode(label)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn delete_node_cordon(&self, id: &str, label: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{id}/cordon/{label}", configuration.base_path, id=crate::apis::urlencode(id), label=crate::apis::urlencode(label)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_node_drain(&self, id: &str, label: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{id}/drain/{label}", configuration.base_path, id=crate::apis::urlencode(id), label=crate::apis::urlencode(label)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_node_label(&self, overwrite: Option, id: &str, key: &str, value: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{id}/label/{key}={value}", configuration.base_path, id=crate::apis::urlencode(id), key=crate::apis::urlencode(key), value=crate::apis::urlencode(value)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - - if let Some(ref local_var_str) = overwrite { - query_params.push(("overwrite", local_var_str.to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn delete_node_label(&self, id: &str, key: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{id}/label/{key}", configuration.base_path, id=crate::apis::urlencode(id), key=crate::apis::urlencode(key)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/nodes_api/actix/mod.rs b/testgen/src/autogen/apis/nodes_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/nodes_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/nodes_api/actix/server/handlers.rs b/testgen/src/autogen/apis/nodes_api/actix/server/handlers.rs deleted file mode 100644 index 64aa0e4ab..000000000 --- a/testgen/src/autogen/apis/nodes_api/actix/server/handlers.rs +++ /dev/null @@ -1,161 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - nodes_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the Nodes resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/nodes") - .name("get_nodes") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_nodes::)) - ) - - .service( - actix_web::web::resource("/nodes/{id}") - .name("get_node") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node::)) - ) - - .service( - actix_web::web::resource("/nodes/{id}/cordon/{label}") - .name("put_node_cordon") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_cordon::)) - ) - - .service( - actix_web::web::resource("/nodes/{id}/cordon/{label}") - .name("delete_node_cordon") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(delete_node_cordon::)) - ) - - .service( - actix_web::web::resource("/nodes/{id}/drain/{label}") - .name("put_node_drain") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_drain::)) - ) - - .service( - actix_web::web::resource("/nodes/{id}/label/{key}={value}") - .name("put_node_label") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_label::)) - ) - - .service( - actix_web::web::resource("/nodes/{id}/label/{key}") - .name("delete_node_label") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(delete_node_label::)) - ); - - -} - - - - -#[derive(serde::Deserialize)] -struct get_nodesQueryParams { - - - #[serde(rename = "node_id", default, skip_serializing_if = "Option::is_none")] - pub node_id: Option, - -} - - - - - - - - - - - -#[derive(serde::Deserialize)] -struct put_node_labelQueryParams { - - - #[serde(rename = "overwrite", default, skip_serializing_if = "Option::is_none")] - pub overwrite: Option, - -} - - - - - - - - - - -async fn get_nodes(_token: A, query: Query) -> Result>, RestError> { - let query = query.into_inner(); - T::get_nodes(crate::apis::actix_server::Query(query.node_id)).await.map(Json) -} - - - - -async fn get_node(_token: A, path: Path) -> Result, RestError> { - T::get_node(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_node_cordon(_token: A, path: Path) -> Result, RestError> { - T::put_node_cordon(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn delete_node_cordon(_token: A, path: Path) -> Result, RestError> { - T::delete_node_cordon(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_node_drain(_token: A, path: Path) -> Result, RestError> { - T::put_node_drain(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_node_label(_token: A, path: Path, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::put_node_label(crate::apis::actix_server::Path(path.into_inner()), crate::apis::actix_server::Query(query.overwrite)).await.map(Json) -} - - - - -async fn delete_node_label(_token: A, path: Path) -> Result, RestError> { - T::delete_node_label(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/nodes_api/actix/server/mod.rs b/testgen/src/autogen/apis/nodes_api/actix/server/mod.rs deleted file mode 100644 index 2ab83b2de..000000000 --- a/testgen/src/autogen/apis/nodes_api/actix/server/mod.rs +++ /dev/null @@ -1,41 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait Nodes { - - - - - async fn get_nodes(Query(node_id): Query>) -> Result, RestError>; - - - - async fn get_node(Path(id): Path) -> Result>; - - - - async fn put_node_cordon(Path(id, label): Path) -> Result>; - - - - async fn delete_node_cordon(Path(id, label): Path) -> Result>; - - - - async fn put_node_drain(Path(id, label): Path) -> Result>; - - - - async fn put_node_label(Path(id, key, value): Path, Query(overwrite): Query>) -> Result>; - - - - async fn delete_node_label(Path(id, key): Path) -> Result>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/nodes_api/mod.rs b/testgen/src/autogen/apis/nodes_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/nodes_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/nodes_api/tower/client/mod.rs b/testgen/src/autogen/apis/nodes_api/tower/client/mod.rs deleted file mode 100644 index 67bf2b124..000000000 --- a/testgen/src/autogen/apis/nodes_api/tower/client/mod.rs +++ /dev/null @@ -1,771 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct NodesClient { - configuration: Arc, -} - -impl NodesClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for NodesClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait Nodes: Clone + Send + Sync { - - - - - async fn get_nodes(&self, node_id: Option<&str>) -> Result>, Error>; - - - - async fn get_node(&self, id: &str) -> Result, Error>; - - - - async fn put_node_cordon(&self, id: &str, label: &str) -> Result, Error>; - - - - async fn delete_node_cordon(&self, id: &str, label: &str) -> Result, Error>; - - - - async fn put_node_drain(&self, id: &str, label: &str) -> Result, Error>; - - - - async fn put_node_label(&self, overwrite: Option, id: &str, key: &str, value: &str) -> Result, Error>; - - - - async fn delete_node_label(&self, id: &str, key: &str) -> Result, Error>; - - -} - -/// Same as `Nodes` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait Nodes: Clone + Send + Sync { - - - - - async fn get_nodes(&self, node_id: Option<&str>) -> Result, super::Error>; - - - - async fn get_node(&self, id: &str) -> Result>; - - - - async fn put_node_cordon(&self, id: &str, label: &str) -> Result>; - - - - async fn delete_node_cordon(&self, id: &str, label: &str) -> Result>; - - - - async fn put_node_drain(&self, id: &str, label: &str) -> Result>; - - - - async fn put_node_label(&self, overwrite: Option, id: &str, key: &str, value: &str) -> Result>; - - - - async fn delete_node_label(&self, id: &str, key: &str) -> Result>; - - - } -} - -#[async_trait::async_trait] -impl direct::Nodes for NodesClient { - - - - - async fn get_nodes(&self, node_id: Option<&str>) -> Result, Error> { - - Nodes::get_nodes(self, node_id).await.map(|r| r.into_body()) - } - - - - async fn get_node(&self, id: &str) -> Result> { - - Nodes::get_node(self, id).await.map(|r| r.into_body()) - } - - - - async fn put_node_cordon(&self, id: &str, label: &str) -> Result> { - - Nodes::put_node_cordon(self, id, label).await.map(|r| r.into_body()) - } - - - - async fn delete_node_cordon(&self, id: &str, label: &str) -> Result> { - - Nodes::delete_node_cordon(self, id, label).await.map(|r| r.into_body()) - } - - - - async fn put_node_drain(&self, id: &str, label: &str) -> Result> { - - Nodes::put_node_drain(self, id, label).await.map(|r| r.into_body()) - } - - - - async fn put_node_label(&self, overwrite: Option, id: &str, key: &str, value: &str) -> Result> { - - Nodes::put_node_label(self, overwrite, id, key, value).await.map(|r| r.into_body()) - } - - - - async fn delete_node_label(&self, id: &str, key: &str) -> Result> { - - Nodes::delete_node_label(self, id, key).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl Nodes for NodesClient { - - - - - async fn get_nodes(&self, node_id: Option<&str>) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes", configuration.base_path); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - let query_params: Option = None; - - - - let query_params = if let Some(local_var_str) = node_id { - match query_params { - None => Some(format!("node_id={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&node_id={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_node(&self, id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{id}", configuration.base_path, id=crate::apis::urlencode(id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Node = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_node_cordon(&self, id: &str, label: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{id}/cordon/{label}", configuration.base_path, id=crate::apis::urlencode(id), label=crate::apis::urlencode(label)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Node = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn delete_node_cordon(&self, id: &str, label: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{id}/cordon/{label}", configuration.base_path, id=crate::apis::urlencode(id), label=crate::apis::urlencode(label)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Node = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_node_drain(&self, id: &str, label: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{id}/drain/{label}", configuration.base_path, id=crate::apis::urlencode(id), label=crate::apis::urlencode(label)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Node = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_node_label(&self, overwrite: Option, id: &str, key: &str, value: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{id}/label/{key}={value}", configuration.base_path, id=crate::apis::urlencode(id), key=crate::apis::urlencode(key), value=crate::apis::urlencode(value)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - let query_params: Option = None; - - - - let query_params = if let Some(local_var_str) = overwrite { - match query_params { - None => Some(format!("overwrite={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&overwrite={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Node = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn delete_node_label(&self, id: &str, key: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{id}/label/{key}", configuration.base_path, id=crate::apis::urlencode(id), key=crate::apis::urlencode(key)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Node = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/nodes_api/tower/mod.rs b/testgen/src/autogen/apis/nodes_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/nodes_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/openapi.yaml b/testgen/src/autogen/apis/openapi.yaml deleted file mode 100644 index e69de29bb..000000000 diff --git a/testgen/src/autogen/apis/pools_api/actix/client/mod.rs b/testgen/src/autogen/apis/pools_api/actix/client/mod.rs deleted file mode 100644 index 6b4f8ba9d..000000000 --- a/testgen/src/autogen/apis/pools_api/actix/client/mod.rs +++ /dev/null @@ -1,462 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct PoolsClient { - configuration: Rc, -} - -impl PoolsClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait Pools: Clone { - - - - - async fn get_node_pools(&self, id: &str) -> Result, Error>; - - - - async fn get_node_pool(&self, node_id: &str, pool_id: &str) -> Result>; - - - - async fn put_node_pool(&self, node_id: &str, pool_id: &str) -> Result>; - - - - async fn del_node_pool(&self, node_id: &str, pool_id: &str) -> Result<(), Error>; - - - - async fn get_pools(&self, ) -> Result, Error>; - - - - async fn get_pool(&self, pool_id: &str) -> Result>; - - - - async fn del_pool(&self, pool_id: &str) -> Result<(), Error>; - - -} - -#[async_trait::async_trait(?Send)] -impl Pools for PoolsClient { - - - - - async fn get_node_pools(&self, id: &str) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{id}/pools", configuration.base_path, id=crate::apis::urlencode(id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_node_pool(&self, node_id: &str, pool_id: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_node_pool(&self, node_id: &str, pool_id: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_node_pool(&self, node_id: &str, pool_id: &str) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_pools(&self, ) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/pools", configuration.base_path); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_pool(&self, pool_id: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/pools/{pool_id}", configuration.base_path, pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_pool(&self, pool_id: &str) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/pools/{pool_id}", configuration.base_path, pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/pools_api/actix/mod.rs b/testgen/src/autogen/apis/pools_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/pools_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/pools_api/actix/server/handlers.rs b/testgen/src/autogen/apis/pools_api/actix/server/handlers.rs deleted file mode 100644 index b9d3ee97b..000000000 --- a/testgen/src/autogen/apis/pools_api/actix/server/handlers.rs +++ /dev/null @@ -1,141 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - pools_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the Pools resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/nodes/{id}/pools") - .name("get_node_pools") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_pools::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/pools/{pool_id}") - .name("get_node_pool") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_pool::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/pools/{pool_id}") - .name("put_node_pool") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_pool::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/pools/{pool_id}") - .name("del_node_pool") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_node_pool::)) - ) - - .service( - actix_web::web::resource("/pools") - .name("get_pools") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_pools::)) - ) - - .service( - actix_web::web::resource("/pools/{pool_id}") - .name("get_pool") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_pool::)) - ) - - .service( - actix_web::web::resource("/pools/{pool_id}") - .name("del_pool") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_pool::)) - ); - - -} - - - - - - - - - - - - - - - - - - - - - - - -async fn get_node_pools(_token: A, path: Path) -> Result>, RestError> { - T::get_node_pools(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_node_pool(_token: A, path: Path) -> Result, RestError> { - T::get_node_pool(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_node_pool(_token: A, path: Path) -> Result, RestError> { - T::put_node_pool(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_node_pool(_token: A, path: Path) -> Result, RestError> { - T::del_node_pool(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_pools(_token: A) -> Result>, RestError> { - T::get_pools().await.map(Json) -} - - - - -async fn get_pool(_token: A, path: Path) -> Result, RestError> { - T::get_pool(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_pool(_token: A, path: Path) -> Result, RestError> { - T::del_pool(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/pools_api/actix/server/mod.rs b/testgen/src/autogen/apis/pools_api/actix/server/mod.rs deleted file mode 100644 index ed88c8879..000000000 --- a/testgen/src/autogen/apis/pools_api/actix/server/mod.rs +++ /dev/null @@ -1,41 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait Pools { - - - - - async fn get_node_pools(Path(id): Path) -> Result, RestError>; - - - - async fn get_node_pool(Path(node_id, pool_id): Path) -> Result>; - - - - async fn put_node_pool(Path(node_id, pool_id): Path) -> Result>; - - - - async fn del_node_pool(Path(node_id, pool_id): Path) -> Result<(), RestError>; - - - - async fn get_pools() -> Result, RestError>; - - - - async fn get_pool(Path(pool_id): Path) -> Result>; - - - - async fn del_pool(Path(pool_id): Path) -> Result<(), RestError>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/pools_api/mod.rs b/testgen/src/autogen/apis/pools_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/pools_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/pools_api/tower/client/mod.rs b/testgen/src/autogen/apis/pools_api/tower/client/mod.rs deleted file mode 100644 index 5f449e678..000000000 --- a/testgen/src/autogen/apis/pools_api/tower/client/mod.rs +++ /dev/null @@ -1,733 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct PoolsClient { - configuration: Arc, -} - -impl PoolsClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for PoolsClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait Pools: Clone + Send + Sync { - - - - - async fn get_node_pools(&self, id: &str) -> Result>, Error>; - - - - async fn get_node_pool(&self, node_id: &str, pool_id: &str) -> Result, Error>; - - - - async fn put_node_pool(&self, node_id: &str, pool_id: &str) -> Result, Error>; - - - - async fn del_node_pool(&self, node_id: &str, pool_id: &str) -> Result, Error>; - - - - async fn get_pools(&self, ) -> Result>, Error>; - - - - async fn get_pool(&self, pool_id: &str) -> Result, Error>; - - - - async fn del_pool(&self, pool_id: &str) -> Result, Error>; - - -} - -/// Same as `Pools` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait Pools: Clone + Send + Sync { - - - - - async fn get_node_pools(&self, id: &str) -> Result, super::Error>; - - - - async fn get_node_pool(&self, node_id: &str, pool_id: &str) -> Result>; - - - - async fn put_node_pool(&self, node_id: &str, pool_id: &str) -> Result>; - - - - async fn del_node_pool(&self, node_id: &str, pool_id: &str) -> Result<(), super::Error>; - - - - async fn get_pools(&self, ) -> Result, super::Error>; - - - - async fn get_pool(&self, pool_id: &str) -> Result>; - - - - async fn del_pool(&self, pool_id: &str) -> Result<(), super::Error>; - - - } -} - -#[async_trait::async_trait] -impl direct::Pools for PoolsClient { - - - - - async fn get_node_pools(&self, id: &str) -> Result, Error> { - - Pools::get_node_pools(self, id).await.map(|r| r.into_body()) - } - - - - async fn get_node_pool(&self, node_id: &str, pool_id: &str) -> Result> { - - Pools::get_node_pool(self, node_id, pool_id).await.map(|r| r.into_body()) - } - - - - async fn put_node_pool(&self, node_id: &str, pool_id: &str) -> Result> { - - Pools::put_node_pool(self, node_id, pool_id).await.map(|r| r.into_body()) - } - - - - async fn del_node_pool(&self, node_id: &str, pool_id: &str) -> Result<(), Error> { - - Pools::del_node_pool(self, node_id, pool_id).await.map(|r| r.into_body()) - } - - - - async fn get_pools(&self, ) -> Result, Error> { - - Pools::get_pools(self, ).await.map(|r| r.into_body()) - } - - - - async fn get_pool(&self, pool_id: &str) -> Result> { - - Pools::get_pool(self, pool_id).await.map(|r| r.into_body()) - } - - - - async fn del_pool(&self, pool_id: &str) -> Result<(), Error> { - - Pools::del_pool(self, pool_id).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl Pools for PoolsClient { - - - - - async fn get_node_pools(&self, id: &str) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{id}/pools", configuration.base_path, id=crate::apis::urlencode(id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_node_pool(&self, node_id: &str, pool_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Pool = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_node_pool(&self, node_id: &str, pool_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Pool = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_node_pool(&self, node_id: &str, pool_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_pools(&self, ) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/pools", configuration.base_path); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_pool(&self, pool_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/pools/{pool_id}", configuration.base_path, pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Pool = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_pool(&self, pool_id: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/pools/{pool_id}", configuration.base_path, pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/pools_api/tower/mod.rs b/testgen/src/autogen/apis/pools_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/pools_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/replicas_api/actix/client/mod.rs b/testgen/src/autogen/apis/replicas_api/actix/client/mod.rs deleted file mode 100644 index c00a52868..000000000 --- a/testgen/src/autogen/apis/replicas_api/actix/client/mod.rs +++ /dev/null @@ -1,850 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct ReplicasClient { - configuration: Rc, -} - -impl ReplicasClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait Replicas: Clone { - - - - - async fn get_node_replicas(&self, id: &str) -> Result, Error>; - - - - async fn get_node_pool_replicas(&self, node_id: &str, pool_id: &str) -> Result, Error>; - - - - async fn get_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn put_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn del_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn del_node_pool_replica_share(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn put_node_pool_replica_share(&self, allowed_hosts: Option>, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn put_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn del_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn del_pool_replica_share(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn put_pool_replica_share(&self, allowed_hosts: Option>, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn get_replicas(&self, ) -> Result, Error>; - - - - async fn get_replica(&self, id: &uuid::Uuid) -> Result>; - - -} - -#[async_trait::async_trait(?Send)] -impl Replicas for ReplicasClient { - - - - - async fn get_node_replicas(&self, id: &str) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{id}/replicas", configuration.base_path, id=crate::apis::urlencode(id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_node_pool_replicas(&self, node_id: &str, pool_id: &str) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_node_pool_replica_share(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}/share", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_node_pool_replica_share(&self, allowed_hosts: Option>, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}/share/nvmf", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - - if let Some(ref local_var_str) = allowed_hosts { - query_params.push(("allowed-hosts", local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_pool_replica_share(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/pools/{pool_id}/replicas/{replica_id}/share", configuration.base_path, pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_pool_replica_share(&self, allowed_hosts: Option>, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/pools/{pool_id}/replicas/{replica_id}/share/nvmf", configuration.base_path, pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - - if let Some(ref local_var_str) = allowed_hosts { - query_params.push(("allowed-hosts", local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_replicas(&self, ) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/replicas", configuration.base_path); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_replica(&self, id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/replicas/{id}", configuration.base_path, id=id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/replicas_api/actix/mod.rs b/testgen/src/autogen/apis/replicas_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/replicas_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/replicas_api/actix/server/handlers.rs b/testgen/src/autogen/apis/replicas_api/actix/server/handlers.rs deleted file mode 100644 index 45de3d36e..000000000 --- a/testgen/src/autogen/apis/replicas_api/actix/server/handlers.rs +++ /dev/null @@ -1,257 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - replicas_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the Replicas resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/nodes/{id}/replicas") - .name("get_node_replicas") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_replicas::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/pools/{pool_id}/replicas") - .name("get_node_pool_replicas") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_pool_replicas::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}") - .name("get_node_pool_replica") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_node_pool_replica::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}") - .name("put_node_pool_replica") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_pool_replica::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}") - .name("del_node_pool_replica") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_node_pool_replica::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}/share") - .name("del_node_pool_replica_share") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_node_pool_replica_share::)) - ) - - .service( - actix_web::web::resource("/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}/share/nvmf") - .name("put_node_pool_replica_share") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_node_pool_replica_share::)) - ) - - .service( - actix_web::web::resource("/pools/{pool_id}/replicas/{replica_id}") - .name("put_pool_replica") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_pool_replica::)) - ) - - .service( - actix_web::web::resource("/pools/{pool_id}/replicas/{replica_id}") - .name("del_pool_replica") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_pool_replica::)) - ) - - .service( - actix_web::web::resource("/pools/{pool_id}/replicas/{replica_id}/share") - .name("del_pool_replica_share") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_pool_replica_share::)) - ) - - .service( - actix_web::web::resource("/pools/{pool_id}/replicas/{replica_id}/share/nvmf") - .name("put_pool_replica_share") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_pool_replica_share::)) - ) - - .service( - actix_web::web::resource("/replicas") - .name("get_replicas") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_replicas::)) - ) - - .service( - actix_web::web::resource("/replicas/{id}") - .name("get_replica") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_replica::)) - ); - - -} - - - - - - - - - - - - - - - - -#[derive(serde::Deserialize)] -struct put_node_pool_replica_shareQueryParams { - - - #[serde(rename = "allowed-hosts", default, skip_serializing_if = "Option::is_none", deserialize_with = "deserialize_option_stringified_list")] - pub allowed_hosts: Option>, - -} - - - - - - - - - -#[derive(serde::Deserialize)] -struct put_pool_replica_shareQueryParams { - - - #[serde(rename = "allowed-hosts", default, skip_serializing_if = "Option::is_none", deserialize_with = "deserialize_option_stringified_list")] - pub allowed_hosts: Option>, - -} - - - - - - - - - - - - -async fn get_node_replicas(_token: A, path: Path) -> Result>, RestError> { - T::get_node_replicas(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_node_pool_replicas(_token: A, path: Path) -> Result>, RestError> { - T::get_node_pool_replicas(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_node_pool_replica(_token: A, path: Path) -> Result, RestError> { - T::get_node_pool_replica(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_node_pool_replica(_token: A, path: Path) -> Result, RestError> { - T::put_node_pool_replica(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_node_pool_replica(_token: A, path: Path) -> Result, RestError> { - T::del_node_pool_replica(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_node_pool_replica_share(_token: A, path: Path) -> Result, RestError> { - T::del_node_pool_replica_share(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_node_pool_replica_share(_token: A, path: Path, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::put_node_pool_replica_share(crate::apis::actix_server::Path(path.into_inner()), crate::apis::actix_server::Query(query.allowed_hosts)).await.map(Json) -} - - - - -async fn put_pool_replica(_token: A, path: Path) -> Result, RestError> { - T::put_pool_replica(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_pool_replica(_token: A, path: Path) -> Result, RestError> { - T::del_pool_replica(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_pool_replica_share(_token: A, path: Path) -> Result, RestError> { - T::del_pool_replica_share(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_pool_replica_share(_token: A, path: Path, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::put_pool_replica_share(crate::apis::actix_server::Path(path.into_inner()), crate::apis::actix_server::Query(query.allowed_hosts)).await.map(Json) -} - - - - -async fn get_replicas(_token: A) -> Result>, RestError> { - T::get_replicas().await.map(Json) -} - - - - -async fn get_replica(_token: A, path: Path) -> Result, RestError> { - T::get_replica(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/replicas_api/actix/server/mod.rs b/testgen/src/autogen/apis/replicas_api/actix/server/mod.rs deleted file mode 100644 index fa6cb64c2..000000000 --- a/testgen/src/autogen/apis/replicas_api/actix/server/mod.rs +++ /dev/null @@ -1,65 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait Replicas { - - - - - async fn get_node_replicas(Path(id): Path) -> Result, RestError>; - - - - async fn get_node_pool_replicas(Path(node_id, pool_id): Path) -> Result, RestError>; - - - - async fn get_node_pool_replica(Path(node_id, pool_id, replica_id): Path) -> Result>; - - - - async fn put_node_pool_replica(Path(node_id, pool_id, replica_id): Path) -> Result>; - - - - async fn del_node_pool_replica(Path(node_id, pool_id, replica_id): Path) -> Result<(), RestError>; - - - - async fn del_node_pool_replica_share(Path(node_id, pool_id, replica_id): Path) -> Result<(), RestError>; - - - - async fn put_node_pool_replica_share(Path(node_id, pool_id, replica_id): Path, Query(allowed_hosts): Query>>) -> Result>; - - - - async fn put_pool_replica(Path(pool_id, replica_id): Path) -> Result>; - - - - async fn del_pool_replica(Path(pool_id, replica_id): Path) -> Result<(), RestError>; - - - - async fn del_pool_replica_share(Path(pool_id, replica_id): Path) -> Result<(), RestError>; - - - - async fn put_pool_replica_share(Path(pool_id, replica_id): Path, Query(allowed_hosts): Query>>) -> Result>; - - - - async fn get_replicas() -> Result, RestError>; - - - - async fn get_replica(Path(id): Path) -> Result>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/replicas_api/mod.rs b/testgen/src/autogen/apis/replicas_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/replicas_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/replicas_api/tower/client/mod.rs b/testgen/src/autogen/apis/replicas_api/tower/client/mod.rs deleted file mode 100644 index c0c7340b9..000000000 --- a/testgen/src/autogen/apis/replicas_api/tower/client/mod.rs +++ /dev/null @@ -1,1347 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct ReplicasClient { - configuration: Arc, -} - -impl ReplicasClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for ReplicasClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait Replicas: Clone + Send + Sync { - - - - - async fn get_node_replicas(&self, id: &str) -> Result>, Error>; - - - - async fn get_node_pool_replicas(&self, node_id: &str, pool_id: &str) -> Result>, Error>; - - - - async fn get_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_node_pool_replica_share(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_node_pool_replica_share(&self, allowed_hosts: Option>, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_pool_replica_share(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_pool_replica_share(&self, allowed_hosts: Option>, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error>; - - - - async fn get_replicas(&self, ) -> Result>, Error>; - - - - async fn get_replica(&self, id: &uuid::Uuid) -> Result, Error>; - - -} - -/// Same as `Replicas` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait Replicas: Clone + Send + Sync { - - - - - async fn get_node_replicas(&self, id: &str) -> Result, super::Error>; - - - - async fn get_node_pool_replicas(&self, node_id: &str, pool_id: &str) -> Result, super::Error>; - - - - async fn get_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn put_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn del_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn del_node_pool_replica_share(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn put_node_pool_replica_share(&self, allowed_hosts: Option>, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn put_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn del_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn del_pool_replica_share(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn put_pool_replica_share(&self, allowed_hosts: Option>, pool_id: &str, replica_id: &uuid::Uuid) -> Result>; - - - - async fn get_replicas(&self, ) -> Result, super::Error>; - - - - async fn get_replica(&self, id: &uuid::Uuid) -> Result>; - - - } -} - -#[async_trait::async_trait] -impl direct::Replicas for ReplicasClient { - - - - - async fn get_node_replicas(&self, id: &str) -> Result, Error> { - - Replicas::get_node_replicas(self, id).await.map(|r| r.into_body()) - } - - - - async fn get_node_pool_replicas(&self, node_id: &str, pool_id: &str) -> Result, Error> { - - Replicas::get_node_pool_replicas(self, node_id, pool_id).await.map(|r| r.into_body()) - } - - - - async fn get_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - Replicas::get_node_pool_replica(self, node_id, pool_id, replica_id).await.map(|r| r.into_body()) - } - - - - async fn put_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - Replicas::put_node_pool_replica(self, node_id, pool_id, replica_id).await.map(|r| r.into_body()) - } - - - - async fn del_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error> { - - Replicas::del_node_pool_replica(self, node_id, pool_id, replica_id).await.map(|r| r.into_body()) - } - - - - async fn del_node_pool_replica_share(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error> { - - Replicas::del_node_pool_replica_share(self, node_id, pool_id, replica_id).await.map(|r| r.into_body()) - } - - - - async fn put_node_pool_replica_share(&self, allowed_hosts: Option>, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - Replicas::put_node_pool_replica_share(self, allowed_hosts, node_id, pool_id, replica_id).await.map(|r| r.into_body()) - } - - - - async fn put_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - Replicas::put_pool_replica(self, pool_id, replica_id).await.map(|r| r.into_body()) - } - - - - async fn del_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error> { - - Replicas::del_pool_replica(self, pool_id, replica_id).await.map(|r| r.into_body()) - } - - - - async fn del_pool_replica_share(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result<(), Error> { - - Replicas::del_pool_replica_share(self, pool_id, replica_id).await.map(|r| r.into_body()) - } - - - - async fn put_pool_replica_share(&self, allowed_hosts: Option>, pool_id: &str, replica_id: &uuid::Uuid) -> Result> { - - Replicas::put_pool_replica_share(self, allowed_hosts, pool_id, replica_id).await.map(|r| r.into_body()) - } - - - - async fn get_replicas(&self, ) -> Result, Error> { - - Replicas::get_replicas(self, ).await.map(|r| r.into_body()) - } - - - - async fn get_replica(&self, id: &uuid::Uuid) -> Result> { - - Replicas::get_replica(self, id).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl Replicas for ReplicasClient { - - - - - async fn get_node_replicas(&self, id: &str) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{id}/replicas", configuration.base_path, id=crate::apis::urlencode(id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_node_pool_replicas(&self, node_id: &str, pool_id: &str) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Replica = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Replica = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_node_pool_replica(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_node_pool_replica_share(&self, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}/share", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_node_pool_replica_share(&self, allowed_hosts: Option>, node_id: &str, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}/share/nvmf", configuration.base_path, node_id=crate::apis::urlencode(node_id), pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - let query_params: Option = None; - - - - let query_params = if let Some(local_var_str) = allowed_hosts { - match query_params { - None => Some(format!("allowed-hosts={}", local_var_str.join(","))), - Some(previous) => Some(format!("{previous}&allowed-hosts={}", local_var_str.join(","))) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: String = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Replica = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_pool_replica(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/pools/{pool_id}/replicas/{replica_id}", configuration.base_path, pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_pool_replica_share(&self, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/pools/{pool_id}/replicas/{replica_id}/share", configuration.base_path, pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_pool_replica_share(&self, allowed_hosts: Option>, pool_id: &str, replica_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/pools/{pool_id}/replicas/{replica_id}/share/nvmf", configuration.base_path, pool_id=crate::apis::urlencode(pool_id), replica_id=replica_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - let query_params: Option = None; - - - - let query_params = if let Some(local_var_str) = allowed_hosts { - match query_params { - None => Some(format!("allowed-hosts={}", local_var_str.join(","))), - Some(previous) => Some(format!("{previous}&allowed-hosts={}", local_var_str.join(","))) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: String = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_replicas(&self, ) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/replicas", configuration.base_path); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_replica(&self, id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/replicas/{id}", configuration.base_path, id=id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Replica = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/replicas_api/tower/mod.rs b/testgen/src/autogen/apis/replicas_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/replicas_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/snapshots_api/actix/client/mod.rs b/testgen/src/autogen/apis/snapshots_api/actix/client/mod.rs deleted file mode 100644 index 4021a3f77..000000000 --- a/testgen/src/autogen/apis/snapshots_api/actix/client/mod.rs +++ /dev/null @@ -1,508 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct SnapshotsClient { - configuration: Rc, -} - -impl SnapshotsClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait Snapshots: Clone { - - - - - async fn get_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result>; - - - - async fn del_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn get_volume_snapshots(&self, max_entries: isize, starting_token: Option, volume_id: &uuid::Uuid) -> Result>; - - - - async fn get_volumes_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result>; - - - - async fn del_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn get_volumes_snapshots(&self, snapshot_id: Option<&uuid::Uuid>, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result>; - - -} - -#[async_trait::async_trait(?Send)] -impl Snapshots for SnapshotsClient { - - - - - async fn get_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/snapshots/{snapshot_id}", configuration.base_path, volume_id=volume_id.to_string(), snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/snapshots/{snapshot_id}", configuration.base_path, volume_id=volume_id.to_string(), snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/snapshots/{snapshot_id}", configuration.base_path, volume_id=volume_id.to_string(), snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_volume_snapshots(&self, max_entries: isize, starting_token: Option, volume_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/snapshots", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - query_params.push(("max_entries", max_entries.to_string())); - - - - - - if let Some(ref local_var_str) = starting_token { - query_params.push(("starting_token", local_var_str.to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_volumes_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/snapshots/{snapshot_id}", configuration.base_path, snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/snapshots/{snapshot_id}", configuration.base_path, snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_volumes_snapshots(&self, snapshot_id: Option<&uuid::Uuid>, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/snapshots", configuration.base_path); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - - if let Some(ref local_var_str) = snapshot_id { - query_params.push(("snapshot_id", local_var_str.to_string())); - } - - - - - if let Some(ref local_var_str) = volume_id { - query_params.push(("volume_id", local_var_str.to_string())); - } - - - - query_params.push(("max_entries", max_entries.to_string())); - - - - - - if let Some(ref local_var_str) = starting_token { - query_params.push(("starting_token", local_var_str.to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/snapshots_api/actix/mod.rs b/testgen/src/autogen/apis/snapshots_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/snapshots_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/snapshots_api/actix/server/handlers.rs b/testgen/src/autogen/apis/snapshots_api/actix/server/handlers.rs deleted file mode 100644 index 2c95ef64e..000000000 --- a/testgen/src/autogen/apis/snapshots_api/actix/server/handlers.rs +++ /dev/null @@ -1,177 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - snapshots_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the Snapshots resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/volumes/{volume_id}/snapshots/{snapshot_id}") - .name("get_volume_snapshot") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_volume_snapshot::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/snapshots/{snapshot_id}") - .name("put_volume_snapshot") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_volume_snapshot::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/snapshots/{snapshot_id}") - .name("del_volume_snapshot") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_volume_snapshot::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/snapshots") - .name("get_volume_snapshots") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_volume_snapshots::)) - ) - - .service( - actix_web::web::resource("/volumes/snapshots/{snapshot_id}") - .name("get_volumes_snapshot") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_volumes_snapshot::)) - ) - - .service( - actix_web::web::resource("/volumes/snapshots/{snapshot_id}") - .name("del_snapshot") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_snapshot::)) - ) - - .service( - actix_web::web::resource("/volumes/snapshots") - .name("get_volumes_snapshots") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_volumes_snapshots::)) - ); - - -} - - - - - - - - - - -#[derive(serde::Deserialize)] -struct get_volume_snapshotsQueryParams { - - - #[serde(rename = "max_entries")] - pub max_entries: isize, - - - #[serde(rename = "starting_token", default, skip_serializing_if = "Option::is_none")] - pub starting_token: Option, - -} - - - - - - - -#[derive(serde::Deserialize)] -struct get_volumes_snapshotsQueryParams { - - - #[serde(rename = "snapshot_id", default, skip_serializing_if = "Option::is_none")] - pub snapshot_id: Option, - - - #[serde(rename = "volume_id", default, skip_serializing_if = "Option::is_none")] - pub volume_id: Option, - - - #[serde(rename = "max_entries")] - pub max_entries: isize, - - - #[serde(rename = "starting_token", default, skip_serializing_if = "Option::is_none")] - pub starting_token: Option, - -} - - - - - - - - -async fn get_volume_snapshot(_token: A, path: Path) -> Result, RestError> { - T::get_volume_snapshot(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_volume_snapshot(_token: A, path: Path) -> Result, RestError> { - T::put_volume_snapshot(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_volume_snapshot(_token: A, path: Path) -> Result, RestError> { - T::del_volume_snapshot(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_volume_snapshots(_token: A, path: Path, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::get_volume_snapshots(crate::apis::actix_server::Path(path.into_inner()), crate::apis::actix_server::Query(query.max_entries, query.starting_token)).await.map(Json) -} - - - - -async fn get_volumes_snapshot(_token: A, path: Path) -> Result, RestError> { - T::get_volumes_snapshot(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_snapshot(_token: A, path: Path) -> Result, RestError> { - T::del_snapshot(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_volumes_snapshots(_token: A, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::get_volumes_snapshots(crate::apis::actix_server::Query(query.snapshot_id, query.volume_id, query.max_entries, query.starting_token)).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/snapshots_api/actix/server/mod.rs b/testgen/src/autogen/apis/snapshots_api/actix/server/mod.rs deleted file mode 100644 index bdd896917..000000000 --- a/testgen/src/autogen/apis/snapshots_api/actix/server/mod.rs +++ /dev/null @@ -1,41 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait Snapshots { - - - - - async fn get_volume_snapshot(Path(volume_id, snapshot_id): Path) -> Result>; - - - - async fn put_volume_snapshot(Path(volume_id, snapshot_id): Path) -> Result>; - - - - async fn del_volume_snapshot(Path(volume_id, snapshot_id): Path) -> Result<(), RestError>; - - - - async fn get_volume_snapshots(Path(volume_id): Path, Query(max_entries, starting_token): Query>) -> Result>; - - - - async fn get_volumes_snapshot(Path(snapshot_id): Path) -> Result>; - - - - async fn del_snapshot(Path(snapshot_id): Path) -> Result<(), RestError>; - - - - async fn get_volumes_snapshots(Query(snapshot_id, volume_id, max_entries, starting_token): Query, Option, isize, Option>) -> Result>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/snapshots_api/mod.rs b/testgen/src/autogen/apis/snapshots_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/snapshots_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/snapshots_api/tower/client/mod.rs b/testgen/src/autogen/apis/snapshots_api/tower/client/mod.rs deleted file mode 100644 index c392612f6..000000000 --- a/testgen/src/autogen/apis/snapshots_api/tower/client/mod.rs +++ /dev/null @@ -1,811 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct SnapshotsClient { - configuration: Arc, -} - -impl SnapshotsClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for SnapshotsClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait Snapshots: Clone + Send + Sync { - - - - - async fn get_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result, Error>; - - - - async fn get_volume_snapshots(&self, max_entries: isize, starting_token: Option, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn get_volumes_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result, Error>; - - - - async fn get_volumes_snapshots(&self, snapshot_id: Option<&uuid::Uuid>, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result, Error>; - - -} - -/// Same as `Snapshots` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait Snapshots: Clone + Send + Sync { - - - - - async fn get_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result>; - - - - async fn del_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn get_volume_snapshots(&self, max_entries: isize, starting_token: Option, volume_id: &uuid::Uuid) -> Result>; - - - - async fn get_volumes_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result>; - - - - async fn del_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn get_volumes_snapshots(&self, snapshot_id: Option<&uuid::Uuid>, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result>; - - - } -} - -#[async_trait::async_trait] -impl direct::Snapshots for SnapshotsClient { - - - - - async fn get_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result> { - - Snapshots::get_volume_snapshot(self, volume_id, snapshot_id).await.map(|r| r.into_body()) - } - - - - async fn put_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result> { - - Snapshots::put_volume_snapshot(self, volume_id, snapshot_id).await.map(|r| r.into_body()) - } - - - - async fn del_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result<(), Error> { - - Snapshots::del_volume_snapshot(self, volume_id, snapshot_id).await.map(|r| r.into_body()) - } - - - - async fn get_volume_snapshots(&self, max_entries: isize, starting_token: Option, volume_id: &uuid::Uuid) -> Result> { - - Snapshots::get_volume_snapshots(self, max_entries, starting_token, volume_id).await.map(|r| r.into_body()) - } - - - - async fn get_volumes_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result> { - - Snapshots::get_volumes_snapshot(self, snapshot_id).await.map(|r| r.into_body()) - } - - - - async fn del_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result<(), Error> { - - Snapshots::del_snapshot(self, snapshot_id).await.map(|r| r.into_body()) - } - - - - async fn get_volumes_snapshots(&self, snapshot_id: Option<&uuid::Uuid>, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result> { - - Snapshots::get_volumes_snapshots(self, snapshot_id, volume_id, max_entries, starting_token).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl Snapshots for SnapshotsClient { - - - - - async fn get_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/snapshots/{snapshot_id}", configuration.base_path, volume_id=volume_id.to_string(), snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::VolumeSnapshot = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/snapshots/{snapshot_id}", configuration.base_path, volume_id=volume_id.to_string(), snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::VolumeSnapshot = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_volume_snapshot(&self, volume_id: &uuid::Uuid, snapshot_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/snapshots/{snapshot_id}", configuration.base_path, volume_id=volume_id.to_string(), snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_volume_snapshots(&self, max_entries: isize, starting_token: Option, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/snapshots", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - let query_params: Option = None; - - - let query_params = match query_params { - None => Some(format!("max_entries={}", max_entries.to_string())), - Some(previous) => Some(format!("{previous}&max_entries={}", max_entries.to_string())) - }; - - - - - - let query_params = if let Some(local_var_str) = starting_token { - match query_params { - None => Some(format!("starting_token={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&starting_token={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::VolumeSnapshots = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_volumes_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/snapshots/{snapshot_id}", configuration.base_path, snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::VolumeSnapshot = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_snapshot(&self, snapshot_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/snapshots/{snapshot_id}", configuration.base_path, snapshot_id=snapshot_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_volumes_snapshots(&self, snapshot_id: Option<&uuid::Uuid>, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/snapshots", configuration.base_path); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - let query_params: Option = None; - - - - let query_params = if let Some(local_var_str) = snapshot_id { - match query_params { - None => Some(format!("snapshot_id={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&snapshot_id={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - - - let query_params = if let Some(local_var_str) = volume_id { - match query_params { - None => Some(format!("volume_id={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&volume_id={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - - let query_params = match query_params { - None => Some(format!("max_entries={}", max_entries.to_string())), - Some(previous) => Some(format!("{previous}&max_entries={}", max_entries.to_string())) - }; - - - - - - let query_params = if let Some(local_var_str) = starting_token { - match query_params { - None => Some(format!("starting_token={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&starting_token={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::VolumeSnapshots = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/snapshots_api/tower/mod.rs b/testgen/src/autogen/apis/snapshots_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/snapshots_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/specs_api/actix/client/mod.rs b/testgen/src/autogen/apis/specs_api/actix/client/mod.rs deleted file mode 100644 index 6fe4c8962..000000000 --- a/testgen/src/autogen/apis/specs_api/actix/client/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct SpecsClient { - configuration: Rc, -} - -impl SpecsClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait Specs: Clone { - - - - - async fn get_specs(&self, ) -> Result>; - - -} - -#[async_trait::async_trait(?Send)] -impl Specs for SpecsClient { - - - - - async fn get_specs(&self, ) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/specs", configuration.base_path); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/specs_api/actix/mod.rs b/testgen/src/autogen/apis/specs_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/specs_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/specs_api/actix/server/handlers.rs b/testgen/src/autogen/apis/specs_api/actix/server/handlers.rs deleted file mode 100644 index 68c358655..000000000 --- a/testgen/src/autogen/apis/specs_api/actix/server/handlers.rs +++ /dev/null @@ -1,45 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - specs_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the Specs resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/specs") - .name("get_specs") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_specs::)) - ); - - -} - - - - - - - - - - - -async fn get_specs(_token: A) -> Result, RestError> { - T::get_specs().await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/specs_api/actix/server/mod.rs b/testgen/src/autogen/apis/specs_api/actix/server/mod.rs deleted file mode 100644 index c3fe71671..000000000 --- a/testgen/src/autogen/apis/specs_api/actix/server/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait Specs { - - - - - async fn get_specs() -> Result>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/specs_api/mod.rs b/testgen/src/autogen/apis/specs_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/specs_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/specs_api/tower/client/mod.rs b/testgen/src/autogen/apis/specs_api/tower/client/mod.rs deleted file mode 100644 index 2e70f1948..000000000 --- a/testgen/src/autogen/apis/specs_api/tower/client/mod.rs +++ /dev/null @@ -1,157 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct SpecsClient { - configuration: Arc, -} - -impl SpecsClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for SpecsClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait Specs: Clone + Send + Sync { - - - - - async fn get_specs(&self, ) -> Result, Error>; - - -} - -/// Same as `Specs` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait Specs: Clone + Send + Sync { - - - - - async fn get_specs(&self, ) -> Result>; - - - } -} - -#[async_trait::async_trait] -impl direct::Specs for SpecsClient { - - - - - async fn get_specs(&self, ) -> Result> { - - Specs::get_specs(self, ).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl Specs for SpecsClient { - - - - - async fn get_specs(&self, ) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/specs", configuration.base_path); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Specs = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/specs_api/tower/mod.rs b/testgen/src/autogen/apis/specs_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/specs_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/volumes_api/actix/client/mod.rs b/testgen/src/autogen/apis/volumes_api/actix/client/mod.rs deleted file mode 100644 index d342168fa..000000000 --- a/testgen/src/autogen/apis/volumes_api/actix/client/mod.rs +++ /dev/null @@ -1,934 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct VolumesClient { - configuration: Rc, -} - -impl VolumesClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait Volumes: Clone { - - - - - async fn get_volumes(&self, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result>; - - - - async fn get_volume(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn del_volume(&self, volume_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn get_rebuild_history(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume_replica_count(&self, volume_id: &uuid::Uuid, replica_count: u8) -> Result>; - - - - async fn put_volume_property(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume_target(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn del_volume_target(&self, force: Option, volume_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume_size(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn del_volume_shutdown_targets(&self, volume_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn put_volume_share(&self, frontend_host: Option<&str>, volume_id: &uuid::Uuid, protocol: &str) -> Result>; - - - - async fn del_share(&self, volume_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn put_snapshot_volume(&self, snapshot_id: &uuid::Uuid, volume_id: &uuid::Uuid) -> Result>; - - -} - -#[async_trait::async_trait(?Send)] -impl Volumes for VolumesClient { - - - - - async fn get_volumes(&self, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes", configuration.base_path); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - - if let Some(ref local_var_str) = volume_id { - query_params.push(("volume_id", local_var_str.to_string())); - } - - - - query_params.push(("max_entries", max_entries.to_string())); - - - - - - if let Some(ref local_var_str) = starting_token { - query_params.push(("starting_token", local_var_str.to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_volume(&self, volume_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_volume(&self, volume_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_volume(&self, volume_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn get_rebuild_history(&self, volume_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/rebuild-history", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_volume_replica_count(&self, volume_id: &uuid::Uuid, replica_count: u8) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/replica_count/{replica_count}", configuration.base_path, volume_id=volume_id.to_string(), replica_count=replica_count.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_volume_property(&self, volume_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/property", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_volume_target(&self, volume_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/target", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_volume_target(&self, force: Option, volume_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/target", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - - if let Some(ref local_var_str) = force { - query_params.push(("force", local_var_str.to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_volume_size(&self, volume_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/size", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_volume_shutdown_targets(&self, volume_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/shutdown_targets", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_volume_share(&self, frontend_host: Option<&str>, volume_id: &uuid::Uuid, protocol: &str) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/share/{protocol}", configuration.base_path, volume_id=volume_id.to_string(), protocol=crate::apis::urlencode(protocol)); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - - if let Some(ref local_var_str) = frontend_host { - query_params.push(("frontend_host", local_var_str.to_string())); - } - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_share(&self, volume_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/volumes{volume_id}/share", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_snapshot_volume(&self, snapshot_id: &uuid::Uuid, volume_id: &uuid::Uuid) -> Result> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/snapshots/{snapshot_id}/volumes/{volume_id}", configuration.base_path, snapshot_id=snapshot_id.to_string(), volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/volumes_api/actix/mod.rs b/testgen/src/autogen/apis/volumes_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/volumes_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/volumes_api/actix/server/handlers.rs b/testgen/src/autogen/apis/volumes_api/actix/server/handlers.rs deleted file mode 100644 index 2ff5733ca..000000000 --- a/testgen/src/autogen/apis/volumes_api/actix/server/handlers.rs +++ /dev/null @@ -1,291 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - volumes_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the Volumes resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/volumes") - .name("get_volumes") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_volumes::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}") - .name("get_volume") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_volume::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}") - .name("put_volume") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_volume::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}") - .name("del_volume") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_volume::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/rebuild-history") - .name("get_rebuild_history") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_rebuild_history::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/replica_count/{replica_count}") - .name("put_volume_replica_count") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_volume_replica_count::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/property") - .name("put_volume_property") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_volume_property::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/target") - .name("put_volume_target") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_volume_target::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/target") - .name("del_volume_target") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_volume_target::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/size") - .name("put_volume_size") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_volume_size::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/shutdown_targets") - .name("del_volume_shutdown_targets") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_volume_shutdown_targets::)) - ) - - .service( - actix_web::web::resource("/volumes/{volume_id}/share/{protocol}") - .name("put_volume_share") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_volume_share::)) - ) - - .service( - actix_web::web::resource("/volumes{volume_id}/share") - .name("del_share") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_share::)) - ) - - .service( - actix_web::web::resource("/snapshots/{snapshot_id}/volumes/{volume_id}") - .name("put_snapshot_volume") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_snapshot_volume::)) - ); - - -} - - - - -#[derive(serde::Deserialize)] -struct get_volumesQueryParams { - - - #[serde(rename = "volume_id", default, skip_serializing_if = "Option::is_none")] - pub volume_id: Option, - - - #[serde(rename = "max_entries")] - pub max_entries: isize, - - - #[serde(rename = "starting_token", default, skip_serializing_if = "Option::is_none")] - pub starting_token: Option, - -} - - - - - - - - - - - - - - - - - -#[derive(serde::Deserialize)] -struct del_volume_targetQueryParams { - - - #[serde(rename = "force", default, skip_serializing_if = "Option::is_none")] - pub force: Option, - -} - - - - - - - -#[derive(serde::Deserialize)] -struct put_volume_shareQueryParams { - - - #[serde(rename = "frontend_host", default, skip_serializing_if = "Option::is_none")] - pub frontend_host: Option, - -} - - - - - - - - - - - - -async fn get_volumes(_token: A, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::get_volumes(crate::apis::actix_server::Query(query.volume_id, query.max_entries, query.starting_token)).await.map(Json) -} - - - - -async fn get_volume(_token: A, path: Path) -> Result, RestError> { - T::get_volume(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_volume(_token: A, path: Path) -> Result, RestError> { - T::put_volume(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_volume(_token: A, path: Path) -> Result, RestError> { - T::del_volume(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn get_rebuild_history(_token: A, path: Path) -> Result, RestError> { - T::get_rebuild_history(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_volume_replica_count(_token: A, path: Path) -> Result, RestError> { - T::put_volume_replica_count(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_volume_property(_token: A, path: Path) -> Result, RestError> { - T::put_volume_property(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_volume_target(_token: A, path: Path) -> Result, RestError> { - T::put_volume_target(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_volume_target(_token: A, path: Path, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::del_volume_target(crate::apis::actix_server::Path(path.into_inner()), crate::apis::actix_server::Query(query.force)).await.map(Json) -} - - - - -async fn put_volume_size(_token: A, path: Path) -> Result, RestError> { - T::put_volume_size(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn del_volume_shutdown_targets(_token: A, path: Path) -> Result, RestError> { - T::del_volume_shutdown_targets(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_volume_share(_token: A, path: Path, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::put_volume_share(crate::apis::actix_server::Path(path.into_inner()), crate::apis::actix_server::Query(query.frontend_host)).await.map(Json) -} - - - - -async fn del_share(_token: A, path: Path) -> Result, RestError> { - T::del_share(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_snapshot_volume(_token: A, path: Path) -> Result, RestError> { - T::put_snapshot_volume(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/volumes_api/actix/server/mod.rs b/testgen/src/autogen/apis/volumes_api/actix/server/mod.rs deleted file mode 100644 index 287086789..000000000 --- a/testgen/src/autogen/apis/volumes_api/actix/server/mod.rs +++ /dev/null @@ -1,69 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait Volumes { - - - - - async fn get_volumes(Query(volume_id, max_entries, starting_token): Query, isize, Option>) -> Result>; - - - - async fn get_volume(Path(volume_id): Path) -> Result>; - - - - async fn put_volume(Path(volume_id): Path) -> Result>; - - - - async fn del_volume(Path(volume_id): Path) -> Result<(), RestError>; - - - - async fn get_rebuild_history(Path(volume_id): Path) -> Result>; - - - - async fn put_volume_replica_count(Path(volume_id, replica_count): Path) -> Result>; - - - - async fn put_volume_property(Path(volume_id): Path) -> Result>; - - - - async fn put_volume_target(Path(volume_id): Path) -> Result>; - - - - async fn del_volume_target(Path(volume_id): Path, Query(force): Query>) -> Result>; - - - - async fn put_volume_size(Path(volume_id): Path) -> Result>; - - - - async fn del_volume_shutdown_targets(Path(volume_id): Path) -> Result<(), RestError>; - - - - async fn put_volume_share(Path(volume_id, protocol): Path, Query(frontend_host): Query>) -> Result>; - - - - async fn del_share(Path(volume_id): Path) -> Result<(), RestError>; - - - - async fn put_snapshot_volume(Path(snapshot_id, volume_id): Path) -> Result>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/volumes_api/mod.rs b/testgen/src/autogen/apis/volumes_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/volumes_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/volumes_api/tower/client/mod.rs b/testgen/src/autogen/apis/volumes_api/tower/client/mod.rs deleted file mode 100644 index ead8b9b9b..000000000 --- a/testgen/src/autogen/apis/volumes_api/tower/client/mod.rs +++ /dev/null @@ -1,1482 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct VolumesClient { - configuration: Arc, -} - -impl VolumesClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for VolumesClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait Volumes: Clone + Send + Sync { - - - - - async fn get_volumes(&self, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result, Error>; - - - - async fn get_volume(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_volume(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_volume(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn get_rebuild_history(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_volume_replica_count(&self, volume_id: &uuid::Uuid, replica_count: u8) -> Result, Error>; - - - - async fn put_volume_property(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_volume_target(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_volume_target(&self, force: Option, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_volume_size(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_volume_shutdown_targets(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_volume_share(&self, frontend_host: Option<&str>, volume_id: &uuid::Uuid, protocol: &str) -> Result, Error>; - - - - async fn del_share(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_snapshot_volume(&self, snapshot_id: &uuid::Uuid, volume_id: &uuid::Uuid) -> Result, Error>; - - -} - -/// Same as `Volumes` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait Volumes: Clone + Send + Sync { - - - - - async fn get_volumes(&self, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result>; - - - - async fn get_volume(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn del_volume(&self, volume_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn get_rebuild_history(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume_replica_count(&self, volume_id: &uuid::Uuid, replica_count: u8) -> Result>; - - - - async fn put_volume_property(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume_target(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn del_volume_target(&self, force: Option, volume_id: &uuid::Uuid) -> Result>; - - - - async fn put_volume_size(&self, volume_id: &uuid::Uuid) -> Result>; - - - - async fn del_volume_shutdown_targets(&self, volume_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn put_volume_share(&self, frontend_host: Option<&str>, volume_id: &uuid::Uuid, protocol: &str) -> Result>; - - - - async fn del_share(&self, volume_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn put_snapshot_volume(&self, snapshot_id: &uuid::Uuid, volume_id: &uuid::Uuid) -> Result>; - - - } -} - -#[async_trait::async_trait] -impl direct::Volumes for VolumesClient { - - - - - async fn get_volumes(&self, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result> { - - Volumes::get_volumes(self, volume_id, max_entries, starting_token).await.map(|r| r.into_body()) - } - - - - async fn get_volume(&self, volume_id: &uuid::Uuid) -> Result> { - - Volumes::get_volume(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn put_volume(&self, volume_id: &uuid::Uuid) -> Result> { - - Volumes::put_volume(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn del_volume(&self, volume_id: &uuid::Uuid) -> Result<(), Error> { - - Volumes::del_volume(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn get_rebuild_history(&self, volume_id: &uuid::Uuid) -> Result> { - - Volumes::get_rebuild_history(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn put_volume_replica_count(&self, volume_id: &uuid::Uuid, replica_count: u8) -> Result> { - - Volumes::put_volume_replica_count(self, volume_id, replica_count).await.map(|r| r.into_body()) - } - - - - async fn put_volume_property(&self, volume_id: &uuid::Uuid) -> Result> { - - Volumes::put_volume_property(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn put_volume_target(&self, volume_id: &uuid::Uuid) -> Result> { - - Volumes::put_volume_target(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn del_volume_target(&self, force: Option, volume_id: &uuid::Uuid) -> Result> { - - Volumes::del_volume_target(self, force, volume_id).await.map(|r| r.into_body()) - } - - - - async fn put_volume_size(&self, volume_id: &uuid::Uuid) -> Result> { - - Volumes::put_volume_size(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn del_volume_shutdown_targets(&self, volume_id: &uuid::Uuid) -> Result<(), Error> { - - Volumes::del_volume_shutdown_targets(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn put_volume_share(&self, frontend_host: Option<&str>, volume_id: &uuid::Uuid, protocol: &str) -> Result> { - - Volumes::put_volume_share(self, frontend_host, volume_id, protocol).await.map(|r| r.into_body()) - } - - - - async fn del_share(&self, volume_id: &uuid::Uuid) -> Result<(), Error> { - - Volumes::del_share(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn put_snapshot_volume(&self, snapshot_id: &uuid::Uuid, volume_id: &uuid::Uuid) -> Result> { - - Volumes::put_snapshot_volume(self, snapshot_id, volume_id).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl Volumes for VolumesClient { - - - - - async fn get_volumes(&self, volume_id: Option<&uuid::Uuid>, max_entries: isize, starting_token: Option) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes", configuration.base_path); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - let query_params: Option = None; - - - - let query_params = if let Some(local_var_str) = volume_id { - match query_params { - None => Some(format!("volume_id={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&volume_id={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - - let query_params = match query_params { - None => Some(format!("max_entries={}", max_entries.to_string())), - Some(previous) => Some(format!("{previous}&max_entries={}", max_entries.to_string())) - }; - - - - - - let query_params = if let Some(local_var_str) = starting_token { - match query_params { - None => Some(format!("starting_token={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&starting_token={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Volumes = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_volume(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Volume = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_volume(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Volume = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_volume(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn get_rebuild_history(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/rebuild-history", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: serde_json::Value = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_volume_replica_count(&self, volume_id: &uuid::Uuid, replica_count: u8) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/replica_count/{replica_count}", configuration.base_path, volume_id=volume_id.to_string(), replica_count=replica_count.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Volume = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_volume_property(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/property", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Volume = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_volume_target(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/target", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Volume = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_volume_target(&self, force: Option, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/target", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - let query_params: Option = None; - - - - let query_params = if let Some(local_var_str) = force { - match query_params { - None => Some(format!("force={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&force={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Volume = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_volume_size(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/size", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Volume = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_volume_shutdown_targets(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/shutdown_targets", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_volume_share(&self, frontend_host: Option<&str>, volume_id: &uuid::Uuid, protocol: &str) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes/{volume_id}/share/{protocol}", configuration.base_path, volume_id=volume_id.to_string(), protocol=crate::apis::urlencode(protocol)); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - let query_params: Option = None; - - - - let query_params = if let Some(local_var_str) = frontend_host { - match query_params { - None => Some(format!("frontend_host={}", local_var_str.to_string())), - Some(previous) => Some(format!("{previous}&frontend_host={}", local_var_str.to_string())) - } - } else { - query_params - }; - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: String = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_share(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/volumes{volume_id}/share", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_snapshot_volume(&self, snapshot_id: &uuid::Uuid, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/snapshots/{snapshot_id}/volumes/{volume_id}", configuration.base_path, snapshot_id=snapshot_id.to_string(), volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: crate::models::Volume = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/volumes_api/tower/mod.rs b/testgen/src/autogen/apis/volumes_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/volumes_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/apis/watches_api/actix/client/mod.rs b/testgen/src/autogen/apis/watches_api/actix/client/mod.rs deleted file mode 100644 index caa909213..000000000 --- a/testgen/src/autogen/apis/watches_api/actix/client/mod.rs +++ /dev/null @@ -1,236 +0,0 @@ -#![allow(clippy::vec_init_then_push)] - -use crate::clients::actix::{ - configuration, Error, ResponseContent, ResponseContentUnexpected, -}; -use actix_web_opentelemetry::ClientExt; -use std::rc::Rc; - -#[derive(Clone)] -pub struct WatchesClient { - configuration: Rc, -} - -impl WatchesClient { - pub fn new(configuration: Rc) -> Self { - Self { - configuration, - } - } -} - -#[async_trait::async_trait(?Send)] -#[dyn_clonable::clonable] -pub trait Watches: Clone { - - - - - async fn get_watch_volume(&self, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn put_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result<(), Error>; - - - - async fn del_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result<(), Error>; - - -} - -#[async_trait::async_trait(?Send)] -impl Watches for WatchesClient { - - - - - async fn get_watch_volume(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/watches/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::GET, local_var_uri_str.as_str()); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn put_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/watches/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::PUT, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - query_params.push(("callback", callback.to_string())); - - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - - - async fn del_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result<(), Error> { - - - let configuration = &self.configuration; - let local_var_client = &configuration.client; - - let local_var_uri_str = format!("{}/watches/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = local_var_client.request(awc::http::Method::DELETE, local_var_uri_str.as_str()); - - - let mut query_params = vec![]; - - - query_params.push(("callback", callback.to_string())); - - - - local_var_req_builder = local_var_req_builder.query(&query_params)?; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.insert_header((awc::http::header::USER_AGENT, local_var_user_agent.clone())); - } - - - - - - - - let mut local_var_resp = if configuration.trace_requests { - local_var_req_builder.trace_request().send().await - } else { - local_var_req_builder.send().await - }?; - - - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let local_var_content = local_var_resp.json::<()>().await?; - Ok(local_var_content) - - - - } else { - match local_var_resp.json::().await { - Ok(error) => Err(Error::ResponseError(ResponseContent { - status: local_var_status, - error, - })), - Err(_) => Err(Error::ResponseUnexpected(ResponseContentUnexpected { - status: local_var_status, - text: local_var_resp.json().await?, - })), - } - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/watches_api/actix/mod.rs b/testgen/src/autogen/apis/watches_api/actix/mod.rs deleted file mode 100644 index 97528c6de..000000000 --- a/testgen/src/autogen/apis/watches_api/actix/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod client; -#[cfg(feature = "actix-server")] -pub mod server; \ No newline at end of file diff --git a/testgen/src/autogen/apis/watches_api/actix/server/handlers.rs b/testgen/src/autogen/apis/watches_api/actix/server/handlers.rs deleted file mode 100644 index dd93b92cb..000000000 --- a/testgen/src/autogen/apis/watches_api/actix/server/handlers.rs +++ /dev/null @@ -1,97 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::{ - actix::server::{deserialize_option_stringified_list, deserialize_stringified_list}, - apis::{ - actix_server::{Body, NoContent, RestError}, - watches_api::actix::server, - }, -}; -use actix_web::{ - web::{Json, Path, Query, ServiceConfig}, - FromRequest, HttpRequest, -}; - - -/// Configure handlers for the Watches resource -pub fn configure(cfg: &mut ServiceConfig) { - cfg - - - .service( - actix_web::web::resource("/watches/volumes/{volume_id}") - .name("get_watch_volume") - .guard(actix_web::guard::Get()) - .route(actix_web::web::get().to(get_watch_volume::)) - ) - - .service( - actix_web::web::resource("/watches/volumes/{volume_id}") - .name("put_watch_volume") - .guard(actix_web::guard::Put()) - .route(actix_web::web::put().to(put_watch_volume::)) - ) - - .service( - actix_web::web::resource("/watches/volumes/{volume_id}") - .name("del_watch_volume") - .guard(actix_web::guard::Delete()) - .route(actix_web::web::delete().to(del_watch_volume::)) - ); - - -} - - - - - - -#[derive(serde::Deserialize)] -struct put_watch_volumeQueryParams { - - - #[serde(rename = "callback")] - pub callback: String, - -} - - - -#[derive(serde::Deserialize)] -struct del_watch_volumeQueryParams { - - - #[serde(rename = "callback")] - pub callback: String, - -} - - - - - - - - -async fn get_watch_volume(_token: A, path: Path) -> Result>, RestError> { - T::get_watch_volume(crate::apis::actix_server::Path(path.into_inner())).await.map(Json) -} - - - - -async fn put_watch_volume(_token: A, path: Path, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::put_watch_volume(crate::apis::actix_server::Path(path.into_inner()), crate::apis::actix_server::Query(query.callback)).await.map(Json) -} - - - - -async fn del_watch_volume(_token: A, path: Path, query: Query) -> Result, RestError> { - let query = query.into_inner(); - T::del_watch_volume(crate::apis::actix_server::Path(path.into_inner()), crate::apis::actix_server::Query(query.callback)).await.map(Json) -} - - diff --git a/testgen/src/autogen/apis/watches_api/actix/server/mod.rs b/testgen/src/autogen/apis/watches_api/actix/server/mod.rs deleted file mode 100644 index 418540786..000000000 --- a/testgen/src/autogen/apis/watches_api/actix/server/mod.rs +++ /dev/null @@ -1,25 +0,0 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] - -use crate::apis::actix_server::{Body, Path, Query, RestError}; -use actix_web::web::Json; - -#[async_trait::async_trait] -pub trait Watches { - - - - - async fn get_watch_volume(Path(volume_id): Path) -> Result, RestError>; - - - - async fn put_watch_volume(Path(volume_id): Path, Query(callback): Query) -> Result<(), RestError>; - - - - async fn del_watch_volume(Path(volume_id): Path, Query(callback): Query) -> Result<(), RestError>; - - -} - -pub mod handlers; \ No newline at end of file diff --git a/testgen/src/autogen/apis/watches_api/mod.rs b/testgen/src/autogen/apis/watches_api/mod.rs deleted file mode 100644 index a1e0ccc37..000000000 --- a/testgen/src/autogen/apis/watches_api/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(feature = "actix")] -pub mod actix; -#[cfg(feature = "tower-hyper")] -pub mod tower; \ No newline at end of file diff --git a/testgen/src/autogen/apis/watches_api/tower/client/mod.rs b/testgen/src/autogen/apis/watches_api/tower/client/mod.rs deleted file mode 100644 index 1bdcbb347..000000000 --- a/testgen/src/autogen/apis/watches_api/tower/client/mod.rs +++ /dev/null @@ -1,379 +0,0 @@ -#![allow(clippy::to_string_in_format_args)] - -use crate::clients::tower::{ - configuration, Error, RequestError, ResponseContent, ResponseContentUnexpected, ResponseError, -}; - -use hyper::service::Service; -use std::sync::Arc; -use tower::ServiceExt; - -pub struct WatchesClient { - configuration: Arc, -} - -impl WatchesClient { - pub fn new(configuration: Arc) -> Self { - Self { - configuration, - } - } -} -impl Clone for WatchesClient { - fn clone(&self) -> Self { - Self { - configuration: self.configuration.clone() - } - } -} - -#[async_trait::async_trait] -#[dyn_clonable::clonable] -pub trait Watches: Clone + Send + Sync { - - - - - async fn get_watch_volume(&self, volume_id: &uuid::Uuid) -> Result>, Error>; - - - - async fn put_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result, Error>; - - - - async fn del_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result, Error>; - - -} - -/// Same as `Watches` but it returns the result body directly. -pub mod direct { - #[async_trait::async_trait] - #[dyn_clonable::clonable] - pub trait Watches: Clone + Send + Sync { - - - - - async fn get_watch_volume(&self, volume_id: &uuid::Uuid) -> Result, super::Error>; - - - - async fn put_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result<(), super::Error>; - - - - async fn del_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result<(), super::Error>; - - - } -} - -#[async_trait::async_trait] -impl direct::Watches for WatchesClient { - - - - - async fn get_watch_volume(&self, volume_id: &uuid::Uuid) -> Result, Error> { - - Watches::get_watch_volume(self, volume_id).await.map(|r| r.into_body()) - } - - - - async fn put_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result<(), Error> { - - Watches::put_watch_volume(self, callback, volume_id).await.map(|r| r.into_body()) - } - - - - async fn del_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result<(), Error> { - - Watches::del_watch_volume(self, callback, volume_id).await.map(|r| r.into_body()) - } - - -} - -#[async_trait::async_trait] -impl Watches for WatchesClient { - - - - - async fn get_watch_volume(&self, volume_id: &uuid::Uuid) -> Result>, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/watches/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::GET); - - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: Vec = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn put_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/watches/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::PUT); - - - let query_params: Option = None; - - - let query_params = match query_params { - None => Some(format!("callback={}", callback.to_string())), - Some(previous) => Some(format!("{previous}&callback={}", callback.to_string())) - }; - - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - - - async fn del_watch_volume(&self, callback: &str, volume_id: &uuid::Uuid) -> Result, Error> { - - let configuration = &self.configuration; - - let local_var_uri_str = format!("{}/watches/volumes/{volume_id}", configuration.base_path, volume_id=volume_id.to_string()); - let mut local_var_req_builder = hyper::Request::builder().method(hyper::Method::DELETE); - - - let query_params: Option = None; - - - let query_params = match query_params { - None => Some(format!("callback={}", callback.to_string())), - Some(previous) => Some(format!("{previous}&callback={}", callback.to_string())) - }; - - - - let local_var_uri_str = match query_params { - None => local_var_uri_str, - Some(params) => format!("{local_var_uri_str}?{params}") - }; - - - - - if let Some(ref local_var_user_agent) = configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(hyper::header::USER_AGENT, local_var_user_agent.clone()); - } - - - - - - - - let body = hyper::Body::empty(); - - let request = local_var_req_builder.uri(local_var_uri_str).header("content-type", "application/json").body(body).map_err(RequestError::BuildRequest)?; - - let local_var_resp = { - let mut client_service = configuration.client_service.lock().await.clone(); - client_service - .ready() - .await - .map_err(RequestError::NotReady)? - .call(request) - .await - .map_err(RequestError::Request)? - }; - let local_var_status = local_var_resp.status(); - - if local_var_status.is_success() { - - - - let body = hyper::body::to_bytes(local_var_resp.into_body()).await.map_err(|e| ResponseError::PayloadError { - status: local_var_status, - error: e, - })?; - let local_var_content: () = - serde_json::from_slice(&body).map_err(|e| { - ResponseError::Unexpected(ResponseContentUnexpected { - status: local_var_status, - text: e.to_string(), - }) - })?; - Ok(ResponseContent { status: local_var_status, body: local_var_content }) - - - - } else { - match hyper::body::to_bytes(local_var_resp.into_body()).await { - Ok(body) => match serde_json::from_slice::(&body) { - Ok(error) => Err(Error::Response(ResponseError::Expected(ResponseContent { - status: local_var_status, - body: error, - }))), - Err(_) => Err(Error::Response(ResponseError::Unexpected( - ResponseContentUnexpected { - status: local_var_status, - text: String::from_utf8_lossy(&body).to_string(), - }, - ))), - }, - Err(error) => Err(Error::Response(ResponseError::PayloadError { - status: local_var_status, - error, - })), - } - - } - } - - -} \ No newline at end of file diff --git a/testgen/src/autogen/apis/watches_api/tower/mod.rs b/testgen/src/autogen/apis/watches_api/tower/mod.rs deleted file mode 100644 index 1b623f849..000000000 --- a/testgen/src/autogen/apis/watches_api/tower/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "tower-client")] -pub mod client; \ No newline at end of file diff --git a/testgen/src/autogen/clients/mod.rs b/testgen/src/autogen/clients/mod.rs deleted file mode 100644 index 3ee07f2de..000000000 --- a/testgen/src/autogen/clients/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[cfg(feature = "actix-client")] -pub mod actix; -#[cfg(feature = "tower-client")] -pub mod tower; - -// Enable once we move to rust-2021 -// #[cfg(all(feature = "tower-client-rls", feature = "tower-client-tls"))] -// compile_error!("feature \"tower-client-rls\" and feature \"tower-client-tls\" cannot be enabled -// at the same time"); \ No newline at end of file diff --git a/testgen/src/autogen/clients/tower/body.rs b/testgen/src/autogen/clients/tower/body.rs deleted file mode 100644 index a13bd7c75..000000000 --- a/testgen/src/autogen/clients/tower/body.rs +++ /dev/null @@ -1,46 +0,0 @@ -//! Kube-builder convertion from `tower_http::trace::ResponseBody` to `hyper::Body` -//! - -use std::{ - pin::Pin, - task::{Context, Poll}, -}; - -use futures::stream::Stream; -use http_body::Body; -use pin_project::pin_project; - -// Wrap `http_body::Body` to implement `Stream`. -#[pin_project] -pub struct IntoStream { - #[pin] - body: B, -} - -impl IntoStream { - pub(crate) fn new(body: B) -> Self { - Self { body } - } -} - -impl Stream for IntoStream -where - B: Body, -{ - type Item = Result; - - fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - self.project().body.poll_data(cx) - } -} - -pub trait BodyStreamExt: Body { - fn into_stream(self) -> IntoStream - where - Self: Sized, - { - IntoStream::new(self) - } -} - -impl BodyStreamExt for T where T: Body {} \ No newline at end of file diff --git a/testgen/src/autogen/clients/tower/configuration.rs b/testgen/src/autogen/clients/tower/configuration.rs deleted file mode 100644 index c7cac2cd4..000000000 --- a/testgen/src/autogen/clients/tower/configuration.rs +++ /dev/null @@ -1,485 +0,0 @@ -#![allow(clippy::type_complexity)] -use super::body::BodyStreamExt; - -pub use hyper::{body, service::Service, Body, Request, Response, Uri}; - -use std::{sync::Arc, time::Duration}; -use tokio::sync::Mutex; -use tower::{util::BoxCloneService, Layer, ServiceExt}; - -#[cfg(feature = "tower-trace")] -use opentelemetry::global; -#[cfg(feature = "tower-trace")] -use opentelemetry_http::HeaderInjector; - -#[cfg(all(feature = "tower-client-rls", not(feature = "tower-client-tls")))] -use rustls::{ - client::{ServerCertVerified, ServerCertVerifier}, - Certificate, Error as TLSError, -}; - -use tower_http::map_response_body::MapResponseBodyLayer; -#[cfg(feature = "tower-trace")] -use tower_http::{classify::ServerErrorsFailureClass, trace::TraceLayer}; - -#[cfg(feature = "tower-trace")] -use tracing::Span; -#[cfg(feature = "tower-trace")] -use tracing_opentelemetry::OpenTelemetrySpanExt; - -/// Tower Service Error -pub type BoxedError = Box; - -/// `ConfigurationBuilder` that can be used to build a `Configuration`. -#[derive(Clone)] -pub struct ConfigurationBuilder { - /// Timeout for each HTTP Request. - timeout: Option, - /// Bearer Access Token for bearer-configured routes. - bearer_token: Option, - /// OpenTel and Tracing layer. - #[cfg(feature = "tower-trace")] - tracing_layer: bool, - certificate: Option>, - concurrency_limit: Option, -} - -impl Default for ConfigurationBuilder { - fn default() -> Self { - Self { - timeout: Some(std::time::Duration::from_secs(5)), - bearer_token: None, - #[cfg(feature = "tower-trace")] - tracing_layer: true, - certificate: None, - concurrency_limit: None, - } - } -} - -impl ConfigurationBuilder { - /// Return a new `Self`. - pub fn new() -> Self { - Self::default() - } - /// Enable/Disable a request timeout layer with the given request timeout. - pub fn with_timeout>>(mut self, timeout: O) -> Self { - self.timeout = timeout.into(); - self - } - /// Enable/Disable the given request bearer token. - pub fn with_bearer_token(mut self, bearer_token: Option) -> Self { - self.bearer_token = bearer_token; - self - } - /// Add a request concurrency limit. - pub fn with_concurrency_limit(mut self, limit: Option) -> Self { - self.concurrency_limit = limit; - self - } - /// Add a PEM-format certificate file. - pub fn with_certificate(mut self, certificate: &[u8]) -> Self { - self.certificate = Some(certificate.to_vec()); - self - } - /// Enable/Disable the telemetry and tracing layer. - #[cfg(feature = "tower-trace")] - pub fn with_tracing(mut self, tracing_layer: bool) -> Self { - self.tracing_layer = tracing_layer; - self - } - /// Build a `Configuration` from the Self parameters. - pub fn build(self, uri: hyper::Uri) -> Result { - Configuration::new( - uri.to_string().parse().map_err(Error::UriToUrl)?, - self.timeout.unwrap(), - self.bearer_token, - self.certificate.as_ref().map(|c| &c[..]), - self.tracing_layer, - self.concurrency_limit, - ) - } - /// Build a `Configuration` from the Self parameters. - pub fn build_url(self, url: url::Url) -> Result { - Configuration::new( - url, - self.timeout.unwrap_or_else(|| Duration::from_secs(5)), - self.bearer_token, - self.certificate.as_ref().map(|c| &c[..]), - self.tracing_layer, - self.concurrency_limit, - ) - } - /// Build a `Configuration` from the Self parameters. - pub fn build_with_svc( - self, - uri: hyper::Uri, - client_service: S, - ) -> Result - where - S: Service, Response = Response> + Sync + Send + Clone + 'static, - S::Future: Send + 'static, - S::Error: Into + std::fmt::Debug, - { - #[cfg(feature = "tower-trace")] - let tracing_layer = self.tracing_layer; - #[cfg(not(feature = "tower-trace"))] - let tracing_layer = false; - Configuration::new_with_client( - uri, - client_service, - self.timeout, - self.bearer_token, - tracing_layer, - self.concurrency_limit, - ) - } -} - -/// Configuration used by the `ApiClient`. -#[derive(Clone)] -pub struct Configuration { - pub base_path: hyper::Uri, - pub user_agent: Option, - pub client_service: Arc, Response, BoxedError>>>, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -/// Basic authentication. -pub type BasicAuth = (String, Option); - -/// ApiKey used for ApiKey authentication. -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - -/// Configuration creation Error. -#[derive(Debug)] -pub enum Error { - Certificate, - TlsConnector, - NoTracingFeature, - UrlToUri(hyper::http::uri::InvalidUri), - UriToUrl(url::ParseError), - AddingVersionPath(hyper::http::uri::InvalidUri), -} - -impl Configuration { - /// Return a new `ConfigurationBuilder`. - pub fn builder() -> ConfigurationBuilder { - ConfigurationBuilder::new() - } - - /// New `Self` with a provided client. - pub fn new_with_client( - mut url: hyper::Uri, - client_service: S, - timeout: Option, - bearer_access_token: Option, - trace_requests: bool, - concurrency_limit: Option, - ) -> Result - where - S: Service, Response = Response> + Sync + Send + Clone + 'static, - S::Future: Send + 'static, - S::Error: Into + std::fmt::Debug, - { - #[cfg(feature = "tower-trace")] - let tracing_layer = tower::ServiceBuilder::new() - .layer( - TraceLayer::new_for_http() - .make_span_with(|request: &Request| { - tracing::info_span!( - "HTTP", - http.method = %request.method(), - http.url = %request.uri(), - http.status_code = tracing::field::Empty, - otel.name = %format!("{} {}", request.method(), request.uri()), - otel.kind = "client", - otel.status_code = tracing::field::Empty, - ) - }) - // to silence the default trace - .on_request(|request: &Request, _span: &Span| { - tracing::trace!("started {} {}", request.method(), request.uri().path()) - }) - .on_response( - |response: &Response, _latency: std::time::Duration, span: &Span| { - let status = response.status(); - span.record("http.status_code", status.as_u16()); - if status.is_client_error() || status.is_server_error() { - span.record("otel.status_code", "ERROR"); - } - }, - ) - .on_body_chunk(()) - .on_failure( - |ec: ServerErrorsFailureClass, - _latency: std::time::Duration, - span: &Span| { - span.record("otel.status_code", "ERROR"); - match ec { - ServerErrorsFailureClass::StatusCode(status) => { - span.record("http.status_code", status.as_u16()); - tracing::debug!(status=%status, "failed to issue request") - } - ServerErrorsFailureClass::Error(err) => { - tracing::debug!(error=%err, "failed to issue request") - } - } - }, - ), - ) - // injects the telemetry context in the http headers - .layer(OpenTelContext::new()) - .into_inner(); - - url = format!("{}/v0", url.to_string().trim_end_matches('/')) - .parse() - .map_err(Error::AddingVersionPath)?; - - let backend_service = tower::ServiceBuilder::new() - .option_layer(timeout.map(tower::timeout::TimeoutLayer::new)) - // .option_layer( - // bearer_access_token.map(|b| tower_http::auth::AddAuthorizationLayer::bearer(&b)), - // ) - .service(client_service); - - let service_builder = tower::ServiceBuilder::new() - .option_layer(concurrency_limit.map(tower::limit::ConcurrencyLimitLayer::new)); - - match trace_requests { - false => Ok(Self::new_with_client_inner( - url, - service_builder.service(backend_service), - bearer_access_token, - )), - true => { - #[cfg(feature = "tower-trace")] - let result = Ok(Self::new_with_client_inner( - url, - service_builder - .layer(tracing_layer) - .service(backend_service), - bearer_access_token, - )); - #[cfg(not(feature = "tower-trace"))] - let result = Err(Error::NoTracingFeature {}); - result - } - } - } - - /// New `Self`. - pub fn new( - mut url: url::Url, - timeout: std::time::Duration, - bearer_access_token: Option, - certificate: Option<&[u8]>, - trace_requests: bool, - concurrency_limit: Option, - ) -> Result { - #[cfg(all(not(feature = "tower-client-tls"), feature = "tower-client-rls"))] - let client = { - match certificate { - None => { - let mut http = hyper::client::HttpConnector::new(); - - let tls = match url.scheme() == "https" { - true => { - http.enforce_http(false); - rustls::ClientConfig::builder() - .with_safe_defaults() - .with_custom_certificate_verifier(std::sync::Arc::new( - DisableServerCertVerifier {}, - )) - .with_no_client_auth() - } - false => rustls::ClientConfig::builder() - .with_safe_defaults() - .with_root_certificates(rustls::RootCertStore::empty()) - .with_no_client_auth(), - }; - - let connector = - hyper_rustls::HttpsConnector::from((http, std::sync::Arc::new(tls))); - hyper::Client::builder().build(connector) - } - Some(bytes) => { - let mut cert_file = std::io::BufReader::new(bytes); - let mut root_store = rustls::RootCertStore::empty(); - root_store.add_parsable_certificates( - &rustls_pemfile::certs(&mut cert_file).map_err(|_| Error::Certificate)?, - ); - let config = rustls::ClientConfig::builder() - .with_safe_defaults() - .with_root_certificates(root_store) - .with_no_client_auth(); - - let mut http = hyper::client::HttpConnector::new(); - http.enforce_http(false); - let connector = - hyper_rustls::HttpsConnector::from((http, std::sync::Arc::new(config))); - url.set_scheme("https").ok(); - hyper::Client::builder().build(connector) - } - } - }; - #[cfg(feature = "tower-client-tls")] - let client = { - match certificate { - None => { - let mut http = hyper_tls::HttpsConnector::new(); - if url.scheme() == "https" { - http.https_only(true); - } - - let tls = hyper_tls::native_tls::TlsConnector::builder() - .danger_accept_invalid_certs(true) - .build() - .map_err(|_| Error::TlsConnector)?; - let tls = tokio_native_tls::TlsConnector::from(tls); - - let connector = hyper_tls::HttpsConnector::from((http, tls)); - hyper::Client::builder().build(connector) - } - Some(bytes) => { - let certificate = hyper_tls::native_tls::Certificate::from_pem(bytes) - .map_err(|_| Error::Certificate)?; - - let tls = hyper_tls::native_tls::TlsConnector::builder() - .add_root_certificate(certificate) - .danger_accept_invalid_hostnames(true) - .disable_built_in_roots(true) - .build() - .map_err(|_| Error::TlsConnector)?; - let tls = tokio_native_tls::TlsConnector::from(tls); - - let mut http = hyper_tls::HttpsConnector::new(); - http.https_only(true); - let connector = hyper_tls::HttpsConnector::from((http, tls)); - url.set_scheme("https").ok(); - hyper::Client::builder().build(connector) - } - } - }; - - let uri = url.to_string().parse().map_err(Error::UrlToUri)?; - Self::new_with_client( - uri, - client, - Some(timeout), - bearer_access_token, - trace_requests, - concurrency_limit, - ) - } - - /// New `Self` with a provided client. - pub fn new_with_client_inner( - url: hyper::Uri, - client_service: S, - bearer_access_token: Option, - ) -> Self - where - S: Service, Response = Response> + Sync + Send + Clone + 'static, - S::Future: Send + 'static, - S::Error: Into + std::fmt::Debug, - B: http_body::Body + Send + 'static, - B::Error: std::error::Error + Send + Sync + 'static, - { - // Transform response body to `hyper::Body` and use type erased error to avoid type - // parameters. - let client_service = MapResponseBodyLayer::new(|b: B| Body::wrap_stream(b.into_stream())) - .layer(client_service) - .map_err(|e| e.into()); - let client_service = Arc::new(Mutex::new(BoxCloneService::new(client_service))); - Self { - base_path: url, - user_agent: None, - client_service, - basic_auth: None, - oauth_access_token: None, - bearer_access_token, - api_key: None, - } - } -} - -/// Add OpenTelemetry Span to the Http Headers. -#[cfg(feature = "tower-trace")] -pub struct OpenTelContext {} -#[cfg(feature = "tower-trace")] -impl OpenTelContext { - fn new() -> Self { - Self {} - } -} -#[cfg(feature = "tower-trace")] -impl Layer for OpenTelContext { - type Service = OpenTelContextService; - - fn layer(&self, service: S) -> Self::Service { - OpenTelContextService::new(service) - } -} - -/// OpenTelemetry Service that injects the current span into the Http Headers. -#[cfg(feature = "tower-trace")] -#[derive(Clone)] -pub struct OpenTelContextService { - service: S, -} -#[cfg(feature = "tower-trace")] -impl OpenTelContextService { - fn new(service: S) -> Self { - Self { service } - } -} - -#[cfg(feature = "tower-trace")] -impl Service> for OpenTelContextService -where - S: Service>, -{ - type Response = S::Response; - type Error = S::Error; - type Future = S::Future; - - fn poll_ready( - &mut self, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - self.service.poll_ready(cx) - } - - fn call(&mut self, mut request: hyper::Request) -> Self::Future { - let cx = tracing::Span::current().context(); - global::get_text_map_propagator(|propagator| { - propagator.inject_context(&cx, &mut HeaderInjector(request.headers_mut())) - }); - self.service.call(request) - } -} - -#[cfg(all(feature = "tower-client-rls", not(feature = "tower-client-tls")))] -struct DisableServerCertVerifier {} -#[cfg(all(feature = "tower-client-rls", not(feature = "tower-client-tls")))] -impl ServerCertVerifier for DisableServerCertVerifier { - fn verify_server_cert( - &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], - _server_name: &rustls::ServerName, - _scts: &mut dyn Iterator, - _ocsp_response: &[u8], - _now: std::time::SystemTime, - ) -> Result { - Ok(ServerCertVerified::assertion()) - } -} \ No newline at end of file diff --git a/testgen/src/autogen/clients/tower/mod.rs b/testgen/src/autogen/clients/tower/mod.rs deleted file mode 100644 index d1376e02c..000000000 --- a/testgen/src/autogen/clients/tower/mod.rs +++ /dev/null @@ -1,688 +0,0 @@ -mod body; -pub mod configuration; - -use configuration::BoxedError; -pub use configuration::Configuration; -pub use hyper::{self, StatusCode, Uri}; -pub use url::Url; - -use std::{error, fmt, ops::Deref, sync::Arc}; - -#[derive(Clone)] -pub struct ApiClient { - - - - app_nodes_api: Box, - - - - block_devices_api: Box, - - - - children_api: Box, - - - - json_grpc_api: Box, - - - - nexuses_api: Box, - - - - nodes_api: Box, - - - - pools_api: Box, - - - - replicas_api: Box, - - - - snapshots_api: Box, - - - - specs_api: Box, - - - - volumes_api: Box, - - - - watches_api: Box, - - - -} - -/// Same as `ApiClient` but returns the body directly. -pub mod direct { - #[derive(Clone)] - pub struct ApiClient { - - - - app_nodes_api: Box, - - - - block_devices_api: Box, - - - - children_api: Box, - - - - json_grpc_api: Box, - - - - nexuses_api: Box, - - - - nodes_api: Box, - - - - pools_api: Box, - - - - replicas_api: Box, - - - - snapshots_api: Box, - - - - specs_api: Box, - - - - volumes_api: Box, - - - - watches_api: Box, - - - - } - - impl ApiClient { - pub fn new(configuration: super::Configuration) -> ApiClient { - let rc = super::Arc::new(configuration); - - ApiClient { - - - - - app_nodes_api: Box::new(crate::apis::app_nodes_api::tower::client::AppNodesClient::new(rc.clone())), - - - - - - - block_devices_api: Box::new(crate::apis::block_devices_api::tower::client::BlockDevicesClient::new(rc.clone())), - - - - - - - children_api: Box::new(crate::apis::children_api::tower::client::ChildrenClient::new(rc.clone())), - - - - - - - json_grpc_api: Box::new(crate::apis::json_grpc_api::tower::client::JsonGrpcClient::new(rc.clone())), - - - - - - - nexuses_api: Box::new(crate::apis::nexuses_api::tower::client::NexusesClient::new(rc.clone())), - - - - - - - nodes_api: Box::new(crate::apis::nodes_api::tower::client::NodesClient::new(rc.clone())), - - - - - - - pools_api: Box::new(crate::apis::pools_api::tower::client::PoolsClient::new(rc.clone())), - - - - - - - replicas_api: Box::new(crate::apis::replicas_api::tower::client::ReplicasClient::new(rc.clone())), - - - - - - - snapshots_api: Box::new(crate::apis::snapshots_api::tower::client::SnapshotsClient::new(rc.clone())), - - - - - - - specs_api: Box::new(crate::apis::specs_api::tower::client::SpecsClient::new(rc.clone())), - - - - - - - volumes_api: Box::new(crate::apis::volumes_api::tower::client::VolumesClient::new(rc.clone())), - - - - - - - - watches_api: Box::new(crate::apis::watches_api::tower::client::WatchesClient::new(rc)), - - - - - } - } - - - - - pub fn app_nodes_api(&self) -> &dyn crate::apis::app_nodes_api::tower::client::direct::AppNodes { - self.app_nodes_api.as_ref() - } - - - - pub fn block_devices_api(&self) -> &dyn crate::apis::block_devices_api::tower::client::direct::BlockDevices { - self.block_devices_api.as_ref() - } - - - - pub fn children_api(&self) -> &dyn crate::apis::children_api::tower::client::direct::Children { - self.children_api.as_ref() - } - - - - pub fn json_grpc_api(&self) -> &dyn crate::apis::json_grpc_api::tower::client::direct::JsonGrpc { - self.json_grpc_api.as_ref() - } - - - - pub fn nexuses_api(&self) -> &dyn crate::apis::nexuses_api::tower::client::direct::Nexuses { - self.nexuses_api.as_ref() - } - - - - pub fn nodes_api(&self) -> &dyn crate::apis::nodes_api::tower::client::direct::Nodes { - self.nodes_api.as_ref() - } - - - - pub fn pools_api(&self) -> &dyn crate::apis::pools_api::tower::client::direct::Pools { - self.pools_api.as_ref() - } - - - - pub fn replicas_api(&self) -> &dyn crate::apis::replicas_api::tower::client::direct::Replicas { - self.replicas_api.as_ref() - } - - - - pub fn snapshots_api(&self) -> &dyn crate::apis::snapshots_api::tower::client::direct::Snapshots { - self.snapshots_api.as_ref() - } - - - - pub fn specs_api(&self) -> &dyn crate::apis::specs_api::tower::client::direct::Specs { - self.specs_api.as_ref() - } - - - - pub fn volumes_api(&self) -> &dyn crate::apis::volumes_api::tower::client::direct::Volumes { - self.volumes_api.as_ref() - } - - - - pub fn watches_api(&self) -> &dyn crate::apis::watches_api::tower::client::direct::Watches { - self.watches_api.as_ref() - } - - - - } -} - -impl ApiClient { - pub fn new(configuration: Configuration) -> ApiClient { - let rc = Arc::new(configuration); - - ApiClient { - - - - - app_nodes_api: Box::new(crate::apis::app_nodes_api::tower::client::AppNodesClient::new(rc.clone())), - - - - - - - block_devices_api: Box::new(crate::apis::block_devices_api::tower::client::BlockDevicesClient::new(rc.clone())), - - - - - - - children_api: Box::new(crate::apis::children_api::tower::client::ChildrenClient::new(rc.clone())), - - - - - - - json_grpc_api: Box::new(crate::apis::json_grpc_api::tower::client::JsonGrpcClient::new(rc.clone())), - - - - - - - nexuses_api: Box::new(crate::apis::nexuses_api::tower::client::NexusesClient::new(rc.clone())), - - - - - - - nodes_api: Box::new(crate::apis::nodes_api::tower::client::NodesClient::new(rc.clone())), - - - - - - - pools_api: Box::new(crate::apis::pools_api::tower::client::PoolsClient::new(rc.clone())), - - - - - - - replicas_api: Box::new(crate::apis::replicas_api::tower::client::ReplicasClient::new(rc.clone())), - - - - - - - snapshots_api: Box::new(crate::apis::snapshots_api::tower::client::SnapshotsClient::new(rc.clone())), - - - - - - - specs_api: Box::new(crate::apis::specs_api::tower::client::SpecsClient::new(rc.clone())), - - - - - - - volumes_api: Box::new(crate::apis::volumes_api::tower::client::VolumesClient::new(rc.clone())), - - - - - - - - watches_api: Box::new(crate::apis::watches_api::tower::client::WatchesClient::new(rc)), - - - - - } - } - - - - - pub fn app_nodes_api(&self) -> &dyn crate::apis::app_nodes_api::tower::client::AppNodes { - self.app_nodes_api.as_ref() - } - - - - pub fn block_devices_api(&self) -> &dyn crate::apis::block_devices_api::tower::client::BlockDevices { - self.block_devices_api.as_ref() - } - - - - pub fn children_api(&self) -> &dyn crate::apis::children_api::tower::client::Children { - self.children_api.as_ref() - } - - - - pub fn json_grpc_api(&self) -> &dyn crate::apis::json_grpc_api::tower::client::JsonGrpc { - self.json_grpc_api.as_ref() - } - - - - pub fn nexuses_api(&self) -> &dyn crate::apis::nexuses_api::tower::client::Nexuses { - self.nexuses_api.as_ref() - } - - - - pub fn nodes_api(&self) -> &dyn crate::apis::nodes_api::tower::client::Nodes { - self.nodes_api.as_ref() - } - - - - pub fn pools_api(&self) -> &dyn crate::apis::pools_api::tower::client::Pools { - self.pools_api.as_ref() - } - - - - pub fn replicas_api(&self) -> &dyn crate::apis::replicas_api::tower::client::Replicas { - self.replicas_api.as_ref() - } - - - - pub fn snapshots_api(&self) -> &dyn crate::apis::snapshots_api::tower::client::Snapshots { - self.snapshots_api.as_ref() - } - - - - pub fn specs_api(&self) -> &dyn crate::apis::specs_api::tower::client::Specs { - self.specs_api.as_ref() - } - - - - pub fn volumes_api(&self) -> &dyn crate::apis::volumes_api::tower::client::Volumes { - self.volumes_api.as_ref() - } - - - - pub fn watches_api(&self) -> &dyn crate::apis::watches_api::tower::client::Watches { - self.watches_api.as_ref() - } - - - -} - -/// Http Response with status and body. -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub(crate) status: hyper::StatusCode, - pub(crate) body: T, -} -impl ResponseContent { - /// Get the status code. - pub fn status(&self) -> hyper::StatusCode { - self.status - } - /// Get a reference to the body. - pub fn body(&self) -> &T { - &self.body - } - /// Convert self into the body. - pub fn into_body(self) -> T { - self.body - } - /// Convert ResponseContent into ResponseContent>. - pub fn with_vec_body(self) -> ResponseContent> { - ResponseContent { - status: self.status, - body: vec![self.body] - } - } -} - -/// Http Response with status and body as text (could not be coerced into the expected type). -#[derive(Debug, Clone)] -pub struct ResponseContentUnexpected { - pub(crate) status: hyper::StatusCode, - pub(crate) text: String, -} -impl ResponseContentUnexpected { - /// Get the status code. - pub fn status(&self) -> hyper::StatusCode { - self.status - } - /// Get a reference to the text. - pub fn text(&self) -> &str { - self.text.as_ref() - } -} - -/// Error type for all Requests with the various variants. -#[derive(Debug)] -pub enum Error { - Request(RequestError), - Response(ResponseError), -} -impl Error { - /// Get the request error, if that is the case. - pub fn request(&self) -> Option<&RequestError> { - match self { - Error::Request(request) => Some(request), - Error::Response(_) => None, - } - } - /// Get the response error, if that is the case. - pub fn response(&self) -> Option<&ResponseError> { - match self { - Error::Request(_) => None, - Error::Response(response) => Some(response), - } - } - /// Get the expected error, if received. - pub fn expected(&self) -> Option<&ResponseContent> { - match self { - Error::Request(_) => None, - Error::Response(response) => response.expected(), - } - } - /// Get the inner body error, if expected. - pub fn error_body(&self) -> Option<&T> { - match self { - Error::Request(_) => None, - Error::Response(response) => response.error_body(), - } - } - /// Get the response status code, if any received. - pub fn status(&self) -> Option { - self.response().map(|response| response.status()) - } -} -impl From for Error { - fn from(src: RequestError) -> Self { - Self::Request(src) - } -} -impl From> for Error { - fn from(src: ResponseError) -> Self { - Self::Response(src) - } -} -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Error::Request(r) => r.fmt(f), - Error::Response(r) => r.fmt(f), - } - } -} -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - match self { - Error::Request(r) => r.source(), - Error::Response(r) => r.source(), - } - } -} - -/// Failed to issue the request. -#[derive(Debug)] -pub enum RequestError { - /// Failed to build the http request. - BuildRequest(hyper::http::Error), - /// Service Request call returned an error. - Request(BoxedError), - /// Service was not ready to process the request. - NotReady(BoxedError), - /// Failed to serialize request payload. - Serde(serde_json::Error), - /// Failed to encode the url path. - SerdeEncoded(serde_urlencoded::ser::Error), -} -impl fmt::Display for RequestError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - RequestError::BuildRequest(e) => ("build_request", e.to_string()), - RequestError::Request(e) => ("request", e.to_string()), - RequestError::NotReady(e) => ("not_ready", e.to_string()), - RequestError::Serde(e) => ("serde", e.to_string()), - RequestError::SerdeEncoded(e) => ("serde_encoding", e.to_string()), - }; - write!(f, "error in {module}: {e}") - } -} -impl error::Error for RequestError { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - RequestError::BuildRequest(e) => e, - RequestError::Request(e) => e.deref(), - RequestError::NotReady(e) => e.deref(), - RequestError::Serde(e) => e, - RequestError::SerdeEncoded(e) => e, - }) - } -} - -/// Error type for all Requests with the various variants. -#[derive(Debug)] -pub enum ResponseError { - /// The OpenAPI call returned the "expected" OpenAPI JSON content. - Expected(ResponseContent), - /// Failed to convert the response payload to bytes. - PayloadError { - status: hyper::StatusCode, - error: hyper::Error, - }, - /// The OpenAPI call returned an "unexpected" JSON content. - Unexpected(ResponseContentUnexpected), -} -impl fmt::Display for ResponseError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - ResponseError::Expected(e) => ( - "response", - format!("status code '{}', content: '{:?}'", e.status, e.body), - ), - ResponseError::PayloadError { status, error } => ( - "response", - format!("status code '{status}', error: '{error:?}'"), - ), - ResponseError::Unexpected(e) => ( - "response", - format!("status code '{}', text '{}'", e.status, e.text), - ), - }; - write!(f, "error in {module}: {e}") - } -} -impl error::Error for ResponseError { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - match self { - ResponseError::Expected(_) => None, - ResponseError::PayloadError { error, .. } => Some(error), - ResponseError::Unexpected(_) => None, - } - } -} -impl ResponseError { - /// Get the inner status. - pub fn status(&self) -> StatusCode { - match self { - ResponseError::Expected(expected) => expected.status, - ResponseError::PayloadError { status, .. } => *status, - ResponseError::Unexpected(unexpected) => unexpected.status, - } - } - /// Get the expected error, if received. - pub fn expected(&self) -> Option<&ResponseContent> { - match self { - ResponseError::Expected(expected) => Some(expected), - _ => None, - } - } - /// Get the inner body error, if expected. - pub fn error_body(&self) -> Option<&T> { - match self { - ResponseError::Expected(expected) => Some(&expected.body), - _ => None, - } - } -} - -impl std::fmt::Debug for ApiClient { - fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> fmt::Result { - fmt::Result::Ok(()) - } -} \ No newline at end of file diff --git a/testgen/src/autogen/docs/apis/AppNodes.md b/testgen/src/autogen/docs/apis/AppNodes.md deleted file mode 100644 index a2ddfcba5..000000000 --- a/testgen/src/autogen/docs/apis/AppNodes.md +++ /dev/null @@ -1,140 +0,0 @@ -# AppNodes - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_app_nodes**](AppNodes.md#get_app_nodes) | **Get** /app-nodes | -[**get_app_node**](AppNodes.md#get_app_node) | **Get** /app-nodes/{app_node_id} | -[**register_app_node**](AppNodes.md#register_app_node) | **Put** /app-nodes/{app_node_id} | -[**deregister_app_node**](AppNodes.md#deregister_app_node) | **Delete** /app-nodes/{app_node_id} | - - - - - -## get_app_nodes - -> crate::models::AppNodes get_app_nodes(max_entries, starting_token) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**max_entries** | **isize** | | [required] | - -**starting_token** | Option<**isize**> | | | - - -### Return type - -[**crate::models::AppNodes**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_app_node - -> crate::models::AppNode get_app_node(app_node_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**app_node_id** | **String** | | [required] | - - -### Return type - -[**crate::models::AppNode**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## register_app_node - -> () register_app_node(app_node_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**app_node_id** | **String** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## deregister_app_node - -> () deregister_app_node(app_node_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**app_node_id** | **String** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/BlockDevices.md b/testgen/src/autogen/docs/apis/BlockDevices.md deleted file mode 100644 index 435623329..000000000 --- a/testgen/src/autogen/docs/apis/BlockDevices.md +++ /dev/null @@ -1,44 +0,0 @@ -# BlockDevices - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_node_block_devices**](BlockDevices.md#get_node_block_devices) | **Get** /nodes/{node}/block_devices | - - - - - -## get_node_block_devices - -> Vec get_node_block_devices(all, node) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**all** | Option<**bool**> | | | - -**node** | **String** | | [required] | - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/Children.md b/testgen/src/autogen/docs/apis/Children.md deleted file mode 100644 index fcb87cafb..000000000 --- a/testgen/src/autogen/docs/apis/Children.md +++ /dev/null @@ -1,286 +0,0 @@ -# Children - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_nexus_children**](Children.md#get_nexus_children) | **Get** /nexuses/{nexus_id}/children | -[**get_nexus_child**](Children.md#get_nexus_child) | **Get** /nexuses/{nexus_id}/children/{child_id} | -[**put_nexus_child**](Children.md#put_nexus_child) | **Put** /nexuses/{nexus_id}/children/{child_id} | -[**del_nexus_child**](Children.md#del_nexus_child) | **Delete** /nexuses/{nexus_id}/children/{child_id} | -[**get_node_nexus_children**](Children.md#get_node_nexus_children) | **Get** /nodes/{node_id}/nexuses/{nexus_id}/children | -[**get_node_nexus_child**](Children.md#get_node_nexus_child) | **Get** /nodes/{node_id}/nexuses/{nexus_id}/children/{child_id} | -[**put_node_nexus_child**](Children.md#put_node_nexus_child) | **Put** /nodes/{node_id}/nexuses/{nexus_id}/children/{child_id} | -[**del_node_nexus_child**](Children.md#del_node_nexus_child) | **Delete** /nodes/{node_id}/nexuses/{nexus_id}/children/{child_id} | - - - - - -## get_nexus_children - -> Vec get_nexus_children(nexus_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**nexus_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_nexus_child - -> crate::models::Child get_nexus_child(nexus_id, child_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**nexus_id** | **uuid::Uuid** | | [required] | - -**child_id** | **String** | | [required] | - - -### Return type - -[**crate::models::Child**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_nexus_child - -> crate::models::Child put_nexus_child(nexus_id, child_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**nexus_id** | **uuid::Uuid** | | [required] | - -**child_id** | **String** | | [required] | - - -### Return type - -[**crate::models::Child**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_nexus_child - -> () del_nexus_child(nexus_id, child_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**nexus_id** | **uuid::Uuid** | | [required] | - -**child_id** | **String** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_node_nexus_children - -> Vec get_node_nexus_children(node_id, nexus_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**nexus_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_node_nexus_child - -> crate::models::Child get_node_nexus_child(node_id, nexus_id, child_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**nexus_id** | **uuid::Uuid** | | [required] | - -**child_id** | **String** | | [required] | - - -### Return type - -[**crate::models::Child**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_node_nexus_child - -> crate::models::Child put_node_nexus_child(node_id, nexus_id, child_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**nexus_id** | **uuid::Uuid** | | [required] | - -**child_id** | **String** | | [required] | - - -### Return type - -[**crate::models::Child**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_node_nexus_child - -> () del_node_nexus_child(node_id, nexus_id, child_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**nexus_id** | **uuid::Uuid** | | [required] | - -**child_id** | **String** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/JsonGrpc.md b/testgen/src/autogen/docs/apis/JsonGrpc.md deleted file mode 100644 index 904556003..000000000 --- a/testgen/src/autogen/docs/apis/JsonGrpc.md +++ /dev/null @@ -1,44 +0,0 @@ -# JsonGrpc - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**put_node_jsongrpc**](JsonGrpc.md#put_node_jsongrpc) | **Put** /nodes/{node}/jsongrpc/{method} | - - - - - -## put_node_jsongrpc - -> serde_json::Value put_node_jsongrpc(node, method) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node** | **String** | | [required] | - -**method** | **String** | | [required] | - - -### Return type - -[**serde_json::Value**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/Nexuses.md b/testgen/src/autogen/docs/apis/Nexuses.md deleted file mode 100644 index 646aa1aa5..000000000 --- a/testgen/src/autogen/docs/apis/Nexuses.md +++ /dev/null @@ -1,306 +0,0 @@ -# Nexuses - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_nexuses**](Nexuses.md#get_nexuses) | **Get** /nexuses | -[**get_nexus**](Nexuses.md#get_nexus) | **Get** /nexuses/{nexus_id} | -[**del_nexus**](Nexuses.md#del_nexus) | **Delete** /nexuses/{nexus_id} | -[**get_node_nexuses**](Nexuses.md#get_node_nexuses) | **Get** /nodes/{id}/nexuses | -[**get_node_nexus**](Nexuses.md#get_node_nexus) | **Get** /nodes/{node_id}/nexuses/{nexus_id} | -[**put_node_nexus**](Nexuses.md#put_node_nexus) | **Put** /nodes/{node_id}/nexuses/{nexus_id} | -[**del_node_nexus**](Nexuses.md#del_node_nexus) | **Delete** /nodes/{node_id}/nexuses/{nexus_id} | -[**del_node_nexus_share**](Nexuses.md#del_node_nexus_share) | **Delete** /nodes/{node_id}/nexuses/{nexus_id}/share | -[**put_node_nexus_share**](Nexuses.md#put_node_nexus_share) | **Put** /nodes/{node_id}/nexuses/{nexus_id}/share/{protocol} | - - - - - -## get_nexuses - -> Vec get_nexuses() - - -### Parameters - -This endpoint does not need any parameter. - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_nexus - -> crate::models::Nexus get_nexus(nexus_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**nexus_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Nexus**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_nexus - -> () del_nexus(nexus_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**nexus_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_node_nexuses - -> Vec get_node_nexuses(id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**id** | **String** | | [required] | - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_node_nexus - -> crate::models::Nexus get_node_nexus(node_id, nexus_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**nexus_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Nexus**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_node_nexus - -> crate::models::Nexus put_node_nexus(node_id, nexus_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**nexus_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Nexus**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_node_nexus - -> () del_node_nexus(node_id, nexus_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**nexus_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_node_nexus_share - -> () del_node_nexus_share(node_id, nexus_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**nexus_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_node_nexus_share - -> String put_node_nexus_share(node_id, nexus_id, protocol) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**nexus_id** | **uuid::Uuid** | | [required] | - -**protocol** | [**Protocol**](.md) | | [required] | - - -### Return type - -[**String**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/Nodes.md b/testgen/src/autogen/docs/apis/Nodes.md deleted file mode 100644 index 78b51a1f9..000000000 --- a/testgen/src/autogen/docs/apis/Nodes.md +++ /dev/null @@ -1,248 +0,0 @@ -# Nodes - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_nodes**](Nodes.md#get_nodes) | **Get** /nodes | -[**get_node**](Nodes.md#get_node) | **Get** /nodes/{id} | -[**put_node_cordon**](Nodes.md#put_node_cordon) | **Put** /nodes/{id}/cordon/{label} | -[**delete_node_cordon**](Nodes.md#delete_node_cordon) | **Delete** /nodes/{id}/cordon/{label} | -[**put_node_drain**](Nodes.md#put_node_drain) | **Put** /nodes/{id}/drain/{label} | -[**put_node_label**](Nodes.md#put_node_label) | **Put** /nodes/{id}/label/{key}={value} | -[**delete_node_label**](Nodes.md#delete_node_label) | **Delete** /nodes/{id}/label/{key} | - - - - - -## get_nodes - -> Vec get_nodes(node_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | Option<**String**> | | | - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_node - -> crate::models::Node get_node(id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**id** | **String** | | [required] | - - -### Return type - -[**crate::models::Node**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_node_cordon - -> crate::models::Node put_node_cordon(id, label) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**id** | **String** | | [required] | - -**label** | **String** | | [required] | - - -### Return type - -[**crate::models::Node**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## delete_node_cordon - -> crate::models::Node delete_node_cordon(id, label) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**id** | **String** | | [required] | - -**label** | **String** | | [required] | - - -### Return type - -[**crate::models::Node**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_node_drain - -> crate::models::Node put_node_drain(id, label) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**id** | **String** | | [required] | - -**label** | **String** | | [required] | - - -### Return type - -[**crate::models::Node**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_node_label - -> crate::models::Node put_node_label(overwrite, id, key, value) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**overwrite** | Option<**bool**> | | | - -**id** | **String** | | [required] | - -**key** | **String** | | [required] | - -**value** | **String** | | [required] | - - -### Return type - -[**crate::models::Node**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## delete_node_label - -> crate::models::Node delete_node_label(id, key) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**id** | **String** | | [required] | - -**key** | **String** | | [required] | - - -### Return type - -[**crate::models::Node**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/Pools.md b/testgen/src/autogen/docs/apis/Pools.md deleted file mode 100644 index 3976b5efc..000000000 --- a/testgen/src/autogen/docs/apis/Pools.md +++ /dev/null @@ -1,236 +0,0 @@ -# Pools - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_node_pools**](Pools.md#get_node_pools) | **Get** /nodes/{id}/pools | -[**get_node_pool**](Pools.md#get_node_pool) | **Get** /nodes/{node_id}/pools/{pool_id} | -[**put_node_pool**](Pools.md#put_node_pool) | **Put** /nodes/{node_id}/pools/{pool_id} | -[**del_node_pool**](Pools.md#del_node_pool) | **Delete** /nodes/{node_id}/pools/{pool_id} | -[**get_pools**](Pools.md#get_pools) | **Get** /pools | -[**get_pool**](Pools.md#get_pool) | **Get** /pools/{pool_id} | -[**del_pool**](Pools.md#del_pool) | **Delete** /pools/{pool_id} | - - - - - -## get_node_pools - -> Vec get_node_pools(id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**id** | **String** | | [required] | - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_node_pool - -> crate::models::Pool get_node_pool(node_id, pool_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**pool_id** | **String** | | [required] | - - -### Return type - -[**crate::models::Pool**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_node_pool - -> crate::models::Pool put_node_pool(node_id, pool_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**pool_id** | **String** | | [required] | - - -### Return type - -[**crate::models::Pool**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_node_pool - -> () del_node_pool(node_id, pool_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**pool_id** | **String** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_pools - -> Vec get_pools() - - -### Parameters - -This endpoint does not need any parameter. - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_pool - -> crate::models::Pool get_pool(pool_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**pool_id** | **String** | | [required] | - - -### Return type - -[**crate::models::Pool**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_pool - -> () del_pool(pool_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**pool_id** | **String** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/Replicas.md b/testgen/src/autogen/docs/apis/Replicas.md deleted file mode 100644 index 96dc30b7b..000000000 --- a/testgen/src/autogen/docs/apis/Replicas.md +++ /dev/null @@ -1,456 +0,0 @@ -# Replicas - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_node_replicas**](Replicas.md#get_node_replicas) | **Get** /nodes/{id}/replicas | -[**get_node_pool_replicas**](Replicas.md#get_node_pool_replicas) | **Get** /nodes/{node_id}/pools/{pool_id}/replicas | -[**get_node_pool_replica**](Replicas.md#get_node_pool_replica) | **Get** /nodes/{node_id}/pools/{pool_id}/replicas/{replica_id} | -[**put_node_pool_replica**](Replicas.md#put_node_pool_replica) | **Put** /nodes/{node_id}/pools/{pool_id}/replicas/{replica_id} | -[**del_node_pool_replica**](Replicas.md#del_node_pool_replica) | **Delete** /nodes/{node_id}/pools/{pool_id}/replicas/{replica_id} | -[**del_node_pool_replica_share**](Replicas.md#del_node_pool_replica_share) | **Delete** /nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}/share | -[**put_node_pool_replica_share**](Replicas.md#put_node_pool_replica_share) | **Put** /nodes/{node_id}/pools/{pool_id}/replicas/{replica_id}/share/nvmf | -[**put_pool_replica**](Replicas.md#put_pool_replica) | **Put** /pools/{pool_id}/replicas/{replica_id} | -[**del_pool_replica**](Replicas.md#del_pool_replica) | **Delete** /pools/{pool_id}/replicas/{replica_id} | -[**del_pool_replica_share**](Replicas.md#del_pool_replica_share) | **Delete** /pools/{pool_id}/replicas/{replica_id}/share | -[**put_pool_replica_share**](Replicas.md#put_pool_replica_share) | **Put** /pools/{pool_id}/replicas/{replica_id}/share/nvmf | -[**get_replicas**](Replicas.md#get_replicas) | **Get** /replicas | -[**get_replica**](Replicas.md#get_replica) | **Get** /replicas/{id} | - - - - - -## get_node_replicas - -> Vec get_node_replicas(id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**id** | **String** | | [required] | - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_node_pool_replicas - -> Vec get_node_pool_replicas(node_id, pool_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**pool_id** | **String** | | [required] | - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_node_pool_replica - -> crate::models::Replica get_node_pool_replica(node_id, pool_id, replica_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**pool_id** | **String** | | [required] | - -**replica_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Replica**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_node_pool_replica - -> crate::models::Replica put_node_pool_replica(node_id, pool_id, replica_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**pool_id** | **String** | | [required] | - -**replica_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Replica**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_node_pool_replica - -> () del_node_pool_replica(node_id, pool_id, replica_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**pool_id** | **String** | | [required] | - -**replica_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_node_pool_replica_share - -> () del_node_pool_replica_share(node_id, pool_id, replica_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**node_id** | **String** | | [required] | - -**pool_id** | **String** | | [required] | - -**replica_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_node_pool_replica_share - -> String put_node_pool_replica_share(allowed_hosts, node_id, pool_id, replica_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**allowed_hosts** | Option<[**Vec**](.md)> | | | - -**node_id** | **String** | | [required] | - -**pool_id** | **String** | | [required] | - -**replica_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**String**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_pool_replica - -> crate::models::Replica put_pool_replica(pool_id, replica_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**pool_id** | **String** | | [required] | - -**replica_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Replica**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_pool_replica - -> () del_pool_replica(pool_id, replica_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**pool_id** | **String** | | [required] | - -**replica_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_pool_replica_share - -> () del_pool_replica_share(pool_id, replica_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**pool_id** | **String** | | [required] | - -**replica_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_pool_replica_share - -> String put_pool_replica_share(allowed_hosts, pool_id, replica_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**allowed_hosts** | Option<[**Vec**](.md)> | | | - -**pool_id** | **String** | | [required] | - -**replica_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**String**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_replicas - -> Vec get_replicas() - - -### Parameters - -This endpoint does not need any parameter. - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_replica - -> crate::models::Replica get_replica(id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Replica**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/Snapshots.md b/testgen/src/autogen/docs/apis/Snapshots.md deleted file mode 100644 index 1a1274bef..000000000 --- a/testgen/src/autogen/docs/apis/Snapshots.md +++ /dev/null @@ -1,250 +0,0 @@ -# Snapshots - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_volume_snapshot**](Snapshots.md#get_volume_snapshot) | **Get** /volumes/{volume_id}/snapshots/{snapshot_id} | -[**put_volume_snapshot**](Snapshots.md#put_volume_snapshot) | **Put** /volumes/{volume_id}/snapshots/{snapshot_id} | -[**del_volume_snapshot**](Snapshots.md#del_volume_snapshot) | **Delete** /volumes/{volume_id}/snapshots/{snapshot_id} | -[**get_volume_snapshots**](Snapshots.md#get_volume_snapshots) | **Get** /volumes/{volume_id}/snapshots | -[**get_volumes_snapshot**](Snapshots.md#get_volumes_snapshot) | **Get** /volumes/snapshots/{snapshot_id} | -[**del_snapshot**](Snapshots.md#del_snapshot) | **Delete** /volumes/snapshots/{snapshot_id} | -[**get_volumes_snapshots**](Snapshots.md#get_volumes_snapshots) | **Get** /volumes/snapshots | - - - - - -## get_volume_snapshot - -> crate::models::VolumeSnapshot get_volume_snapshot(volume_id, snapshot_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - -**snapshot_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::VolumeSnapshot**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_volume_snapshot - -> crate::models::VolumeSnapshot put_volume_snapshot(volume_id, snapshot_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - -**snapshot_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::VolumeSnapshot**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_volume_snapshot - -> () del_volume_snapshot(volume_id, snapshot_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - -**snapshot_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_volume_snapshots - -> crate::models::VolumeSnapshots get_volume_snapshots(max_entries, starting_token, volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**max_entries** | **isize** | | [required] | - -**starting_token** | Option<**isize**> | | | - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::VolumeSnapshots**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_volumes_snapshot - -> crate::models::VolumeSnapshot get_volumes_snapshot(snapshot_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**snapshot_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::VolumeSnapshot**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_snapshot - -> () del_snapshot(snapshot_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**snapshot_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_volumes_snapshots - -> crate::models::VolumeSnapshots get_volumes_snapshots(snapshot_id, volume_id, max_entries, starting_token) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**snapshot_id** | Option<**uuid::Uuid**> | | | - -**volume_id** | Option<**uuid::Uuid**> | | | - -**max_entries** | **isize** | | [required] | - -**starting_token** | Option<**isize**> | | | - - -### Return type - -[**crate::models::VolumeSnapshots**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/Specs.md b/testgen/src/autogen/docs/apis/Specs.md deleted file mode 100644 index 7ac9665e3..000000000 --- a/testgen/src/autogen/docs/apis/Specs.md +++ /dev/null @@ -1,38 +0,0 @@ -# Specs - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_specs**](Specs.md#get_specs) | **Get** /specs | - - - - - -## get_specs - -> crate::models::Specs get_specs() - - -### Parameters - -This endpoint does not need any parameter. - - -### Return type - -[**crate::models::Specs**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/Volumes.md b/testgen/src/autogen/docs/apis/Volumes.md deleted file mode 100644 index 18acc8a34..000000000 --- a/testgen/src/autogen/docs/apis/Volumes.md +++ /dev/null @@ -1,472 +0,0 @@ -# Volumes - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_volumes**](Volumes.md#get_volumes) | **Get** /volumes | -[**get_volume**](Volumes.md#get_volume) | **Get** /volumes/{volume_id} | -[**put_volume**](Volumes.md#put_volume) | **Put** /volumes/{volume_id} | -[**del_volume**](Volumes.md#del_volume) | **Delete** /volumes/{volume_id} | -[**get_rebuild_history**](Volumes.md#get_rebuild_history) | **Get** /volumes/{volume_id}/rebuild-history | -[**put_volume_replica_count**](Volumes.md#put_volume_replica_count) | **Put** /volumes/{volume_id}/replica_count/{replica_count} | -[**put_volume_property**](Volumes.md#put_volume_property) | **Put** /volumes/{volume_id}/property | -[**put_volume_target**](Volumes.md#put_volume_target) | **Put** /volumes/{volume_id}/target | -[**del_volume_target**](Volumes.md#del_volume_target) | **Delete** /volumes/{volume_id}/target | -[**put_volume_size**](Volumes.md#put_volume_size) | **Put** /volumes/{volume_id}/size | -[**del_volume_shutdown_targets**](Volumes.md#del_volume_shutdown_targets) | **Delete** /volumes/{volume_id}/shutdown_targets | -[**put_volume_share**](Volumes.md#put_volume_share) | **Put** /volumes/{volume_id}/share/{protocol} | -[**del_share**](Volumes.md#del_share) | **Delete** /volumes{volume_id}/share | -[**put_snapshot_volume**](Volumes.md#put_snapshot_volume) | **Put** /snapshots/{snapshot_id}/volumes/{volume_id} | - - - - - -## get_volumes - -> crate::models::Volumes get_volumes(volume_id, max_entries, starting_token) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | Option<**uuid::Uuid**> | | | - -**max_entries** | **isize** | | [required] | - -**starting_token** | Option<**isize**> | | | - - -### Return type - -[**crate::models::Volumes**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_volume - -> crate::models::Volume get_volume(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Volume**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_volume - -> crate::models::Volume put_volume(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Volume**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_volume - -> () del_volume(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## get_rebuild_history - -> serde_json::Value get_rebuild_history(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**serde_json::Value**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_volume_replica_count - -> crate::models::Volume put_volume_replica_count(volume_id, replica_count) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - -**replica_count** | **u8** | | [required] | - - -### Return type - -[**crate::models::Volume**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_volume_property - -> crate::models::Volume put_volume_property(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Volume**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_volume_target - -> crate::models::Volume put_volume_target(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Volume**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_volume_target - -> crate::models::Volume del_volume_target(force, volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**force** | Option<**bool**> | | | - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Volume**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_volume_size - -> crate::models::Volume put_volume_size(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Volume**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_volume_shutdown_targets - -> () del_volume_shutdown_targets(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_volume_share - -> String put_volume_share(frontend_host, volume_id, protocol) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**frontend_host** | Option<**String**> | | | - -**volume_id** | **uuid::Uuid** | | [required] | - -**protocol** | [**Protocol**](.md) | | [required] | - - -### Return type - -[**String**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_share - -> () del_share(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_snapshot_volume - -> crate::models::Volume put_snapshot_volume(snapshot_id, volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**snapshot_id** | **uuid::Uuid** | | [required] | - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**crate::models::Volume**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/apis/Watches.md b/testgen/src/autogen/docs/apis/Watches.md deleted file mode 100644 index 588dca40d..000000000 --- a/testgen/src/autogen/docs/apis/Watches.md +++ /dev/null @@ -1,110 +0,0 @@ -# Watches - -All URIs are relative to ** - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_watch_volume**](Watches.md#get_watch_volume) | **Get** /watches/volumes/{volume_id} | -[**put_watch_volume**](Watches.md#put_watch_volume) | **Put** /watches/volumes/{volume_id} | -[**del_watch_volume**](Watches.md#del_watch_volume) | **Delete** /watches/volumes/{volume_id} | - - - - - -## get_watch_volume - -> Vec get_watch_volume(volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**Vec**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## put_watch_volume - -> () put_watch_volume(callback, volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**callback** | **String** | | [required] | - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - - -## del_watch_volume - -> () del_watch_volume(callback, volume_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- - -**callback** | **String** | | [required] | - -**volume_id** | **uuid::Uuid** | | [required] | - - -### Return type - -[**()**](.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - diff --git a/testgen/src/autogen/docs/models/AffinityGroup.md b/testgen/src/autogen/docs/models/AffinityGroup.md deleted file mode 100644 index 011c745a5..000000000 --- a/testgen/src/autogen/docs/models/AffinityGroup.md +++ /dev/null @@ -1,11 +0,0 @@ -# AffinityGroup - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | Identification of the Affinity Group. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/AppNode.md b/testgen/src/autogen/docs/models/AppNode.md deleted file mode 100644 index 073ca3ca5..000000000 --- a/testgen/src/autogen/docs/models/AppNode.md +++ /dev/null @@ -1,13 +0,0 @@ -# AppNode - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | App node identifier. | -**spec** | [**crate::models::AppNodeSpec**](.md) | App node attributes. | -**state** | Option<[**crate::models::AppNodeState**](.md)> | Deemed state of the app node. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/AppNodeSpec.md b/testgen/src/autogen/docs/models/AppNodeSpec.md deleted file mode 100644 index 46074e303..000000000 --- a/testgen/src/autogen/docs/models/AppNodeSpec.md +++ /dev/null @@ -1,13 +0,0 @@ -# AppNodeSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | App node identifier. | -**endpoint** | **String** | gRPC server endpoint of the app node. | -**labels** | Option<[**::std::collections::HashMap**](.md)> | Labels to be set on the app node. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/AppNodeState.md b/testgen/src/autogen/docs/models/AppNodeState.md deleted file mode 100644 index 258dac417..000000000 --- a/testgen/src/autogen/docs/models/AppNodeState.md +++ /dev/null @@ -1,13 +0,0 @@ -# AppNodeState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | App node identifier. | -**endpoint** | **String** | gRPC server endpoint of the app node. | -**status** | [**Status**](.md) | Deemed Status of the app node. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/AppNodes.md b/testgen/src/autogen/docs/models/AppNodes.md deleted file mode 100644 index fac5336d9..000000000 --- a/testgen/src/autogen/docs/models/AppNodes.md +++ /dev/null @@ -1,12 +0,0 @@ -# AppNodes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**entries** | [**Vec**](.md) | | -**next_token** | Option<**isize**> | | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/BlockDevice.md b/testgen/src/autogen/docs/models/BlockDevice.md deleted file mode 100644 index ae202c222..000000000 --- a/testgen/src/autogen/docs/models/BlockDevice.md +++ /dev/null @@ -1,23 +0,0 @@ -# BlockDevice - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**available** | **bool** | identifies if device is available for use (ie. is not \"currently\" in use) | -**connection_type** | **String** | the type of bus through which the device is connected to the system | -**devlinks** | [**Vec**](.md) | list of udev generated symlinks by which device may be identified | -**devmajor** | **i32** | major device number | -**devminor** | **i32** | minor device number | -**devname** | **String** | entry in /dev associated with device | -**devpath** | **String** | official device path | -**devtype** | **String** | currently \"disk\" or \"partition\" | -**filesystem** | Option<[**crate::models::BlockDeviceFilesystem**](.md)> | filesystem information in case where a filesystem is present | [optional] -**is_rotational** | Option<**bool**> | indicates whether the device is rotational or non-rotational | [optional] -**model** | **String** | device model - useful for identifying devices | -**partition** | Option<[**crate::models::BlockDevicePartition**](.md)> | partition information in case where device represents a partition | [optional] -**size** | **u64** | size of device in (512 byte) blocks | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/BlockDeviceFilesystem.md b/testgen/src/autogen/docs/models/BlockDeviceFilesystem.md deleted file mode 100644 index d44346235..000000000 --- a/testgen/src/autogen/docs/models/BlockDeviceFilesystem.md +++ /dev/null @@ -1,14 +0,0 @@ -# BlockDeviceFilesystem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fstype** | **String** | filesystem type: ext3, ntfs, ... | -**label** | **String** | volume label | -**mountpoint** | **String** | path where filesystem is currently mounted | -**uuid** | **String** | UUID identifying the volume (filesystem) | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/BlockDevicePartition.md b/testgen/src/autogen/docs/models/BlockDevicePartition.md deleted file mode 100644 index 764efe489..000000000 --- a/testgen/src/autogen/docs/models/BlockDevicePartition.md +++ /dev/null @@ -1,16 +0,0 @@ -# BlockDevicePartition - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | partition name | -**number** | **i32** | partition number | -**parent** | **String** | devname of parent device to which this partition belongs | -**scheme** | **String** | partition scheme: gpt, dos, ... | -**typeid** | **String** | partition type identifier | -**uuid** | **String** | UUID identifying partition | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Child.md b/testgen/src/autogen/docs/models/Child.md deleted file mode 100644 index b8eca56cb..000000000 --- a/testgen/src/autogen/docs/models/Child.md +++ /dev/null @@ -1,14 +0,0 @@ -# Child - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**rebuild_progress** | Option<**usize**> | current rebuild progress (%) | [optional] -**state** | [**crate::models::ChildState**](.md) | State of a Nexus Child | -**state_reason** | Option<[**crate::models::ChildStateReason**](.md)> | Reason for the state of a Nexus Child | [optional] -**uri** | **String** | uri of the child device | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ChildState.md b/testgen/src/autogen/docs/models/ChildState.md deleted file mode 100644 index affe70ac3..000000000 --- a/testgen/src/autogen/docs/models/ChildState.md +++ /dev/null @@ -1,10 +0,0 @@ -# ChildState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ChildStateReason.md b/testgen/src/autogen/docs/models/ChildStateReason.md deleted file mode 100644 index 01ecd8e6c..000000000 --- a/testgen/src/autogen/docs/models/ChildStateReason.md +++ /dev/null @@ -1,10 +0,0 @@ -# ChildStateReason - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/CordonDrainState.md b/testgen/src/autogen/docs/models/CordonDrainState.md deleted file mode 100644 index 425d828be..000000000 --- a/testgen/src/autogen/docs/models/CordonDrainState.md +++ /dev/null @@ -1,13 +0,0 @@ -# CordonDrainState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cordonedstate** | Option<[**crate::models::CordonedState**](.md)> | The item is cordoned | [optional] -**drainingstate** | Option<[**crate::models::DrainState**](.md)> | The item is draining | [optional] -**drainedstate** | Option<[**crate::models::DrainState**](.md)> | The item is draining | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/CordonedState.md b/testgen/src/autogen/docs/models/CordonedState.md deleted file mode 100644 index 0f5d56a59..000000000 --- a/testgen/src/autogen/docs/models/CordonedState.md +++ /dev/null @@ -1,11 +0,0 @@ -# CordonedState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cordonlabels** | [**Vec**](.md) | | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/CreateNexusBody.md b/testgen/src/autogen/docs/models/CreateNexusBody.md deleted file mode 100644 index 547163ecc..000000000 --- a/testgen/src/autogen/docs/models/CreateNexusBody.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateNexusBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**children** | [**Vec**](.md) | replica can be iscsi and nvmf remote targets or a local spdk bdev (i.e. bdev:///name-of-the-bdev). uris to the targets we connect to | -**size** | **u64** | size of the device in bytes | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/CreatePoolBody.md b/testgen/src/autogen/docs/models/CreatePoolBody.md deleted file mode 100644 index 69765d24a..000000000 --- a/testgen/src/autogen/docs/models/CreatePoolBody.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreatePoolBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**disks** | [**Vec**](.md) | disk device paths or URIs to be claimed by the pool | -**labels** | Option<[**::std::collections::HashMap**](.md)> | labels to be set on the pools | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/CreateReplicaBody.md b/testgen/src/autogen/docs/models/CreateReplicaBody.md deleted file mode 100644 index c7f753136..000000000 --- a/testgen/src/autogen/docs/models/CreateReplicaBody.md +++ /dev/null @@ -1,14 +0,0 @@ -# CreateReplicaBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**share** | Option<[**crate::models::ReplicaShareProtocol**](.md)> | Replica Share Protocol | [optional] -**allowed_hosts** | Option<[**Vec**](.md)> | | [optional] -**size** | **u64** | size of the replica in bytes | -**thin** | **bool** | thin provisioning | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/CreateVolumeBody.md b/testgen/src/autogen/docs/models/CreateVolumeBody.md deleted file mode 100644 index 45a34eb2a..000000000 --- a/testgen/src/autogen/docs/models/CreateVolumeBody.md +++ /dev/null @@ -1,18 +0,0 @@ -# CreateVolumeBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**policy** | [**crate::models::VolumePolicy**](.md) | Volume policy used to determine if and how to replace a replica | -**replicas** | **u8** | number of storage replicas | -**size** | **u64** | size of the volume in bytes | -**thin** | **bool** | flag indicating whether or not the volume is thin provisioned | -**topology** | Option<[**crate::models::Topology**](.md)> | node and pool topology for volumes | [optional] -**labels** | Option<[**::std::collections::HashMap**](.md)> | Optionally used to store custom volume information | [optional] -**affinity_group** | Option<[**crate::models::AffinityGroup**](.md)> | Affinity Group related information. | [optional] -**max_snapshots** | Option<**u32**> | Max Snapshots limit per volume. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/DrainState.md b/testgen/src/autogen/docs/models/DrainState.md deleted file mode 100644 index da317323d..000000000 --- a/testgen/src/autogen/docs/models/DrainState.md +++ /dev/null @@ -1,12 +0,0 @@ -# DrainState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cordonlabels** | [**Vec**](.md) | | -**drainlabels** | [**Vec**](.md) | | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ExplicitNodeTopology.md b/testgen/src/autogen/docs/models/ExplicitNodeTopology.md deleted file mode 100644 index 2b84abe0e..000000000 --- a/testgen/src/autogen/docs/models/ExplicitNodeTopology.md +++ /dev/null @@ -1,12 +0,0 @@ -# ExplicitNodeTopology - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allowed_nodes** | [**Vec**](.md) | replicas can only be placed on these nodes | -**preferred_nodes** | [**Vec**](.md) | preferred nodes to place the replicas | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/LabelledTopology.md b/testgen/src/autogen/docs/models/LabelledTopology.md deleted file mode 100644 index fe244c01e..000000000 --- a/testgen/src/autogen/docs/models/LabelledTopology.md +++ /dev/null @@ -1,13 +0,0 @@ -# LabelledTopology - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**exclusion** | [**::std::collections::HashMap**](.md) | Excludes resources with the same $label name, eg: \"Zone\" would not allow for resources with the same \"Zone\" value to be used for a certain operation, eg: A node with \"Zone: A\" would not be paired up with a node with \"Zone: A\", but it could be paired up with a node with \"Zone: B\" exclusive label NAME in the form \"NAME\", and not \"NAME: VALUE\" | -**inclusion** | [**::std::collections::HashMap**](.md) | Includes resources with the same $label or $label:$value eg: if label is \"Zone: A\": A resource with \"Zone: A\" would be paired up with a resource with \"Zone: A\", but not with a resource with \"Zone: B\" if label is \"Zone\": A resource with \"Zone: A\" would be paired up with a resource with \"Zone: B\", but not with a resource with \"OtherLabel: B\" inclusive label key value in the form \"NAME: VALUE\" | -**affinitykey** | [**Vec**](.md) | This feature includes resources with identical $label keys. For example, if the affinity key is set to \"Zone\": Initially, a resource that matches the label is selected, example \"Zone: A\". Subsequently, all other resources must match the given label \"Zone: A\", effectively adding this requirement as an inclusion label. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Nexus.md b/testgen/src/autogen/docs/models/Nexus.md deleted file mode 100644 index 9d2e77e27..000000000 --- a/testgen/src/autogen/docs/models/Nexus.md +++ /dev/null @@ -1,18 +0,0 @@ -# Nexus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**children** | [**Vec**](.md) | Array of Nexus Children | -**device_uri** | **String** | URI of the device for the volume (missing if not published). Missing property and empty string are treated the same. | -**node** | **String** | id of the io-engine instance | -**rebuilds** | **u32** | total number of rebuild tasks | -**protocol** | [**crate::models::Protocol**](.md) | Common Protocol | -**size** | **u64** | size of the volume in bytes | -**state** | [**crate::models::NexusState**](.md) | State of the Nexus | -**uuid** | **uuid::Uuid** | uuid of the nexus | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/NexusShareProtocol.md b/testgen/src/autogen/docs/models/NexusShareProtocol.md deleted file mode 100644 index 612325f2f..000000000 --- a/testgen/src/autogen/docs/models/NexusShareProtocol.md +++ /dev/null @@ -1,10 +0,0 @@ -# NexusShareProtocol - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/NexusSpec.md b/testgen/src/autogen/docs/models/NexusSpec.md deleted file mode 100644 index 17f0994b8..000000000 --- a/testgen/src/autogen/docs/models/NexusSpec.md +++ /dev/null @@ -1,19 +0,0 @@ -# NexusSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**children** | [**Vec**](.md) | List of children. | -**managed** | **bool** | Managed by our control plane | -**node** | **String** | Node where the nexus should live. | -**operation** | Option<[**crate::models::NexusSpecOperation**](.md)> | Record of the operation in progress | [optional] -**owner** | Option<**uuid::Uuid**> | Volume which owns this nexus, if any | [optional] -**share** | [**crate::models::Protocol**](.md) | Common Protocol | -**size** | **u64** | Size of the nexus. | -**status** | [**crate::models::SpecStatus**](.md) | Common base state for a resource | -**uuid** | **uuid::Uuid** | Nexus Id | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/NexusSpecOperation.md b/testgen/src/autogen/docs/models/NexusSpecOperation.md deleted file mode 100644 index 3cc00afbf..000000000 --- a/testgen/src/autogen/docs/models/NexusSpecOperation.md +++ /dev/null @@ -1,12 +0,0 @@ -# NexusSpecOperation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operation** | [**Operation**](.md) | Record of the operation | -**result** | Option<**bool**> | Result of the operation | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/NexusState.md b/testgen/src/autogen/docs/models/NexusState.md deleted file mode 100644 index d1103df9c..000000000 --- a/testgen/src/autogen/docs/models/NexusState.md +++ /dev/null @@ -1,10 +0,0 @@ -# NexusState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Node.md b/testgen/src/autogen/docs/models/Node.md deleted file mode 100644 index f2d972777..000000000 --- a/testgen/src/autogen/docs/models/Node.md +++ /dev/null @@ -1,13 +0,0 @@ -# Node - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | storage node identifier | -**spec** | Option<[**crate::models::NodeSpec**](.md)> | Node spec | [optional] -**state** | Option<[**crate::models::NodeState**](.md)> | io-engine storage node information | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/NodeAccessInfo.md b/testgen/src/autogen/docs/models/NodeAccessInfo.md deleted file mode 100644 index 3b1fdc435..000000000 --- a/testgen/src/autogen/docs/models/NodeAccessInfo.md +++ /dev/null @@ -1,12 +0,0 @@ -# NodeAccessInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | The nodename of the node. | -**nqn** | **String** | The Nvme Nqn of the node\'s initiator. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/NodeSpec.md b/testgen/src/autogen/docs/models/NodeSpec.md deleted file mode 100644 index fd9ab2c68..000000000 --- a/testgen/src/autogen/docs/models/NodeSpec.md +++ /dev/null @@ -1,15 +0,0 @@ -# NodeSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**grpc_endpoint** | **String** | gRPC endpoint of the io-engine instance | -**id** | **String** | storage node identifier | -**labels** | Option<[**::std::collections::HashMap**](.md)> | labels to be set on the node | [optional] -**cordondrainstate** | Option<[**crate::models::CordonDrainState**](.md)> | the drain state | [optional] -**node_nqn** | Option<**String**> | NVMe Qualified Names (NQNs) are used to uniquely describe a host or NVM subsystem for the purposes of identification and authentication | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/NodeState.md b/testgen/src/autogen/docs/models/NodeState.md deleted file mode 100644 index cfe06903a..000000000 --- a/testgen/src/autogen/docs/models/NodeState.md +++ /dev/null @@ -1,14 +0,0 @@ -# NodeState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**grpc_endpoint** | **String** | gRPC endpoint of the io-engine instance | -**id** | **String** | storage node identifier | -**status** | [**crate::models::NodeStatus**](.md) | deemed state of the node | -**node_nqn** | Option<**String**> | NVMe Qualified Names (NQNs) are used to uniquely describe a host or NVM subsystem for the purposes of identification and authentication | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/NodeStatus.md b/testgen/src/autogen/docs/models/NodeStatus.md deleted file mode 100644 index ad0b3763a..000000000 --- a/testgen/src/autogen/docs/models/NodeStatus.md +++ /dev/null @@ -1,10 +0,0 @@ -# NodeStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/NodeTopology.md b/testgen/src/autogen/docs/models/NodeTopology.md deleted file mode 100644 index 31acbf529..000000000 --- a/testgen/src/autogen/docs/models/NodeTopology.md +++ /dev/null @@ -1,12 +0,0 @@ -# NodeTopology - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**explicit** | Option<[**crate::models::ExplicitNodeTopology**](.md)> | volume topology, explicitly selected | [optional] -**labelled** | Option<[**crate::models::LabelledTopology**](.md)> | volume topology definition through labels | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/OfflineReplicaSnapshotState.md b/testgen/src/autogen/docs/models/OfflineReplicaSnapshotState.md deleted file mode 100644 index 4aa352b5d..000000000 --- a/testgen/src/autogen/docs/models/OfflineReplicaSnapshotState.md +++ /dev/null @@ -1,14 +0,0 @@ -# OfflineReplicaSnapshotState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **uuid::Uuid** | | -**source_id** | **uuid::Uuid** | | -**pool_id** | **String** | storage pool identifier | -**pool_uuid** | **uuid::Uuid** | storage pool unique identifier | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/OnlineReplicaSnapshotState.md b/testgen/src/autogen/docs/models/OnlineReplicaSnapshotState.md deleted file mode 100644 index 842a2d2c6..000000000 --- a/testgen/src/autogen/docs/models/OnlineReplicaSnapshotState.md +++ /dev/null @@ -1,18 +0,0 @@ -# OnlineReplicaSnapshotState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **uuid::Uuid** | | -**source_id** | **uuid::Uuid** | | -**pool_id** | **String** | storage pool identifier | -**pool_uuid** | **uuid::Uuid** | storage pool unique identifier | -**timestamp** | **String** | Timestamp when the replica snapshot is taken on the storage system. | -**size** | **u64** | Replica snapshot size. | -**allocated_size** | **u64** | Runtime size in bytes of the snapshot. Equal to the volume allocation at the time of the snapshot creation. It may grow larger if any of its predecessors are deleted. | -**predecessor_alloc_size** | **u64** | Total allocated size of all the snapshot predecessors. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Pool.md b/testgen/src/autogen/docs/models/Pool.md deleted file mode 100644 index 159b5dd18..000000000 --- a/testgen/src/autogen/docs/models/Pool.md +++ /dev/null @@ -1,13 +0,0 @@ -# Pool - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | storage pool identifier | -**spec** | Option<[**crate::models::PoolSpec**](.md)> | User specification of a pool. | [optional] -**state** | Option<[**crate::models::PoolState**](.md)> | State of a pool, as reported by io-engine | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/PoolSpec.md b/testgen/src/autogen/docs/models/PoolSpec.md deleted file mode 100644 index 961f961fb..000000000 --- a/testgen/src/autogen/docs/models/PoolSpec.md +++ /dev/null @@ -1,15 +0,0 @@ -# PoolSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**disks** | [**Vec**](.md) | absolute disk paths claimed by the pool | -**id** | **String** | storage pool identifier | -**labels** | Option<[**::std::collections::HashMap**](.md)> | labels to be set on the pools | [optional] -**node** | **String** | storage node identifier | -**status** | [**crate::models::SpecStatus**](.md) | Common base state for a resource | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/PoolState.md b/testgen/src/autogen/docs/models/PoolState.md deleted file mode 100644 index c915995c3..000000000 --- a/testgen/src/autogen/docs/models/PoolState.md +++ /dev/null @@ -1,17 +0,0 @@ -# PoolState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**capacity** | **u64** | size of the pool in bytes | -**disks** | [**Vec**](.md) | absolute disk paths claimed by the pool | -**id** | **String** | storage pool identifier | -**node** | **String** | storage node identifier | -**status** | [**crate::models::PoolStatus**](.md) | current status of the pool | -**used** | **u64** | used bytes from the pool | -**committed** | Option<**u64**> | accrued size of all replicas contained in this pool | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/PoolStatus.md b/testgen/src/autogen/docs/models/PoolStatus.md deleted file mode 100644 index d0317632c..000000000 --- a/testgen/src/autogen/docs/models/PoolStatus.md +++ /dev/null @@ -1,10 +0,0 @@ -# PoolStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/PoolTopology.md b/testgen/src/autogen/docs/models/PoolTopology.md deleted file mode 100644 index 398c45114..000000000 --- a/testgen/src/autogen/docs/models/PoolTopology.md +++ /dev/null @@ -1,11 +0,0 @@ -# PoolTopology - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**labelled** | Option<[**crate::models::LabelledTopology**](.md)> | volume pool topology definition through labels | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Protocol.md b/testgen/src/autogen/docs/models/Protocol.md deleted file mode 100644 index 3eea538e0..000000000 --- a/testgen/src/autogen/docs/models/Protocol.md +++ /dev/null @@ -1,10 +0,0 @@ -# Protocol - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/PublishVolumeBody.md b/testgen/src/autogen/docs/models/PublishVolumeBody.md deleted file mode 100644 index 4032b01d7..000000000 --- a/testgen/src/autogen/docs/models/PublishVolumeBody.md +++ /dev/null @@ -1,16 +0,0 @@ -# PublishVolumeBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**publish_context** | [**::std::collections::HashMap**](.md) | Controller Volume Publish context | -**reuse_existing** | Option<**bool**> | Allows reusing of the current target. | [optional] -**node** | Option<[**String**](.md)> | The node where the target will reside in. It may be moved elsewhere during volume republish. | [optional] -**protocol** | [**crate::models::VolumeShareProtocol**](.md) | The protocol used to connect to the front-end node. | -**republish** | Option<**bool**> | Allows republishing the volume on the node by shutting down the existing target first. | [optional] -**frontend_node** | Option<**String**> | The node where the front-end workload resides. If the workload moves then the volume must be republished. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/RebuildJobState.md b/testgen/src/autogen/docs/models/RebuildJobState.md deleted file mode 100644 index f4847b99c..000000000 --- a/testgen/src/autogen/docs/models/RebuildJobState.md +++ /dev/null @@ -1,10 +0,0 @@ -# RebuildJobState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/RebuildRecord.md b/testgen/src/autogen/docs/models/RebuildRecord.md deleted file mode 100644 index dbb5f2108..000000000 --- a/testgen/src/autogen/docs/models/RebuildRecord.md +++ /dev/null @@ -1,21 +0,0 @@ -# RebuildRecord - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**child_uri** | **String** | Uri of the rebuilding child | -**src_uri** | **String** | Uri of source child for rebuild job | -**rebuild_job_state** | [**crate::models::RebuildJobState**](.md) | State of the rebuild job | -**blocks_total** | **u64** | Total blocks to rebuild | -**blocks_recovered** | **u64** | Number of blocks processed | -**blocks_transferred** | **u64** | Number of blocks to transferred | -**blocks_remaining** | **u64** | Number of blocks remaining | -**block_size** | **u64** | Size of each block in the task | -**is_partial** | **bool** | True means its Partial rebuild job. If false, its Full rebuild job | -**start_time** | **String** | Start time of the rebuild job (UTC) | -**end_time** | **String** | End time of the rebuild job (UTC) | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/RegisterAppNode.md b/testgen/src/autogen/docs/models/RegisterAppNode.md deleted file mode 100644 index d607b2de6..000000000 --- a/testgen/src/autogen/docs/models/RegisterAppNode.md +++ /dev/null @@ -1,12 +0,0 @@ -# RegisterAppNode - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**endpoint** | **String** | gRPC server endpoint of the app node. | -**labels** | Option<[**::std::collections::HashMap**](.md)> | Labels to be set on the app node. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Replica.md b/testgen/src/autogen/docs/models/Replica.md deleted file mode 100644 index 22aef7e23..000000000 --- a/testgen/src/autogen/docs/models/Replica.md +++ /dev/null @@ -1,22 +0,0 @@ -# Replica - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**node** | **String** | storage node identifier | -**pool** | **String** | storage pool identifier | -**pool_uuid** | Option<**uuid::Uuid**> | storage pool unique identifier | [optional] -**share** | [**crate::models::Protocol**](.md) | Common Protocol | -**size** | **u64** | size of the replica in bytes | -**space** | Option<[**crate::models::ReplicaSpaceUsage**](.md)> | Replica space usage information. Useful for capacity management, eg: figure out how much of a thin-provisioned replica is allocated. | [optional] -**state** | [**crate::models::ReplicaState**](.md) | state of the replica | -**thin** | **bool** | thin provisioning | -**uri** | **String** | uri usable by nexus to access it | -**uuid** | **uuid::Uuid** | uuid of the replica | -**allowed_hosts** | Option<[**Vec**](.md)> | NQNs of hosts allowed to connect to this replica | [optional] -**kind** | [**crate::models::ReplicaKind**](.md) | Type of replica, example regular or snapshot. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaKind.md b/testgen/src/autogen/docs/models/ReplicaKind.md deleted file mode 100644 index c12864b3f..000000000 --- a/testgen/src/autogen/docs/models/ReplicaKind.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReplicaKind - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaShareProtocol.md b/testgen/src/autogen/docs/models/ReplicaShareProtocol.md deleted file mode 100644 index 7ac1a6082..000000000 --- a/testgen/src/autogen/docs/models/ReplicaShareProtocol.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReplicaShareProtocol - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaSnapshot.md b/testgen/src/autogen/docs/models/ReplicaSnapshot.md deleted file mode 100644 index 3503e2970..000000000 --- a/testgen/src/autogen/docs/models/ReplicaSnapshot.md +++ /dev/null @@ -1,13 +0,0 @@ -# ReplicaSnapshot - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **uuid::Uuid** | | -**source_id** | **uuid::Uuid** | | -**status** | [**crate::models::SpecStatus**](.md) | Common base state for a resource | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaSnapshotState.md b/testgen/src/autogen/docs/models/ReplicaSnapshotState.md deleted file mode 100644 index 07a911a20..000000000 --- a/testgen/src/autogen/docs/models/ReplicaSnapshotState.md +++ /dev/null @@ -1,12 +0,0 @@ -# ReplicaSnapshotState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**online** | Option<[**crate::models::OnlineReplicaSnapshotState**](.md)> | Online ReplicaSnapshotState representation. | [optional] -**offline** | Option<[**crate::models::OfflineReplicaSnapshotState**](.md)> | Offline ReplicaSnapshotState representation. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaSnapshotStatus.md b/testgen/src/autogen/docs/models/ReplicaSnapshotStatus.md deleted file mode 100644 index c851c726a..000000000 --- a/testgen/src/autogen/docs/models/ReplicaSnapshotStatus.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReplicaSnapshotStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaSpaceUsage.md b/testgen/src/autogen/docs/models/ReplicaSpaceUsage.md deleted file mode 100644 index 15e728492..000000000 --- a/testgen/src/autogen/docs/models/ReplicaSpaceUsage.md +++ /dev/null @@ -1,17 +0,0 @@ -# ReplicaSpaceUsage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**capacity_bytes** | **u64** | Replica capacity in bytes. | -**allocated_bytes** | **u64** | Amount of actually allocated disk space for this replica in bytes. | -**allocated_bytes_snapshots** | **u64** | Amount of actually allocated disk space for this replica\'s snapshots in bytes. | -**allocated_bytes_all_snapshots** | Option<**u64**> | Amount of actually allocated disk space for this replica\'s snapshots and its predecessors in bytes. For a restored/cloned replica this includes snapshots from the parent source. | [optional] -**cluster_size** | **u64** | Cluster size in bytes. | -**clusters** | **u64** | Total number of clusters. | -**allocated_clusters** | **u64** | Number of actually used clusters. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaSpec.md b/testgen/src/autogen/docs/models/ReplicaSpec.md deleted file mode 100644 index 37af98b8d..000000000 --- a/testgen/src/autogen/docs/models/ReplicaSpec.md +++ /dev/null @@ -1,21 +0,0 @@ -# ReplicaSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**managed** | **bool** | Managed by our control plane | -**operation** | Option<[**crate::models::ReplicaSpecOperation**](.md)> | Record of the operation in progress | [optional] -**owners** | [**crate::models::ReplicaSpecOwners**](.md) | Owner Resource | -**pool** | **String** | The pool that the replica should live on. | -**pool_uuid** | Option<**uuid::Uuid**> | storage pool unique identifier | [optional] -**share** | [**crate::models::Protocol**](.md) | Common Protocol | -**size** | **u64** | The size that the replica should be. | -**status** | [**crate::models::SpecStatus**](.md) | Common base state for a resource | -**thin** | **bool** | Thin provisioning. | -**uuid** | **uuid::Uuid** | uuid of the replica | -**kind** | Option<[**crate::models::ReplicaKind**](.md)> | Type of replica, example regular or snapshot. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaSpecOperation.md b/testgen/src/autogen/docs/models/ReplicaSpecOperation.md deleted file mode 100644 index f08a778a5..000000000 --- a/testgen/src/autogen/docs/models/ReplicaSpecOperation.md +++ /dev/null @@ -1,12 +0,0 @@ -# ReplicaSpecOperation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operation** | [**Operation**](.md) | Record of the operation | -**result** | Option<**bool**> | Result of the operation | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaSpecOwners.md b/testgen/src/autogen/docs/models/ReplicaSpecOwners.md deleted file mode 100644 index 80fdac1a5..000000000 --- a/testgen/src/autogen/docs/models/ReplicaSpecOwners.md +++ /dev/null @@ -1,12 +0,0 @@ -# ReplicaSpecOwners - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nexuses** | [**Vec**](.md) | | -**volume** | Option<**uuid::Uuid**> | | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaState.md b/testgen/src/autogen/docs/models/ReplicaState.md deleted file mode 100644 index fdc2ebfbe..000000000 --- a/testgen/src/autogen/docs/models/ReplicaState.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReplicaState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaTopology.md b/testgen/src/autogen/docs/models/ReplicaTopology.md deleted file mode 100644 index ce292c91c..000000000 --- a/testgen/src/autogen/docs/models/ReplicaTopology.md +++ /dev/null @@ -1,17 +0,0 @@ -# ReplicaTopology - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**node** | Option<**String**> | storage node identifier | [optional] -**pool** | Option<**String**> | storage pool identifier | [optional] -**state** | [**crate::models::ReplicaState**](.md) | state of the replica | -**child_status** | Option<[**crate::models::ChildState**](.md)> | State of a Nexus Child | [optional] -**child_status_reason** | Option<[**crate::models::ChildStateReason**](.md)> | Reason for the state of a Nexus Child | [optional] -**usage** | Option<[**crate::models::ReplicaUsage**](.md)> | Replica space usage information. Useful for capacity management, eg: figure out how much of a thin-provisioned replica is allocated. | [optional] -**rebuild_progress** | Option<**usize**> | current rebuild progress (%) | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ReplicaUsage.md b/testgen/src/autogen/docs/models/ReplicaUsage.md deleted file mode 100644 index dd6642046..000000000 --- a/testgen/src/autogen/docs/models/ReplicaUsage.md +++ /dev/null @@ -1,14 +0,0 @@ -# ReplicaUsage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**capacity** | **u64** | Replica capacity in bytes. | -**allocated** | **u64** | Amount of actually allocated disk space for this replica in bytes. | -**allocated_snapshots** | **u64** | Amount of actually allocated disk space for this replica\'s snapshots in bytes. | -**allocated_all_snapshots** | **u64** | Amount of actually allocated disk space for this replica\'s snapshots and its predecessors in bytes. For a restored/cloned replica this includes snapshots from the parent source. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/ResizeVolumeBody.md b/testgen/src/autogen/docs/models/ResizeVolumeBody.md deleted file mode 100644 index 1c776327f..000000000 --- a/testgen/src/autogen/docs/models/ResizeVolumeBody.md +++ /dev/null @@ -1,11 +0,0 @@ -# ResizeVolumeBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | **u64** | New required size of the volume in bytes | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/RestJsonError.md b/testgen/src/autogen/docs/models/RestJsonError.md deleted file mode 100644 index 30d93f00f..000000000 --- a/testgen/src/autogen/docs/models/RestJsonError.md +++ /dev/null @@ -1,13 +0,0 @@ -# RestJsonError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**details** | **String** | detailed error information | -**message** | **String** | last reported error information | -**kind** | [**Kind**](.md) | error kind | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/RestWatch.md b/testgen/src/autogen/docs/models/RestWatch.md deleted file mode 100644 index 597bc6532..000000000 --- a/testgen/src/autogen/docs/models/RestWatch.md +++ /dev/null @@ -1,12 +0,0 @@ -# RestWatch - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**callback** | **String** | callback used to notify the watch of a change | -**resource** | **String** | id of the resource to watch on | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/SetVolumePropertyBody.md b/testgen/src/autogen/docs/models/SetVolumePropertyBody.md deleted file mode 100644 index f1c9d3fe6..000000000 --- a/testgen/src/autogen/docs/models/SetVolumePropertyBody.md +++ /dev/null @@ -1,11 +0,0 @@ -# SetVolumePropertyBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**max_snapshots** | Option<**u32**> | Max Snapshots limit per volume. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/SnapshotAsSource.md b/testgen/src/autogen/docs/models/SnapshotAsSource.md deleted file mode 100644 index 1eb1810f3..000000000 --- a/testgen/src/autogen/docs/models/SnapshotAsSource.md +++ /dev/null @@ -1,12 +0,0 @@ -# SnapshotAsSource - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**snapshot** | **uuid::Uuid** | | -**volume** | **uuid::Uuid** | | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/SpecStatus.md b/testgen/src/autogen/docs/models/SpecStatus.md deleted file mode 100644 index 8f047646b..000000000 --- a/testgen/src/autogen/docs/models/SpecStatus.md +++ /dev/null @@ -1,10 +0,0 @@ -# SpecStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Specs.md b/testgen/src/autogen/docs/models/Specs.md deleted file mode 100644 index 4429f6205..000000000 --- a/testgen/src/autogen/docs/models/Specs.md +++ /dev/null @@ -1,14 +0,0 @@ -# Specs - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nexuses** | [**Vec**](.md) | Nexus Specs | -**pools** | [**Vec**](.md) | Pool Specs | -**replicas** | [**Vec**](.md) | Replica Specs | -**volumes** | [**Vec**](.md) | Volume Specs | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Topology.md b/testgen/src/autogen/docs/models/Topology.md deleted file mode 100644 index fc0aff511..000000000 --- a/testgen/src/autogen/docs/models/Topology.md +++ /dev/null @@ -1,12 +0,0 @@ -# Topology - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**node_topology** | Option<[**crate::models::NodeTopology**](.md)> | Used to determine how to place/distribute the data during volume creation and replica replacement. If left empty then the control plane will select from all available resources. | [optional] -**pool_topology** | Option<[**crate::models::PoolTopology**](.md)> | Used to determine how to place/distribute the data during volume creation and replica replacement. If left empty then the control plane will select from all available resources. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Volume.md b/testgen/src/autogen/docs/models/Volume.md deleted file mode 100644 index f72e82b66..000000000 --- a/testgen/src/autogen/docs/models/Volume.md +++ /dev/null @@ -1,12 +0,0 @@ -# Volume - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**spec** | [**crate::models::VolumeSpec**](.md) | User specification of a volume. | -**state** | [**crate::models::VolumeState**](.md) | Runtime state of the volume | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeContentSource.md b/testgen/src/autogen/docs/models/VolumeContentSource.md deleted file mode 100644 index 87b9352ef..000000000 --- a/testgen/src/autogen/docs/models/VolumeContentSource.md +++ /dev/null @@ -1,11 +0,0 @@ -# VolumeContentSource - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**snapshot** | Option<[**crate::models::SnapshotAsSource**](.md)> | The snapshot source for the volume content. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumePolicy.md b/testgen/src/autogen/docs/models/VolumePolicy.md deleted file mode 100644 index 1efdbffc2..000000000 --- a/testgen/src/autogen/docs/models/VolumePolicy.md +++ /dev/null @@ -1,11 +0,0 @@ -# VolumePolicy - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**self_heal** | **bool** | If true the control plane will attempt to heal the volume by itself | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeShareProtocol.md b/testgen/src/autogen/docs/models/VolumeShareProtocol.md deleted file mode 100644 index 260711659..000000000 --- a/testgen/src/autogen/docs/models/VolumeShareProtocol.md +++ /dev/null @@ -1,10 +0,0 @@ -# VolumeShareProtocol - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeSnapshot.md b/testgen/src/autogen/docs/models/VolumeSnapshot.md deleted file mode 100644 index 2d9cdc143..000000000 --- a/testgen/src/autogen/docs/models/VolumeSnapshot.md +++ /dev/null @@ -1,12 +0,0 @@ -# VolumeSnapshot - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**definition** | [**crate::models::VolumeSnapshotDefinition**](.md) | Volume Snapshot Metadata and Spec information. | -**state** | [**crate::models::VolumeSnapshotState**](.md) | Volume Snapshot State information. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeSnapshotDefinition.md b/testgen/src/autogen/docs/models/VolumeSnapshotDefinition.md deleted file mode 100644 index eaf140660..000000000 --- a/testgen/src/autogen/docs/models/VolumeSnapshotDefinition.md +++ /dev/null @@ -1,12 +0,0 @@ -# VolumeSnapshotDefinition - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metadata** | [**crate::models::VolumeSnapshotMetadata**](.md) | Volume Snapshot Metadata information. | -**spec** | [**crate::models::VolumeSnapshotSpec**](.md) | Volume Snapshot Spec information. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeSnapshotMetadata.md b/testgen/src/autogen/docs/models/VolumeSnapshotMetadata.md deleted file mode 100644 index 6db671028..000000000 --- a/testgen/src/autogen/docs/models/VolumeSnapshotMetadata.md +++ /dev/null @@ -1,19 +0,0 @@ -# VolumeSnapshotMetadata - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**crate::models::SpecStatus**](.md) | Common base state for a resource | -**timestamp** | Option<**String**> | Timestamp when snapshot is taken on the storage system. | [optional] -**size** | **u64** | Size in bytes of the snapshot (which is equivalent to its source size). | -**spec_size** | **u64** | Spec size in bytes of the snapshot (which is equivalent to its source spec size). | -**total_allocated_size** | **u64** | Size in bytes taken by the snapshot and its predecessors. | -**txn_id** | **String** | | -**transactions** | [**::std::collections::HashMap>**](.md) | | -**num_restores** | **u32** | Number of restores done from this snapshot. | -**num_snapshot_replicas** | **u32** | Number of snapshot replicas for a volumesnapshot. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeSnapshotSpec.md b/testgen/src/autogen/docs/models/VolumeSnapshotSpec.md deleted file mode 100644 index 4ab8818d9..000000000 --- a/testgen/src/autogen/docs/models/VolumeSnapshotSpec.md +++ /dev/null @@ -1,12 +0,0 @@ -# VolumeSnapshotSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **uuid::Uuid** | | -**source_volume** | **uuid::Uuid** | | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeSnapshotState.md b/testgen/src/autogen/docs/models/VolumeSnapshotState.md deleted file mode 100644 index f0fd0f190..000000000 --- a/testgen/src/autogen/docs/models/VolumeSnapshotState.md +++ /dev/null @@ -1,16 +0,0 @@ -# VolumeSnapshotState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **uuid::Uuid** | | -**allocated_size** | **u64** | Runtime size in bytes of the snapshot. Equal to the volume allocation at the time of the snapshot creation. It may grow larger if any of its predecessors are deleted. | -**source_volume** | **uuid::Uuid** | | -**timestamp** | Option<**String**> | Timestamp when snapshot is taken on the storage system. | [optional] -**ready_as_source** | **bool** | Indicates if a snapshot is ready to be used as a new volume source. | -**replica_snapshots** | [**Vec**](.md) | List of individual ReplicaSnapshotStates. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeSnapshots.md b/testgen/src/autogen/docs/models/VolumeSnapshots.md deleted file mode 100644 index 17f70da93..000000000 --- a/testgen/src/autogen/docs/models/VolumeSnapshots.md +++ /dev/null @@ -1,12 +0,0 @@ -# VolumeSnapshots - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**entries** | [**Vec**](.md) | | -**next_token** | Option<**isize**> | | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeSpec.md b/testgen/src/autogen/docs/models/VolumeSpec.md deleted file mode 100644 index 96376990a..000000000 --- a/testgen/src/autogen/docs/models/VolumeSpec.md +++ /dev/null @@ -1,25 +0,0 @@ -# VolumeSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**labels** | Option<[**::std::collections::HashMap**](.md)> | Optionally used to store custom volume information | [optional] -**num_replicas** | **u8** | Number of children the volume should have. | -**operation** | Option<[**crate::models::VolumeSpecOperation**](.md)> | Record of the operation in progress | [optional] -**size** | **u64** | Size that the volume should be. | -**status** | [**crate::models::SpecStatus**](.md) | Common base state for a resource | -**target** | Option<[**crate::models::VolumeTarget**](.md)> | Specification of a volume target | [optional] -**uuid** | **uuid::Uuid** | Volume Id | -**topology** | Option<[**crate::models::Topology**](.md)> | node and pool topology for volumes | [optional] -**policy** | [**crate::models::VolumePolicy**](.md) | Volume policy used to determine if and how to replace a replica | -**thin** | **bool** | Thin provisioning flag. | -**as_thin** | Option<**bool**> | Volume converted to thin provisioned. | [optional] -**affinity_group** | Option<[**crate::models::AffinityGroup**](.md)> | Affinity Group related information. | [optional] -**content_source** | Option<[**crate::models::VolumeContentSource**](.md)> | Volume Content Source i.e the snapshot or the volume. | [optional] -**num_snapshots** | **u32** | Number of snapshots taken on this volume. | -**max_snapshots** | Option<**u32**> | Max snapshots to limit per volume. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeSpecOperation.md b/testgen/src/autogen/docs/models/VolumeSpecOperation.md deleted file mode 100644 index ccacc2767..000000000 --- a/testgen/src/autogen/docs/models/VolumeSpecOperation.md +++ /dev/null @@ -1,12 +0,0 @@ -# VolumeSpecOperation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operation** | [**Operation**](.md) | Record of the operation | -**result** | Option<**bool**> | Result of the operation | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeState.md b/testgen/src/autogen/docs/models/VolumeState.md deleted file mode 100644 index 27363e40e..000000000 --- a/testgen/src/autogen/docs/models/VolumeState.md +++ /dev/null @@ -1,16 +0,0 @@ -# VolumeState - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**target** | Option<[**crate::models::Nexus**](.md)> | target exposed via a Nexus | [optional] -**size** | **u64** | size of the volume in bytes | -**status** | [**crate::models::VolumeStatus**](.md) | current volume status | -**uuid** | **uuid::Uuid** | name of the volume | -**replica_topology** | [**::std::collections::HashMap**](.md) | replica topology information | -**usage** | Option<[**crate::models::VolumeUsage**](.md)> | Volume space usage | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeStatus.md b/testgen/src/autogen/docs/models/VolumeStatus.md deleted file mode 100644 index 1dd8b1a9d..000000000 --- a/testgen/src/autogen/docs/models/VolumeStatus.md +++ /dev/null @@ -1,10 +0,0 @@ -# VolumeStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeTarget.md b/testgen/src/autogen/docs/models/VolumeTarget.md deleted file mode 100644 index 1e0ab0ca8..000000000 --- a/testgen/src/autogen/docs/models/VolumeTarget.md +++ /dev/null @@ -1,13 +0,0 @@ -# VolumeTarget - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**node** | **String** | The node where front-end IO will be sent to | -**protocol** | Option<[**crate::models::VolumeShareProtocol**](.md)> | Volume Share Protocol | [optional] -**frontend_nodes** | Option<[**Vec**](.md)> | The nodes where the front-end workload resides. If the workload moves then the volume must be republished. | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/VolumeUsage.md b/testgen/src/autogen/docs/models/VolumeUsage.md deleted file mode 100644 index b19603eb6..000000000 --- a/testgen/src/autogen/docs/models/VolumeUsage.md +++ /dev/null @@ -1,18 +0,0 @@ -# VolumeUsage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**capacity** | **u64** | Capacity of the volume in bytes. | -**allocated** | **u64** | -| Allocated size in bytes, related the largest healthy replica, including snapshots. For example, if a volume has 2 replicas, each with 1MiB allocated space, then this field will be 1MiB. | -**allocated_replica** | **u64** | -| Allocated size in bytes, related to the largest healthy replica, excluding snapshots. | -**allocated_snapshots** | **u64** | -| Allocated size in bytes, related the healthy replica with the highest snapshot usage. | -**allocated_all_snapshots** | **u64** | -| For a restored/cloned volume, allocated size in bytes, related to the healthy replica with largest parent snapshot allocation. | -**total_allocated** | **u64** | -| Allocated size in bytes, accrued from all the replicas, including snapshots. For example, if a volume has 2 replicas, each with 1MiB allocated space, then this field will be 2MiB. | -**total_allocated_replicas** | [**serde_json::Value**](.md) | -| Allocated size in bytes, accrued from all the replicas, excluding snapshots. | -**total_allocated_snapshots** | **u64** | -| Allocated size in bytes, accrued from all the replica\'s snapshots. | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/Volumes.md b/testgen/src/autogen/docs/models/Volumes.md deleted file mode 100644 index 058ad52e6..000000000 --- a/testgen/src/autogen/docs/models/Volumes.md +++ /dev/null @@ -1,12 +0,0 @@ -# Volumes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**entries** | [**Vec**](.md) | | -**next_token** | Option<**isize**> | | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/docs/models/WatchCallback.md b/testgen/src/autogen/docs/models/WatchCallback.md deleted file mode 100644 index 6982b34f7..000000000 --- a/testgen/src/autogen/docs/models/WatchCallback.md +++ /dev/null @@ -1,11 +0,0 @@ -# WatchCallback - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uri** | Option<**String**> | | [optional] - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/testgen/src/autogen/mod.rs b/testgen/src/autogen/mod.rs deleted file mode 100644 index 2ad74474f..000000000 --- a/testgen/src/autogen/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -#[macro_use] -extern crate serde_derive; - -extern crate serde; -extern crate serde_json; -extern crate url; - -pub mod apis; -pub mod models; -pub mod clients; - -#[cfg(feature = "tower-hyper")] -pub mod tower { - pub use crate::clients::tower as client; -} - -#[cfg(feature = "actix")] -pub mod actix { - #[cfg(feature = "actix-client")] - pub use crate::clients::actix as client; - - #[cfg(feature = "actix-server")] - pub use crate::apis::actix_server as server; -} \ No newline at end of file diff --git a/testgen/src/autogen/models/affinity_group.rs b/testgen/src/autogen/models/affinity_group.rs deleted file mode 100644 index 40b09e6ad..000000000 --- a/testgen/src/autogen/models/affinity_group.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// AffinityGroup : Affinity Group related information. - - - - - - - - -/// Affinity Group related information. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct AffinityGroup { - - /// Identification of the Affinity Group. - #[serde(default, rename = "id")] - pub id: String, - -} - -impl AffinityGroup { - /// AffinityGroup using only the required fields - pub fn new(id: impl Into) -> AffinityGroup { - AffinityGroup { - id: id.into(), - - } - } - /// AffinityGroup using all fields - pub fn new_all(id: impl Into) -> AffinityGroup { - AffinityGroup { - id: id.into(), - - } - } -} - - - - - - - - - - diff --git a/testgen/src/autogen/models/app_node.rs b/testgen/src/autogen/models/app_node.rs deleted file mode 100644 index db2a36762..000000000 --- a/testgen/src/autogen/models/app_node.rs +++ /dev/null @@ -1,68 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// AppNode : Represents an application node, which connects to the target node via a share protocol (eg: nvmf). - - - - - - - - -/// Represents an application node, which connects to the target node via a share protocol (eg: nvmf). - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct AppNode { - - /// App node identifier. - #[serde(default, rename = "id")] - pub id: String, - - /// App node attributes. - #[serde(default, rename = "spec")] - pub spec: crate::models::AppNodeSpec, - - /// Deemed state of the app node. - #[serde(default, rename = "state", skip_serializing_if = "Option::is_none")] - pub state: Option, - -} - -impl AppNode { - /// AppNode using only the required fields - pub fn new(id: impl Into, spec: impl Into) -> AppNode { - AppNode { - id: id.into(), - spec: spec.into(), - state: None, - - } - } - /// AppNode using all fields - pub fn new_all(id: impl Into, spec: impl Into, state: impl Into>) -> AppNode { - AppNode { - id: id.into(), - spec: spec.into(), - state: state.into(), - - } - } -} - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/app_node_spec.rs b/testgen/src/autogen/models/app_node_spec.rs deleted file mode 100644 index 5a0f52aa5..000000000 --- a/testgen/src/autogen/models/app_node_spec.rs +++ /dev/null @@ -1,68 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// AppNodeSpec : App node attributes. - - - - - - - - -/// App node attributes. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct AppNodeSpec { - - /// App node identifier. - #[serde(default, rename = "id")] - pub id: String, - - /// gRPC server endpoint of the app node. - #[serde(default, rename = "endpoint")] - pub endpoint: String, - - /// Labels to be set on the app node. - #[serde(default, rename = "labels", skip_serializing_if = "Option::is_none")] - pub labels: Option<::std::collections::HashMap>, - -} - -impl AppNodeSpec { - /// AppNodeSpec using only the required fields - pub fn new(id: impl Into, endpoint: impl Into) -> AppNodeSpec { - AppNodeSpec { - id: id.into(), - endpoint: endpoint.into(), - labels: None, - - } - } - /// AppNodeSpec using all fields - pub fn new_all(id: impl Into, endpoint: impl Into, labels: impl Into>>) -> AppNodeSpec { - AppNodeSpec { - id: id.into(), - endpoint: endpoint.into(), - labels: labels.into(), - - } - } -} - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/app_node_state.rs b/testgen/src/autogen/models/app_node_state.rs deleted file mode 100644 index 6b516996a..000000000 --- a/testgen/src/autogen/models/app_node_state.rs +++ /dev/null @@ -1,89 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// AppNodeState : Deemed state of the app node. - - - - - - - - -/// Deemed state of the app node. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct AppNodeState { - - /// App node identifier. - #[serde(default, rename = "id")] - pub id: String, - - /// gRPC server endpoint of the app node. - #[serde(default, rename = "endpoint")] - pub endpoint: String, - - /// Deemed Status of the app node. - #[serde(default, rename = "status")] - pub status: Status, - -} - -impl AppNodeState { - /// AppNodeState using only the required fields - pub fn new(id: impl Into, endpoint: impl Into, status: impl Into) -> AppNodeState { - AppNodeState { - id: id.into(), - endpoint: endpoint.into(), - status: status.into(), - - } - } - /// AppNodeState using all fields - pub fn new_all(id: impl Into, endpoint: impl Into, status: impl Into) -> AppNodeState { - AppNodeState { - id: id.into(), - endpoint: endpoint.into(), - status: status.into(), - - } - } -} - - - - - - - - - - - - -/// Deemed Status of the app node. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - - - #[serde(rename = "Online")] - Online, - - #[serde(rename = "Offline")] - Offline, - - -} - -impl Default for Status { - fn default() -> Self { - Self::Online - } -} - - - - diff --git a/testgen/src/autogen/models/app_nodes.rs b/testgen/src/autogen/models/app_nodes.rs deleted file mode 100644 index 158661d76..000000000 --- a/testgen/src/autogen/models/app_nodes.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// AppNodes : Array of app nodes plus the next token for subsequent get requests when using pagination. - - - - - - - - -/// Array of app nodes plus the next token for subsequent get requests when using pagination. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct AppNodes { - - - #[serde(default, rename = "entries")] - pub entries: Vec, - - - #[serde(default, rename = "next_token", skip_serializing_if = "Option::is_none")] - pub next_token: Option, - -} - -impl AppNodes { - /// AppNodes using only the required fields - pub fn new(entries: impl IntoVec) -> AppNodes { - AppNodes { - entries: entries.into_vec(), - next_token: None, - - } - } - /// AppNodes using all fields - pub fn new_all(entries: impl IntoVec, next_token: impl Into>) -> AppNodes { - AppNodes { - entries: entries.into_vec(), - next_token: next_token.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/block_device.rs b/testgen/src/autogen/models/block_device.rs deleted file mode 100644 index 866fc16e0..000000000 --- a/testgen/src/autogen/models/block_device.rs +++ /dev/null @@ -1,148 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// BlockDevice : Block device information - - - - - - - - -/// Block device information - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct BlockDevice { - - /// identifies if device is available for use (ie. is not \"currently\" in use) - #[serde(default, rename = "available")] - pub available: bool, - - /// the type of bus through which the device is connected to the system - #[serde(default, rename = "connection_type")] - pub connection_type: String, - - /// list of udev generated symlinks by which device may be identified - #[serde(default, rename = "devlinks")] - pub devlinks: Vec, - - /// major device number - #[serde(default, rename = "devmajor")] - pub devmajor: i32, - - /// minor device number - #[serde(default, rename = "devminor")] - pub devminor: i32, - - /// entry in /dev associated with device - #[serde(default, rename = "devname")] - pub devname: String, - - /// official device path - #[serde(default, rename = "devpath")] - pub devpath: String, - - /// currently \"disk\" or \"partition\" - #[serde(default, rename = "devtype")] - pub devtype: String, - - /// filesystem information in case where a filesystem is present - #[serde(default, rename = "filesystem", skip_serializing_if = "Option::is_none")] - pub filesystem: Option, - - /// indicates whether the device is rotational or non-rotational - #[serde(default, rename = "is_rotational", skip_serializing_if = "Option::is_none")] - pub is_rotational: Option, - - /// device model - useful for identifying devices - #[serde(default, rename = "model")] - pub model: String, - - /// partition information in case where device represents a partition - #[serde(default, rename = "partition", skip_serializing_if = "Option::is_none")] - pub partition: Option, - - /// size of device in (512 byte) blocks - #[serde(default, rename = "size")] - pub size: u64, - -} - -impl BlockDevice { - /// BlockDevice using only the required fields - pub fn new(available: impl Into, connection_type: impl Into, devlinks: impl IntoVec, devmajor: impl Into, devminor: impl Into, devname: impl Into, devpath: impl Into, devtype: impl Into, model: impl Into, size: impl Into) -> BlockDevice { - BlockDevice { - available: available.into(), - connection_type: connection_type.into(), - devlinks: devlinks.into_vec(), - devmajor: devmajor.into(), - devminor: devminor.into(), - devname: devname.into(), - devpath: devpath.into(), - devtype: devtype.into(), - filesystem: None, - is_rotational: None, - model: model.into(), - partition: None, - size: size.into(), - - } - } - /// BlockDevice using all fields - pub fn new_all(available: impl Into, connection_type: impl Into, devlinks: impl IntoVec, devmajor: impl Into, devminor: impl Into, devname: impl Into, devpath: impl Into, devtype: impl Into, filesystem: impl Into>, is_rotational: impl Into>, model: impl Into, partition: impl Into>, size: impl Into) -> BlockDevice { - BlockDevice { - available: available.into(), - connection_type: connection_type.into(), - devlinks: devlinks.into_vec(), - devmajor: devmajor.into(), - devminor: devminor.into(), - devname: devname.into(), - devpath: devpath.into(), - devtype: devtype.into(), - filesystem: filesystem.into(), - is_rotational: is_rotational.into(), - model: model.into(), - partition: partition.into(), - size: size.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/block_device_filesystem.rs b/testgen/src/autogen/models/block_device_filesystem.rs deleted file mode 100644 index dd6da59d1..000000000 --- a/testgen/src/autogen/models/block_device_filesystem.rs +++ /dev/null @@ -1,76 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// BlockDeviceFilesystem : filesystem information in case where a filesystem is present - - - - - - - - -/// filesystem information in case where a filesystem is present - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct BlockDeviceFilesystem { - - /// filesystem type: ext3, ntfs, ... - #[serde(default, rename = "fstype")] - pub fstype: String, - - /// volume label - #[serde(default, rename = "label")] - pub label: String, - - /// path where filesystem is currently mounted - #[serde(default, rename = "mountpoint")] - pub mountpoint: String, - - /// UUID identifying the volume (filesystem) - #[serde(default, rename = "uuid")] - pub uuid: String, - -} - -impl BlockDeviceFilesystem { - /// BlockDeviceFilesystem using only the required fields - pub fn new(fstype: impl Into, label: impl Into, mountpoint: impl Into, uuid: impl Into) -> BlockDeviceFilesystem { - BlockDeviceFilesystem { - fstype: fstype.into(), - label: label.into(), - mountpoint: mountpoint.into(), - uuid: uuid.into(), - - } - } - /// BlockDeviceFilesystem using all fields - pub fn new_all(fstype: impl Into, label: impl Into, mountpoint: impl Into, uuid: impl Into) -> BlockDeviceFilesystem { - BlockDeviceFilesystem { - fstype: fstype.into(), - label: label.into(), - mountpoint: mountpoint.into(), - uuid: uuid.into(), - - } - } -} - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/block_device_partition.rs b/testgen/src/autogen/models/block_device_partition.rs deleted file mode 100644 index b53bd4897..000000000 --- a/testgen/src/autogen/models/block_device_partition.rs +++ /dev/null @@ -1,92 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// BlockDevicePartition : partition information in case where device represents a partition - - - - - - - - -/// partition information in case where device represents a partition - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct BlockDevicePartition { - - /// partition name - #[serde(default, rename = "name")] - pub name: String, - - /// partition number - #[serde(default, rename = "number")] - pub number: i32, - - /// devname of parent device to which this partition belongs - #[serde(default, rename = "parent")] - pub parent: String, - - /// partition scheme: gpt, dos, ... - #[serde(default, rename = "scheme")] - pub scheme: String, - - /// partition type identifier - #[serde(default, rename = "typeid")] - pub typeid: String, - - /// UUID identifying partition - #[serde(default, rename = "uuid")] - pub uuid: String, - -} - -impl BlockDevicePartition { - /// BlockDevicePartition using only the required fields - pub fn new(name: impl Into, number: impl Into, parent: impl Into, scheme: impl Into, typeid: impl Into, uuid: impl Into) -> BlockDevicePartition { - BlockDevicePartition { - name: name.into(), - number: number.into(), - parent: parent.into(), - scheme: scheme.into(), - typeid: typeid.into(), - uuid: uuid.into(), - - } - } - /// BlockDevicePartition using all fields - pub fn new_all(name: impl Into, number: impl Into, parent: impl Into, scheme: impl Into, typeid: impl Into, uuid: impl Into) -> BlockDevicePartition { - BlockDevicePartition { - name: name.into(), - number: number.into(), - parent: parent.into(), - scheme: scheme.into(), - typeid: typeid.into(), - uuid: uuid.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/child.rs b/testgen/src/autogen/models/child.rs deleted file mode 100644 index cdaf80b22..000000000 --- a/testgen/src/autogen/models/child.rs +++ /dev/null @@ -1,76 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Child : Child information - - - - - - - - -/// Child information - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct Child { - - /// current rebuild progress (%) - #[serde(default, rename = "rebuildProgress", skip_serializing_if = "Option::is_none")] - pub rebuild_progress: Option, - - /// State of a Nexus Child - #[serde(default, rename = "state")] - pub state: crate::models::ChildState, - - /// Reason for the state of a Nexus Child - #[serde(default, rename = "state_reason", skip_serializing_if = "Option::is_none")] - pub state_reason: Option, - - /// uri of the child device - #[serde(default, rename = "uri")] - pub uri: String, - -} - -impl Child { - /// Child using only the required fields - pub fn new(state: impl Into, uri: impl Into) -> Child { - Child { - rebuild_progress: None, - state: state.into(), - state_reason: None, - uri: uri.into(), - - } - } - /// Child using all fields - pub fn new_all(rebuild_progress: impl Into>, state: impl Into, state_reason: impl Into>, uri: impl Into) -> Child { - Child { - rebuild_progress: rebuild_progress.into(), - state: state.into(), - state_reason: state_reason.into(), - uri: uri.into(), - - } - } -} - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/child_state.rs b/testgen/src/autogen/models/child_state.rs deleted file mode 100644 index 2ada9d8a0..000000000 --- a/testgen/src/autogen/models/child_state.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ChildState : State of a Nexus Child - - - -/// State of a Nexus Child -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ChildState { - - - #[serde(rename = "Unknown")] - Unknown, - - #[serde(rename = "Online")] - Online, - - #[serde(rename = "Degraded")] - Degraded, - - #[serde(rename = "Faulted")] - Faulted, - -} - -impl ToString for ChildState { - fn to_string(&self) -> String { - match self { - - - Self::Unknown => String::from("Unknown"), - - Self::Online => String::from("Online"), - - Self::Degraded => String::from("Degraded"), - - Self::Faulted => String::from("Faulted"), - - - } - } -} - -impl Default for ChildState { - fn default() -> Self { - Self::Unknown - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/child_state_reason.rs b/testgen/src/autogen/models/child_state_reason.rs deleted file mode 100644 index 7ac9ec63d..000000000 --- a/testgen/src/autogen/models/child_state_reason.rs +++ /dev/null @@ -1,46 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ChildStateReason : Reason for the state of a Nexus Child - - - -/// Reason for the state of a Nexus Child -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ChildStateReason { - - - #[serde(rename = "OutOfSpace")] - OutOfSpace, - -} - -impl ToString for ChildStateReason { - fn to_string(&self) -> String { - match self { - - - Self::OutOfSpace => String::from("OutOfSpace"), - - - } - } -} - -impl Default for ChildStateReason { - fn default() -> Self { - Self::OutOfSpace - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/cordon_drain_state.rs b/testgen/src/autogen/models/cordon_drain_state.rs deleted file mode 100644 index 03e3c322a..000000000 --- a/testgen/src/autogen/models/cordon_drain_state.rs +++ /dev/null @@ -1,49 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// CordonDrainState : The drain state - - - - - - - - -/// The drain state - - - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -pub enum CordonDrainState { - - /// The item is cordoned - #[serde(rename = "cordonedstate")] - cordonedstate(crate::models::CordonedState), - - /// The item is draining - #[serde(rename = "drainingstate")] - drainingstate(crate::models::DrainState), - - /// The item is draining - #[serde(rename = "drainedstate")] - drainedstate(crate::models::DrainState), - -} - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/cordoned_state.rs b/testgen/src/autogen/models/cordoned_state.rs deleted file mode 100644 index 694f7bbae..000000000 --- a/testgen/src/autogen/models/cordoned_state.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// CordonedState : The item is cordoned - - - - - - - - -/// The item is cordoned - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct CordonedState { - - - #[serde(default, rename = "cordonlabels")] - pub cordonlabels: Vec, - -} - -impl CordonedState { - /// CordonedState using only the required fields - pub fn new(cordonlabels: impl IntoVec) -> CordonedState { - CordonedState { - cordonlabels: cordonlabels.into_vec(), - - } - } - /// CordonedState using all fields - pub fn new_all(cordonlabels: impl IntoVec) -> CordonedState { - CordonedState { - cordonlabels: cordonlabels.into_vec(), - - } - } -} - - - - - - - - - - diff --git a/testgen/src/autogen/models/create_nexus_body.rs b/testgen/src/autogen/models/create_nexus_body.rs deleted file mode 100644 index 4e3101dbe..000000000 --- a/testgen/src/autogen/models/create_nexus_body.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// CreateNexusBody : Create Nexus Body - - - - - - - - -/// Create Nexus Body - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct CreateNexusBody { - - /// replica can be iscsi and nvmf remote targets or a local spdk bdev (i.e. bdev:///name-of-the-bdev). uris to the targets we connect to - #[serde(default, rename = "children")] - pub children: Vec, - - /// size of the device in bytes - #[serde(default, rename = "size")] - pub size: u64, - -} - -impl CreateNexusBody { - /// CreateNexusBody using only the required fields - pub fn new(children: impl IntoVec, size: impl Into) -> CreateNexusBody { - CreateNexusBody { - children: children.into_vec(), - size: size.into(), - - } - } - /// CreateNexusBody using all fields - pub fn new_all(children: impl IntoVec, size: impl Into) -> CreateNexusBody { - CreateNexusBody { - children: children.into_vec(), - size: size.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/create_pool_body.rs b/testgen/src/autogen/models/create_pool_body.rs deleted file mode 100644 index 5c2994a34..000000000 --- a/testgen/src/autogen/models/create_pool_body.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// CreatePoolBody : Create Pool Body - - - - - - - - -/// Create Pool Body - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct CreatePoolBody { - - /// disk device paths or URIs to be claimed by the pool - #[serde(default, rename = "disks")] - pub disks: Vec, - - /// labels to be set on the pools - #[serde(default, rename = "labels", skip_serializing_if = "Option::is_none")] - pub labels: Option<::std::collections::HashMap>, - -} - -impl CreatePoolBody { - /// CreatePoolBody using only the required fields - pub fn new(disks: impl IntoVec) -> CreatePoolBody { - CreatePoolBody { - disks: disks.into_vec(), - labels: None, - - } - } - /// CreatePoolBody using all fields - pub fn new_all(disks: impl IntoVec, labels: impl Into>>) -> CreatePoolBody { - CreatePoolBody { - disks: disks.into_vec(), - labels: labels.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/create_replica_body.rs b/testgen/src/autogen/models/create_replica_body.rs deleted file mode 100644 index 44cc320fa..000000000 --- a/testgen/src/autogen/models/create_replica_body.rs +++ /dev/null @@ -1,76 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// CreateReplicaBody : Create Replica Body - - - - - - - - -/// Create Replica Body - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct CreateReplicaBody { - - /// Replica Share Protocol - #[serde(default, rename = "share", skip_serializing_if = "Option::is_none")] - pub share: Option, - - - #[serde(default, rename = "allowed-hosts", skip_serializing_if = "Option::is_none")] - pub allowed_hosts: Option>, - - /// size of the replica in bytes - #[serde(default, rename = "size")] - pub size: u64, - - /// thin provisioning - #[serde(default, rename = "thin")] - pub thin: bool, - -} - -impl CreateReplicaBody { - /// CreateReplicaBody using only the required fields - pub fn new(size: impl Into, thin: impl Into) -> CreateReplicaBody { - CreateReplicaBody { - share: None, - allowed_hosts: None, - size: size.into(), - thin: thin.into(), - - } - } - /// CreateReplicaBody using all fields - pub fn new_all(share: impl Into>, allowed_hosts: impl IntoOptVec, size: impl Into, thin: impl Into) -> CreateReplicaBody { - CreateReplicaBody { - share: share.into(), - allowed_hosts: allowed_hosts.into_opt_vec(), - size: size.into(), - thin: thin.into(), - - } - } -} - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/create_volume_body.rs b/testgen/src/autogen/models/create_volume_body.rs deleted file mode 100644 index d173442e2..000000000 --- a/testgen/src/autogen/models/create_volume_body.rs +++ /dev/null @@ -1,108 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// CreateVolumeBody : Create Volume Body - - - - - - - - -/// Create Volume Body - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct CreateVolumeBody { - - /// Volume policy used to determine if and how to replace a replica - #[serde(default, rename = "policy")] - pub policy: crate::models::VolumePolicy, - - /// number of storage replicas - #[serde(default, rename = "replicas")] - pub replicas: u8, - - /// size of the volume in bytes - #[serde(default, rename = "size")] - pub size: u64, - - /// flag indicating whether or not the volume is thin provisioned - #[serde(default, rename = "thin")] - pub thin: bool, - - /// node and pool topology for volumes - #[serde(default, rename = "topology", skip_serializing_if = "Option::is_none")] - pub topology: Option, - - /// Optionally used to store custom volume information - #[serde(default, rename = "labels", skip_serializing_if = "Option::is_none")] - pub labels: Option<::std::collections::HashMap>, - - /// Affinity Group related information. - #[serde(default, rename = "affinity_group", skip_serializing_if = "Option::is_none")] - pub affinity_group: Option, - - /// Max Snapshots limit per volume. - #[serde(default, rename = "max_snapshots", skip_serializing_if = "Option::is_none")] - pub max_snapshots: Option, - -} - -impl CreateVolumeBody { - /// CreateVolumeBody using only the required fields - pub fn new(policy: impl Into, replicas: impl Into, size: impl Into, thin: impl Into) -> CreateVolumeBody { - CreateVolumeBody { - policy: policy.into(), - replicas: replicas.into(), - size: size.into(), - thin: thin.into(), - topology: None, - labels: None, - affinity_group: None, - max_snapshots: None, - - } - } - /// CreateVolumeBody using all fields - pub fn new_all(policy: impl Into, replicas: impl Into, size: impl Into, thin: impl Into, topology: impl Into>, labels: impl Into>>, affinity_group: impl Into>, max_snapshots: impl Into>) -> CreateVolumeBody { - CreateVolumeBody { - policy: policy.into(), - replicas: replicas.into(), - size: size.into(), - thin: thin.into(), - topology: topology.into(), - labels: labels.into(), - affinity_group: affinity_group.into(), - max_snapshots: max_snapshots.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/drain_state.rs b/testgen/src/autogen/models/drain_state.rs deleted file mode 100644 index 9b6c098e0..000000000 --- a/testgen/src/autogen/models/drain_state.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// DrainState : The item is draining - - - - - - - - -/// The item is draining - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct DrainState { - - - #[serde(default, rename = "cordonlabels")] - pub cordonlabels: Vec, - - - #[serde(default, rename = "drainlabels")] - pub drainlabels: Vec, - -} - -impl DrainState { - /// DrainState using only the required fields - pub fn new(cordonlabels: impl IntoVec, drainlabels: impl IntoVec) -> DrainState { - DrainState { - cordonlabels: cordonlabels.into_vec(), - drainlabels: drainlabels.into_vec(), - - } - } - /// DrainState using all fields - pub fn new_all(cordonlabels: impl IntoVec, drainlabels: impl IntoVec) -> DrainState { - DrainState { - cordonlabels: cordonlabels.into_vec(), - drainlabels: drainlabels.into_vec(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/explicit_node_topology.rs b/testgen/src/autogen/models/explicit_node_topology.rs deleted file mode 100644 index 32dfab530..000000000 --- a/testgen/src/autogen/models/explicit_node_topology.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ExplicitNodeTopology : volume topology, explicitly selected - - - - - - - - -/// volume topology, explicitly selected - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct ExplicitNodeTopology { - - /// replicas can only be placed on these nodes - #[serde(default, rename = "allowed_nodes")] - pub allowed_nodes: Vec, - - /// preferred nodes to place the replicas - #[serde(default, rename = "preferred_nodes")] - pub preferred_nodes: Vec, - -} - -impl ExplicitNodeTopology { - /// ExplicitNodeTopology using only the required fields - pub fn new(allowed_nodes: impl IntoVec, preferred_nodes: impl IntoVec) -> ExplicitNodeTopology { - ExplicitNodeTopology { - allowed_nodes: allowed_nodes.into_vec(), - preferred_nodes: preferred_nodes.into_vec(), - - } - } - /// ExplicitNodeTopology using all fields - pub fn new_all(allowed_nodes: impl IntoVec, preferred_nodes: impl IntoVec) -> ExplicitNodeTopology { - ExplicitNodeTopology { - allowed_nodes: allowed_nodes.into_vec(), - preferred_nodes: preferred_nodes.into_vec(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/labelled_topology.rs b/testgen/src/autogen/models/labelled_topology.rs deleted file mode 100644 index 0edd48042..000000000 --- a/testgen/src/autogen/models/labelled_topology.rs +++ /dev/null @@ -1,68 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// LabelledTopology : labelled topology - - - - - - - - -/// labelled topology - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct LabelledTopology { - - /// Excludes resources with the same $label name, eg: \"Zone\" would not allow for resources with the same \"Zone\" value to be used for a certain operation, eg: A node with \"Zone: A\" would not be paired up with a node with \"Zone: A\", but it could be paired up with a node with \"Zone: B\" exclusive label NAME in the form \"NAME\", and not \"NAME: VALUE\" - #[serde(default, rename = "exclusion")] - pub exclusion: ::std::collections::HashMap, - - /// Includes resources with the same $label or $label:$value eg: if label is \"Zone: A\": A resource with \"Zone: A\" would be paired up with a resource with \"Zone: A\", but not with a resource with \"Zone: B\" if label is \"Zone\": A resource with \"Zone: A\" would be paired up with a resource with \"Zone: B\", but not with a resource with \"OtherLabel: B\" inclusive label key value in the form \"NAME: VALUE\" - #[serde(default, rename = "inclusion")] - pub inclusion: ::std::collections::HashMap, - - /// This feature includes resources with identical $label keys. For example, if the affinity key is set to \"Zone\": Initially, a resource that matches the label is selected, example \"Zone: A\". Subsequently, all other resources must match the given label \"Zone: A\", effectively adding this requirement as an inclusion label. - #[serde(default, rename = "affinitykey")] - pub affinitykey: Vec, - -} - -impl LabelledTopology { - /// LabelledTopology using only the required fields - pub fn new(exclusion: impl Into<::std::collections::HashMap>, inclusion: impl Into<::std::collections::HashMap>, affinitykey: impl IntoVec) -> LabelledTopology { - LabelledTopology { - exclusion: exclusion.into(), - inclusion: inclusion.into(), - affinitykey: affinitykey.into_vec(), - - } - } - /// LabelledTopology using all fields - pub fn new_all(exclusion: impl Into<::std::collections::HashMap>, inclusion: impl Into<::std::collections::HashMap>, affinitykey: impl IntoVec) -> LabelledTopology { - LabelledTopology { - exclusion: exclusion.into(), - inclusion: inclusion.into(), - affinitykey: affinitykey.into_vec(), - - } - } -} - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/mod.rs b/testgen/src/autogen/models/mod.rs deleted file mode 100644 index 24f0eb4eb..000000000 --- a/testgen/src/autogen/models/mod.rs +++ /dev/null @@ -1,248 +0,0 @@ - - -pub mod affinity_group; -pub use self::affinity_group::AffinityGroup; - -pub mod app_node; -pub use self::app_node::AppNode; - -pub mod app_node_spec; -pub use self::app_node_spec::AppNodeSpec; - -pub mod app_node_state; -pub use self::app_node_state::AppNodeState; - -pub mod app_nodes; -pub use self::app_nodes::AppNodes; - -pub mod block_device; -pub use self::block_device::BlockDevice; - -pub mod block_device_filesystem; -pub use self::block_device_filesystem::BlockDeviceFilesystem; - -pub mod block_device_partition; -pub use self::block_device_partition::BlockDevicePartition; - -pub mod child; -pub use self::child::Child; - -pub mod child_state; -pub use self::child_state::ChildState; - -pub mod child_state_reason; -pub use self::child_state_reason::ChildStateReason; - -pub mod cordon_drain_state; -pub use self::cordon_drain_state::CordonDrainState; - -pub mod cordoned_state; -pub use self::cordoned_state::CordonedState; - -pub mod create_nexus_body; -pub use self::create_nexus_body::CreateNexusBody; - -pub mod create_pool_body; -pub use self::create_pool_body::CreatePoolBody; - -pub mod create_replica_body; -pub use self::create_replica_body::CreateReplicaBody; - -pub mod create_volume_body; -pub use self::create_volume_body::CreateVolumeBody; - -pub mod drain_state; -pub use self::drain_state::DrainState; - -pub mod explicit_node_topology; -pub use self::explicit_node_topology::ExplicitNodeTopology; - -pub mod labelled_topology; -pub use self::labelled_topology::LabelledTopology; - -pub mod nexus; -pub use self::nexus::Nexus; - -pub mod nexus_share_protocol; -pub use self::nexus_share_protocol::NexusShareProtocol; - -pub mod nexus_spec; -pub use self::nexus_spec::NexusSpec; - -pub mod nexus_spec_operation; -pub use self::nexus_spec_operation::NexusSpecOperation; - -pub mod nexus_state; -pub use self::nexus_state::NexusState; - -pub mod node; -pub use self::node::Node; - -pub mod node_access_info; -pub use self::node_access_info::NodeAccessInfo; - -pub mod node_spec; -pub use self::node_spec::NodeSpec; - -pub mod node_state; -pub use self::node_state::NodeState; - -pub mod node_status; -pub use self::node_status::NodeStatus; - -pub mod node_topology; -pub use self::node_topology::NodeTopology; - -pub mod offline_replica_snapshot_state; -pub use self::offline_replica_snapshot_state::OfflineReplicaSnapshotState; - -pub mod online_replica_snapshot_state; -pub use self::online_replica_snapshot_state::OnlineReplicaSnapshotState; - -pub mod pool; -pub use self::pool::Pool; - -pub mod pool_spec; -pub use self::pool_spec::PoolSpec; - -pub mod pool_state; -pub use self::pool_state::PoolState; - -pub mod pool_status; -pub use self::pool_status::PoolStatus; - -pub mod pool_topology; -pub use self::pool_topology::PoolTopology; - -pub mod protocol; -pub use self::protocol::Protocol; - -pub mod publish_volume_body; -pub use self::publish_volume_body::PublishVolumeBody; - -pub mod rebuild_job_state; -pub use self::rebuild_job_state::RebuildJobState; - -pub mod rebuild_record; -pub use self::rebuild_record::RebuildRecord; - -pub mod register_app_node; -pub use self::register_app_node::RegisterAppNode; - -pub mod replica; -pub use self::replica::Replica; - -pub mod replica_kind; -pub use self::replica_kind::ReplicaKind; - -pub mod replica_share_protocol; -pub use self::replica_share_protocol::ReplicaShareProtocol; - -pub mod replica_snapshot; -pub use self::replica_snapshot::ReplicaSnapshot; - -pub mod replica_snapshot_state; -pub use self::replica_snapshot_state::ReplicaSnapshotState; - -pub mod replica_snapshot_status; -pub use self::replica_snapshot_status::ReplicaSnapshotStatus; - -pub mod replica_space_usage; -pub use self::replica_space_usage::ReplicaSpaceUsage; - -pub mod replica_spec; -pub use self::replica_spec::ReplicaSpec; - -pub mod replica_spec_operation; -pub use self::replica_spec_operation::ReplicaSpecOperation; - -pub mod replica_spec_owners; -pub use self::replica_spec_owners::ReplicaSpecOwners; - -pub mod replica_state; -pub use self::replica_state::ReplicaState; - -pub mod replica_topology; -pub use self::replica_topology::ReplicaTopology; - -pub mod replica_usage; -pub use self::replica_usage::ReplicaUsage; - -pub mod resize_volume_body; -pub use self::resize_volume_body::ResizeVolumeBody; - -pub mod rest_json_error; -pub use self::rest_json_error::RestJsonError; - -pub mod rest_watch; -pub use self::rest_watch::RestWatch; - -pub mod set_volume_property_body; -pub use self::set_volume_property_body::SetVolumePropertyBody; - -pub mod snapshot_as_source; -pub use self::snapshot_as_source::SnapshotAsSource; - -pub mod spec_status; -pub use self::spec_status::SpecStatus; - -pub mod specs; -pub use self::specs::Specs; - -pub mod topology; -pub use self::topology::Topology; - -pub mod volume; -pub use self::volume::Volume; - -pub mod volume_content_source; -pub use self::volume_content_source::VolumeContentSource; - -pub mod volume_policy; -pub use self::volume_policy::VolumePolicy; - -pub mod volume_share_protocol; -pub use self::volume_share_protocol::VolumeShareProtocol; - -pub mod volume_snapshot; -pub use self::volume_snapshot::VolumeSnapshot; - -pub mod volume_snapshot_definition; -pub use self::volume_snapshot_definition::VolumeSnapshotDefinition; - -pub mod volume_snapshot_metadata; -pub use self::volume_snapshot_metadata::VolumeSnapshotMetadata; - -pub mod volume_snapshot_spec; -pub use self::volume_snapshot_spec::VolumeSnapshotSpec; - -pub mod volume_snapshot_state; -pub use self::volume_snapshot_state::VolumeSnapshotState; - -pub mod volume_snapshots; -pub use self::volume_snapshots::VolumeSnapshots; - -pub mod volume_spec; -pub use self::volume_spec::VolumeSpec; - -pub mod volume_spec_operation; -pub use self::volume_spec_operation::VolumeSpecOperation; - -pub mod volume_state; -pub use self::volume_state::VolumeState; - -pub mod volume_status; -pub use self::volume_status::VolumeStatus; - -pub mod volume_target; -pub use self::volume_target::VolumeTarget; - -pub mod volume_usage; -pub use self::volume_usage::VolumeUsage; - -pub mod volumes; -pub use self::volumes::Volumes; - -pub mod watch_callback; -pub use self::watch_callback::WatchCallback; - diff --git a/testgen/src/autogen/models/nexus.rs b/testgen/src/autogen/models/nexus.rs deleted file mode 100644 index 9db749990..000000000 --- a/testgen/src/autogen/models/nexus.rs +++ /dev/null @@ -1,108 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Nexus : Nexus information - - - - - - - - -/// Nexus information - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct Nexus { - - /// Array of Nexus Children - #[serde(default, rename = "children")] - pub children: Vec, - - /// URI of the device for the volume (missing if not published). Missing property and empty string are treated the same. - #[serde(default, rename = "deviceUri")] - pub device_uri: String, - - /// id of the io-engine instance - #[serde(default, rename = "node")] - pub node: String, - - /// total number of rebuild tasks - #[serde(default, rename = "rebuilds")] - pub rebuilds: u32, - - /// Common Protocol - #[serde(default, rename = "protocol")] - pub protocol: crate::models::Protocol, - - /// size of the volume in bytes - #[serde(default, rename = "size")] - pub size: u64, - - /// State of the Nexus - #[serde(default, rename = "state")] - pub state: crate::models::NexusState, - - /// uuid of the nexus - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - -} - -impl Nexus { - /// Nexus using only the required fields - pub fn new(children: impl IntoVec, device_uri: impl Into, node: impl Into, rebuilds: impl Into, protocol: impl Into, size: impl Into, state: impl Into, uuid: impl Into) -> Nexus { - Nexus { - children: children.into_vec(), - device_uri: device_uri.into(), - node: node.into(), - rebuilds: rebuilds.into(), - protocol: protocol.into(), - size: size.into(), - state: state.into(), - uuid: uuid.into(), - - } - } - /// Nexus using all fields - pub fn new_all(children: impl IntoVec, device_uri: impl Into, node: impl Into, rebuilds: impl Into, protocol: impl Into, size: impl Into, state: impl Into, uuid: impl Into) -> Nexus { - Nexus { - children: children.into_vec(), - device_uri: device_uri.into(), - node: node.into(), - rebuilds: rebuilds.into(), - protocol: protocol.into(), - size: size.into(), - state: state.into(), - uuid: uuid.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/nexus_share_protocol.rs b/testgen/src/autogen/models/nexus_share_protocol.rs deleted file mode 100644 index dbd26cad0..000000000 --- a/testgen/src/autogen/models/nexus_share_protocol.rs +++ /dev/null @@ -1,51 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// NexusShareProtocol : Nexus Share Protocol - - - -/// Nexus Share Protocol -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum NexusShareProtocol { - - - #[serde(rename = "nvmf")] - Nvmf, - - #[serde(rename = "iscsi")] - Iscsi, - -} - -impl ToString for NexusShareProtocol { - fn to_string(&self) -> String { - match self { - - - Self::Nvmf => String::from("nvmf"), - - Self::Iscsi => String::from("iscsi"), - - - } - } -} - -impl Default for NexusShareProtocol { - fn default() -> Self { - Self::Nvmf - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/nexus_spec.rs b/testgen/src/autogen/models/nexus_spec.rs deleted file mode 100644 index dd03e0d3d..000000000 --- a/testgen/src/autogen/models/nexus_spec.rs +++ /dev/null @@ -1,116 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// NexusSpec : User specification of a nexus. - - - - - - - - -/// User specification of a nexus. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct NexusSpec { - - /// List of children. - #[serde(default, rename = "children")] - pub children: Vec, - - /// Managed by our control plane - #[serde(default, rename = "managed")] - pub managed: bool, - - /// Node where the nexus should live. - #[serde(default, rename = "node")] - pub node: String, - - /// Record of the operation in progress - #[serde(default, rename = "operation", skip_serializing_if = "Option::is_none")] - pub operation: Option, - - /// Volume which owns this nexus, if any - #[serde(default, rename = "owner", skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// Common Protocol - #[serde(default, rename = "share")] - pub share: crate::models::Protocol, - - /// Size of the nexus. - #[serde(default, rename = "size")] - pub size: u64, - - /// Common base state for a resource - #[serde(default, rename = "status")] - pub status: crate::models::SpecStatus, - - /// Nexus Id - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - -} - -impl NexusSpec { - /// NexusSpec using only the required fields - pub fn new(children: impl IntoVec, managed: impl Into, node: impl Into, share: impl Into, size: impl Into, status: impl Into, uuid: impl Into) -> NexusSpec { - NexusSpec { - children: children.into_vec(), - managed: managed.into(), - node: node.into(), - operation: None, - owner: None, - share: share.into(), - size: size.into(), - status: status.into(), - uuid: uuid.into(), - - } - } - /// NexusSpec using all fields - pub fn new_all(children: impl IntoVec, managed: impl Into, node: impl Into, operation: impl Into>, owner: impl Into>, share: impl Into, size: impl Into, status: impl Into, uuid: impl Into) -> NexusSpec { - NexusSpec { - children: children.into_vec(), - managed: managed.into(), - node: node.into(), - operation: operation.into(), - owner: owner.into(), - share: share.into(), - size: size.into(), - status: status.into(), - uuid: uuid.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/nexus_spec_operation.rs b/testgen/src/autogen/models/nexus_spec_operation.rs deleted file mode 100644 index 31abf3077..000000000 --- a/testgen/src/autogen/models/nexus_spec_operation.rs +++ /dev/null @@ -1,96 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// NexusSpecOperation : Record of the operation in progress - - - - - - - - -/// Record of the operation in progress - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct NexusSpecOperation { - - /// Record of the operation - #[serde(default, rename = "operation")] - pub operation: Operation, - - /// Result of the operation - #[serde(default, rename = "result", skip_serializing_if = "Option::is_none")] - pub result: Option, - -} - -impl NexusSpecOperation { - /// NexusSpecOperation using only the required fields - pub fn new(operation: impl Into) -> NexusSpecOperation { - NexusSpecOperation { - operation: operation.into(), - result: None, - - } - } - /// NexusSpecOperation using all fields - pub fn new_all(operation: impl Into, result: impl Into>) -> NexusSpecOperation { - NexusSpecOperation { - operation: operation.into(), - result: result.into(), - - } - } -} - - - - - - - - -/// Record of the operation -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Operation { - - - #[serde(rename = "Create")] - Create, - - #[serde(rename = "Destroy")] - Destroy, - - #[serde(rename = "Share")] - Share, - - #[serde(rename = "Unshare")] - Unshare, - - #[serde(rename = "AddChild")] - AddChild, - - #[serde(rename = "RemoveChild")] - RemoveChild, - - #[serde(rename = "Shutdown")] - Shutdown, - - -} - -impl Default for Operation { - fn default() -> Self { - Self::Create - } -} - - - - - - diff --git a/testgen/src/autogen/models/nexus_state.rs b/testgen/src/autogen/models/nexus_state.rs deleted file mode 100644 index 0131c6e20..000000000 --- a/testgen/src/autogen/models/nexus_state.rs +++ /dev/null @@ -1,71 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// NexusState : State of the Nexus - - - -/// State of the Nexus -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum NexusState { - - - #[serde(rename = "Unknown")] - Unknown, - - #[serde(rename = "Online")] - Online, - - #[serde(rename = "Degraded")] - Degraded, - - #[serde(rename = "Faulted")] - Faulted, - - #[serde(rename = "ShuttingDown")] - ShuttingDown, - - #[serde(rename = "Shutdown")] - Shutdown, - -} - -impl ToString for NexusState { - fn to_string(&self) -> String { - match self { - - - Self::Unknown => String::from("Unknown"), - - Self::Online => String::from("Online"), - - Self::Degraded => String::from("Degraded"), - - Self::Faulted => String::from("Faulted"), - - Self::ShuttingDown => String::from("ShuttingDown"), - - Self::Shutdown => String::from("Shutdown"), - - - } - } -} - -impl Default for NexusState { - fn default() -> Self { - Self::Unknown - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/node.rs b/testgen/src/autogen/models/node.rs deleted file mode 100644 index 4bbe4c302..000000000 --- a/testgen/src/autogen/models/node.rs +++ /dev/null @@ -1,68 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Node : io-engine storage node information - - - - - - - - -/// io-engine storage node information - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct Node { - - /// storage node identifier - #[serde(default, rename = "id")] - pub id: String, - - /// Node spec - #[serde(default, rename = "spec", skip_serializing_if = "Option::is_none")] - pub spec: Option, - - /// io-engine storage node information - #[serde(default, rename = "state", skip_serializing_if = "Option::is_none")] - pub state: Option, - -} - -impl Node { - /// Node using only the required fields - pub fn new(id: impl Into) -> Node { - Node { - id: id.into(), - spec: None, - state: None, - - } - } - /// Node using all fields - pub fn new_all(id: impl Into, spec: impl Into>, state: impl Into>) -> Node { - Node { - id: id.into(), - spec: spec.into(), - state: state.into(), - - } - } -} - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/node_access_info.rs b/testgen/src/autogen/models/node_access_info.rs deleted file mode 100644 index 68de674b1..000000000 --- a/testgen/src/autogen/models/node_access_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// NodeAccessInfo : Frontend Node access information. - - - - - - - - -/// Frontend Node access information. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct NodeAccessInfo { - - /// The nodename of the node. - #[serde(default, rename = "name")] - pub name: String, - - /// The Nvme Nqn of the node\'s initiator. - #[serde(default, rename = "nqn")] - pub nqn: String, - -} - -impl NodeAccessInfo { - /// NodeAccessInfo using only the required fields - pub fn new(name: impl Into, nqn: impl Into) -> NodeAccessInfo { - NodeAccessInfo { - name: name.into(), - nqn: nqn.into(), - - } - } - /// NodeAccessInfo using all fields - pub fn new_all(name: impl Into, nqn: impl Into) -> NodeAccessInfo { - NodeAccessInfo { - name: name.into(), - nqn: nqn.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/node_spec.rs b/testgen/src/autogen/models/node_spec.rs deleted file mode 100644 index 4b3f0c528..000000000 --- a/testgen/src/autogen/models/node_spec.rs +++ /dev/null @@ -1,84 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// NodeSpec : Node spec - - - - - - - - -/// Node spec - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct NodeSpec { - - /// gRPC endpoint of the io-engine instance - #[serde(default, rename = "grpcEndpoint")] - pub grpc_endpoint: String, - - /// storage node identifier - #[serde(default, rename = "id")] - pub id: String, - - /// labels to be set on the node - #[serde(default, rename = "labels", skip_serializing_if = "Option::is_none")] - pub labels: Option<::std::collections::HashMap>, - - /// the drain state - #[serde(default, rename = "cordondrainstate", skip_serializing_if = "Option::is_none")] - pub cordondrainstate: Option, - - /// NVMe Qualified Names (NQNs) are used to uniquely describe a host or NVM subsystem for the purposes of identification and authentication - #[serde(default, rename = "node_nqn", skip_serializing_if = "Option::is_none")] - pub node_nqn: Option, - -} - -impl NodeSpec { - /// NodeSpec using only the required fields - pub fn new(grpc_endpoint: impl Into, id: impl Into) -> NodeSpec { - NodeSpec { - grpc_endpoint: grpc_endpoint.into(), - id: id.into(), - labels: None, - cordondrainstate: None, - node_nqn: None, - - } - } - /// NodeSpec using all fields - pub fn new_all(grpc_endpoint: impl Into, id: impl Into, labels: impl Into>>, cordondrainstate: impl Into>, node_nqn: impl Into>) -> NodeSpec { - NodeSpec { - grpc_endpoint: grpc_endpoint.into(), - id: id.into(), - labels: labels.into(), - cordondrainstate: cordondrainstate.into(), - node_nqn: node_nqn.into(), - - } - } -} - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/node_state.rs b/testgen/src/autogen/models/node_state.rs deleted file mode 100644 index ad645cc1b..000000000 --- a/testgen/src/autogen/models/node_state.rs +++ /dev/null @@ -1,76 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// NodeState : io-engine storage node information - - - - - - - - -/// io-engine storage node information - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct NodeState { - - /// gRPC endpoint of the io-engine instance - #[serde(default, rename = "grpcEndpoint")] - pub grpc_endpoint: String, - - /// storage node identifier - #[serde(default, rename = "id")] - pub id: String, - - /// deemed state of the node - #[serde(default, rename = "status")] - pub status: crate::models::NodeStatus, - - /// NVMe Qualified Names (NQNs) are used to uniquely describe a host or NVM subsystem for the purposes of identification and authentication - #[serde(default, rename = "node_nqn", skip_serializing_if = "Option::is_none")] - pub node_nqn: Option, - -} - -impl NodeState { - /// NodeState using only the required fields - pub fn new(grpc_endpoint: impl Into, id: impl Into, status: impl Into) -> NodeState { - NodeState { - grpc_endpoint: grpc_endpoint.into(), - id: id.into(), - status: status.into(), - node_nqn: None, - - } - } - /// NodeState using all fields - pub fn new_all(grpc_endpoint: impl Into, id: impl Into, status: impl Into, node_nqn: impl Into>) -> NodeState { - NodeState { - grpc_endpoint: grpc_endpoint.into(), - id: id.into(), - status: status.into(), - node_nqn: node_nqn.into(), - - } - } -} - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/node_status.rs b/testgen/src/autogen/models/node_status.rs deleted file mode 100644 index bb549891b..000000000 --- a/testgen/src/autogen/models/node_status.rs +++ /dev/null @@ -1,56 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// NodeStatus : deemed state of the node - - - -/// deemed state of the node -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum NodeStatus { - - - #[serde(rename = "Unknown")] - Unknown, - - #[serde(rename = "Online")] - Online, - - #[serde(rename = "Offline")] - Offline, - -} - -impl ToString for NodeStatus { - fn to_string(&self) -> String { - match self { - - - Self::Unknown => String::from("Unknown"), - - Self::Online => String::from("Online"), - - Self::Offline => String::from("Offline"), - - - } - } -} - -impl Default for NodeStatus { - fn default() -> Self { - Self::Unknown - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/node_topology.rs b/testgen/src/autogen/models/node_topology.rs deleted file mode 100644 index 803e819fa..000000000 --- a/testgen/src/autogen/models/node_topology.rs +++ /dev/null @@ -1,43 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// NodeTopology : Used to determine how to place/distribute the data during volume creation and replica replacement. If left empty then the control plane will select from all available resources. - - - - - - - - -/// Used to determine how to place/distribute the data during volume creation and replica replacement. If left empty then the control plane will select from all available resources. - - - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -pub enum NodeTopology { - - /// volume topology, explicitly selected - #[serde(rename = "explicit")] - explicit(crate::models::ExplicitNodeTopology), - - /// volume topology definition through labels - #[serde(rename = "labelled")] - labelled(crate::models::LabelledTopology), - -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/offline_replica_snapshot_state.rs b/testgen/src/autogen/models/offline_replica_snapshot_state.rs deleted file mode 100644 index 600524f77..000000000 --- a/testgen/src/autogen/models/offline_replica_snapshot_state.rs +++ /dev/null @@ -1,76 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// OfflineReplicaSnapshotState : Offline ReplicaSnapshotState representation. - - - - - - - - -/// Offline ReplicaSnapshotState representation. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct OfflineReplicaSnapshotState { - - - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - - - #[serde(default, rename = "source_id")] - pub source_id: uuid::Uuid, - - /// storage pool identifier - #[serde(default, rename = "pool_id")] - pub pool_id: String, - - /// storage pool unique identifier - #[serde(default, rename = "pool_uuid")] - pub pool_uuid: uuid::Uuid, - -} - -impl OfflineReplicaSnapshotState { - /// OfflineReplicaSnapshotState using only the required fields - pub fn new(uuid: impl Into, source_id: impl Into, pool_id: impl Into, pool_uuid: impl Into) -> OfflineReplicaSnapshotState { - OfflineReplicaSnapshotState { - uuid: uuid.into(), - source_id: source_id.into(), - pool_id: pool_id.into(), - pool_uuid: pool_uuid.into(), - - } - } - /// OfflineReplicaSnapshotState using all fields - pub fn new_all(uuid: impl Into, source_id: impl Into, pool_id: impl Into, pool_uuid: impl Into) -> OfflineReplicaSnapshotState { - OfflineReplicaSnapshotState { - uuid: uuid.into(), - source_id: source_id.into(), - pool_id: pool_id.into(), - pool_uuid: pool_uuid.into(), - - } - } -} - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/online_replica_snapshot_state.rs b/testgen/src/autogen/models/online_replica_snapshot_state.rs deleted file mode 100644 index 3c4ccf87f..000000000 --- a/testgen/src/autogen/models/online_replica_snapshot_state.rs +++ /dev/null @@ -1,108 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// OnlineReplicaSnapshotState : Online ReplicaSnapshotState representation. - - - - - - - - -/// Online ReplicaSnapshotState representation. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct OnlineReplicaSnapshotState { - - - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - - - #[serde(default, rename = "source_id")] - pub source_id: uuid::Uuid, - - /// storage pool identifier - #[serde(default, rename = "pool_id")] - pub pool_id: String, - - /// storage pool unique identifier - #[serde(default, rename = "pool_uuid")] - pub pool_uuid: uuid::Uuid, - - /// Timestamp when the replica snapshot is taken on the storage system. - #[serde(default, rename = "timestamp")] - pub timestamp: String, - - /// Replica snapshot size. - #[serde(default, rename = "size")] - pub size: u64, - - /// Runtime size in bytes of the snapshot. Equal to the volume allocation at the time of the snapshot creation. It may grow larger if any of its predecessors are deleted. - #[serde(default, rename = "allocated_size")] - pub allocated_size: u64, - - /// Total allocated size of all the snapshot predecessors. - #[serde(default, rename = "predecessor_alloc_size")] - pub predecessor_alloc_size: u64, - -} - -impl OnlineReplicaSnapshotState { - /// OnlineReplicaSnapshotState using only the required fields - pub fn new(uuid: impl Into, source_id: impl Into, pool_id: impl Into, pool_uuid: impl Into, timestamp: impl Into, size: impl Into, allocated_size: impl Into, predecessor_alloc_size: impl Into) -> OnlineReplicaSnapshotState { - OnlineReplicaSnapshotState { - uuid: uuid.into(), - source_id: source_id.into(), - pool_id: pool_id.into(), - pool_uuid: pool_uuid.into(), - timestamp: timestamp.into(), - size: size.into(), - allocated_size: allocated_size.into(), - predecessor_alloc_size: predecessor_alloc_size.into(), - - } - } - /// OnlineReplicaSnapshotState using all fields - pub fn new_all(uuid: impl Into, source_id: impl Into, pool_id: impl Into, pool_uuid: impl Into, timestamp: impl Into, size: impl Into, allocated_size: impl Into, predecessor_alloc_size: impl Into) -> OnlineReplicaSnapshotState { - OnlineReplicaSnapshotState { - uuid: uuid.into(), - source_id: source_id.into(), - pool_id: pool_id.into(), - pool_uuid: pool_uuid.into(), - timestamp: timestamp.into(), - size: size.into(), - allocated_size: allocated_size.into(), - predecessor_alloc_size: predecessor_alloc_size.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/pool.rs b/testgen/src/autogen/models/pool.rs deleted file mode 100644 index cc4b2c776..000000000 --- a/testgen/src/autogen/models/pool.rs +++ /dev/null @@ -1,68 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Pool : Pool object, comprised of a spec and a state - - - - - - - - -/// Pool object, comprised of a spec and a state - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct Pool { - - /// storage pool identifier - #[serde(default, rename = "id")] - pub id: String, - - /// User specification of a pool. - #[serde(default, rename = "spec", skip_serializing_if = "Option::is_none")] - pub spec: Option, - - /// State of a pool, as reported by io-engine - #[serde(default, rename = "state", skip_serializing_if = "Option::is_none")] - pub state: Option, - -} - -impl Pool { - /// Pool using only the required fields - pub fn new(id: impl Into) -> Pool { - Pool { - id: id.into(), - spec: None, - state: None, - - } - } - /// Pool using all fields - pub fn new_all(id: impl Into, spec: impl Into>, state: impl Into>) -> Pool { - Pool { - id: id.into(), - spec: spec.into(), - state: state.into(), - - } - } -} - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/pool_spec.rs b/testgen/src/autogen/models/pool_spec.rs deleted file mode 100644 index 934840901..000000000 --- a/testgen/src/autogen/models/pool_spec.rs +++ /dev/null @@ -1,84 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// PoolSpec : User specification of a pool. - - - - - - - - -/// User specification of a pool. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct PoolSpec { - - /// absolute disk paths claimed by the pool - #[serde(default, rename = "disks")] - pub disks: Vec, - - /// storage pool identifier - #[serde(default, rename = "id")] - pub id: String, - - /// labels to be set on the pools - #[serde(default, rename = "labels", skip_serializing_if = "Option::is_none")] - pub labels: Option<::std::collections::HashMap>, - - /// storage node identifier - #[serde(default, rename = "node")] - pub node: String, - - /// Common base state for a resource - #[serde(default, rename = "status")] - pub status: crate::models::SpecStatus, - -} - -impl PoolSpec { - /// PoolSpec using only the required fields - pub fn new(disks: impl IntoVec, id: impl Into, node: impl Into, status: impl Into) -> PoolSpec { - PoolSpec { - disks: disks.into_vec(), - id: id.into(), - labels: None, - node: node.into(), - status: status.into(), - - } - } - /// PoolSpec using all fields - pub fn new_all(disks: impl IntoVec, id: impl Into, labels: impl Into>>, node: impl Into, status: impl Into) -> PoolSpec { - PoolSpec { - disks: disks.into_vec(), - id: id.into(), - labels: labels.into(), - node: node.into(), - status: status.into(), - - } - } -} - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/pool_state.rs b/testgen/src/autogen/models/pool_state.rs deleted file mode 100644 index 4a135ecc6..000000000 --- a/testgen/src/autogen/models/pool_state.rs +++ /dev/null @@ -1,100 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// PoolState : State of a pool, as reported by io-engine - - - - - - - - -/// State of a pool, as reported by io-engine - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct PoolState { - - /// size of the pool in bytes - #[serde(default, rename = "capacity")] - pub capacity: u64, - - /// absolute disk paths claimed by the pool - #[serde(default, rename = "disks")] - pub disks: Vec, - - /// storage pool identifier - #[serde(default, rename = "id")] - pub id: String, - - /// storage node identifier - #[serde(default, rename = "node")] - pub node: String, - - /// current status of the pool - #[serde(default, rename = "status")] - pub status: crate::models::PoolStatus, - - /// used bytes from the pool - #[serde(default, rename = "used")] - pub used: u64, - - /// accrued size of all replicas contained in this pool - #[serde(default, rename = "committed", skip_serializing_if = "Option::is_none")] - pub committed: Option, - -} - -impl PoolState { - /// PoolState using only the required fields - pub fn new(capacity: impl Into, disks: impl IntoVec, id: impl Into, node: impl Into, status: impl Into, used: impl Into) -> PoolState { - PoolState { - capacity: capacity.into(), - disks: disks.into_vec(), - id: id.into(), - node: node.into(), - status: status.into(), - used: used.into(), - committed: None, - - } - } - /// PoolState using all fields - pub fn new_all(capacity: impl Into, disks: impl IntoVec, id: impl Into, node: impl Into, status: impl Into, used: impl Into, committed: impl Into>) -> PoolState { - PoolState { - capacity: capacity.into(), - disks: disks.into_vec(), - id: id.into(), - node: node.into(), - status: status.into(), - used: used.into(), - committed: committed.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/pool_status.rs b/testgen/src/autogen/models/pool_status.rs deleted file mode 100644 index d105e2309..000000000 --- a/testgen/src/autogen/models/pool_status.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// PoolStatus : current status of the pool - - - -/// current status of the pool -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum PoolStatus { - - - #[serde(rename = "Unknown")] - Unknown, - - #[serde(rename = "Online")] - Online, - - #[serde(rename = "Degraded")] - Degraded, - - #[serde(rename = "Faulted")] - Faulted, - -} - -impl ToString for PoolStatus { - fn to_string(&self) -> String { - match self { - - - Self::Unknown => String::from("Unknown"), - - Self::Online => String::from("Online"), - - Self::Degraded => String::from("Degraded"), - - Self::Faulted => String::from("Faulted"), - - - } - } -} - -impl Default for PoolStatus { - fn default() -> Self { - Self::Unknown - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/pool_topology.rs b/testgen/src/autogen/models/pool_topology.rs deleted file mode 100644 index 838cea3ad..000000000 --- a/testgen/src/autogen/models/pool_topology.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// PoolTopology : Used to determine how to place/distribute the data during volume creation and replica replacement. If left empty then the control plane will select from all available resources. - - - - - - - - -/// Used to determine how to place/distribute the data during volume creation and replica replacement. If left empty then the control plane will select from all available resources. - - - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -pub enum PoolTopology { - - /// volume pool topology definition through labels - #[serde(rename = "labelled")] - labelled(crate::models::LabelledTopology), - -} - - - - - - - - - - diff --git a/testgen/src/autogen/models/protocol.rs b/testgen/src/autogen/models/protocol.rs deleted file mode 100644 index 95cc46b69..000000000 --- a/testgen/src/autogen/models/protocol.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Protocol : Common Protocol - - - -/// Common Protocol -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Protocol { - - - #[serde(rename = "none")] - None, - - #[serde(rename = "nvmf")] - Nvmf, - - #[serde(rename = "iscsi")] - Iscsi, - - #[serde(rename = "nbd")] - Nbd, - -} - -impl ToString for Protocol { - fn to_string(&self) -> String { - match self { - - - Self::None => String::from("none"), - - Self::Nvmf => String::from("nvmf"), - - Self::Iscsi => String::from("iscsi"), - - Self::Nbd => String::from("nbd"), - - - } - } -} - -impl Default for Protocol { - fn default() -> Self { - Self::None - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/publish_volume_body.rs b/testgen/src/autogen/models/publish_volume_body.rs deleted file mode 100644 index 624efc1a5..000000000 --- a/testgen/src/autogen/models/publish_volume_body.rs +++ /dev/null @@ -1,92 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// PublishVolumeBody : Publish Volume Body - - - - - - - - -/// Publish Volume Body - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct PublishVolumeBody { - - /// Controller Volume Publish context - #[serde(default, rename = "publish_context")] - pub publish_context: ::std::collections::HashMap, - - /// Allows reusing of the current target. - #[serde(default, rename = "reuse_existing", skip_serializing_if = "Option::is_none")] - pub reuse_existing: Option, - - /// The node where the target will reside in. It may be moved elsewhere during volume republish. - #[serde(default, rename = "node", skip_serializing_if = "Option::is_none")] - pub node: Option, - - /// The protocol used to connect to the front-end node. - #[serde(default, rename = "protocol")] - pub protocol: crate::models::VolumeShareProtocol, - - /// Allows republishing the volume on the node by shutting down the existing target first. - #[serde(default, rename = "republish", skip_serializing_if = "Option::is_none")] - pub republish: Option, - - /// The node where the front-end workload resides. If the workload moves then the volume must be republished. - #[serde(default, rename = "frontend_node", skip_serializing_if = "Option::is_none")] - pub frontend_node: Option, - -} - -impl PublishVolumeBody { - /// PublishVolumeBody using only the required fields - pub fn new(publish_context: impl Into<::std::collections::HashMap>, protocol: impl Into) -> PublishVolumeBody { - PublishVolumeBody { - publish_context: publish_context.into(), - reuse_existing: None, - node: None, - protocol: protocol.into(), - republish: None, - frontend_node: None, - - } - } - /// PublishVolumeBody using all fields - pub fn new_all(publish_context: impl Into<::std::collections::HashMap>, reuse_existing: impl Into>, node: impl Into>, protocol: impl Into, republish: impl Into>, frontend_node: impl Into>) -> PublishVolumeBody { - PublishVolumeBody { - publish_context: publish_context.into(), - reuse_existing: reuse_existing.into(), - node: node.into(), - protocol: protocol.into(), - republish: republish.into(), - frontend_node: frontend_node.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/rebuild_job_state.rs b/testgen/src/autogen/models/rebuild_job_state.rs deleted file mode 100644 index 9b81821a3..000000000 --- a/testgen/src/autogen/models/rebuild_job_state.rs +++ /dev/null @@ -1,71 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// RebuildJobState : State of the rebuild job - - - -/// State of the rebuild job -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum RebuildJobState { - - - #[serde(rename = "Init")] - Init, - - #[serde(rename = "Rebuilding")] - Rebuilding, - - #[serde(rename = "Stopped")] - Stopped, - - #[serde(rename = "Paused")] - Paused, - - #[serde(rename = "Failed")] - Failed, - - #[serde(rename = "Completed")] - Completed, - -} - -impl ToString for RebuildJobState { - fn to_string(&self) -> String { - match self { - - - Self::Init => String::from("Init"), - - Self::Rebuilding => String::from("Rebuilding"), - - Self::Stopped => String::from("Stopped"), - - Self::Paused => String::from("Paused"), - - Self::Failed => String::from("Failed"), - - Self::Completed => String::from("Completed"), - - - } - } -} - -impl Default for RebuildJobState { - fn default() -> Self { - Self::Init - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/rebuild_record.rs b/testgen/src/autogen/models/rebuild_record.rs deleted file mode 100644 index 9295df6e8..000000000 --- a/testgen/src/autogen/models/rebuild_record.rs +++ /dev/null @@ -1,132 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// RebuildRecord : Rebuild record of a Child - - - - - - - - -/// Rebuild record of a Child - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct RebuildRecord { - - /// Uri of the rebuilding child - #[serde(default, rename = "childUri")] - pub child_uri: String, - - /// Uri of source child for rebuild job - #[serde(default, rename = "srcUri")] - pub src_uri: String, - - /// State of the rebuild job - #[serde(default, rename = "rebuildJobState")] - pub rebuild_job_state: crate::models::RebuildJobState, - - /// Total blocks to rebuild - #[serde(default, rename = "blocksTotal")] - pub blocks_total: u64, - - /// Number of blocks processed - #[serde(default, rename = "blocksRecovered")] - pub blocks_recovered: u64, - - /// Number of blocks to transferred - #[serde(default, rename = "blocksTransferred")] - pub blocks_transferred: u64, - - /// Number of blocks remaining - #[serde(default, rename = "blocksRemaining")] - pub blocks_remaining: u64, - - /// Size of each block in the task - #[serde(default, rename = "blockSize")] - pub block_size: u64, - - /// True means its Partial rebuild job. If false, its Full rebuild job - #[serde(default, rename = "isPartial")] - pub is_partial: bool, - - /// Start time of the rebuild job (UTC) - #[serde(default, rename = "startTime")] - pub start_time: String, - - /// End time of the rebuild job (UTC) - #[serde(default, rename = "endTime")] - pub end_time: String, - -} - -impl RebuildRecord { - /// RebuildRecord using only the required fields - pub fn new(child_uri: impl Into, src_uri: impl Into, rebuild_job_state: impl Into, blocks_total: impl Into, blocks_recovered: impl Into, blocks_transferred: impl Into, blocks_remaining: impl Into, block_size: impl Into, is_partial: impl Into, start_time: impl Into, end_time: impl Into) -> RebuildRecord { - RebuildRecord { - child_uri: child_uri.into(), - src_uri: src_uri.into(), - rebuild_job_state: rebuild_job_state.into(), - blocks_total: blocks_total.into(), - blocks_recovered: blocks_recovered.into(), - blocks_transferred: blocks_transferred.into(), - blocks_remaining: blocks_remaining.into(), - block_size: block_size.into(), - is_partial: is_partial.into(), - start_time: start_time.into(), - end_time: end_time.into(), - - } - } - /// RebuildRecord using all fields - pub fn new_all(child_uri: impl Into, src_uri: impl Into, rebuild_job_state: impl Into, blocks_total: impl Into, blocks_recovered: impl Into, blocks_transferred: impl Into, blocks_remaining: impl Into, block_size: impl Into, is_partial: impl Into, start_time: impl Into, end_time: impl Into) -> RebuildRecord { - RebuildRecord { - child_uri: child_uri.into(), - src_uri: src_uri.into(), - rebuild_job_state: rebuild_job_state.into(), - blocks_total: blocks_total.into(), - blocks_recovered: blocks_recovered.into(), - blocks_transferred: blocks_transferred.into(), - blocks_remaining: blocks_remaining.into(), - block_size: block_size.into(), - is_partial: is_partial.into(), - start_time: start_time.into(), - end_time: end_time.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/register_app_node.rs b/testgen/src/autogen/models/register_app_node.rs deleted file mode 100644 index 4098ff4c1..000000000 --- a/testgen/src/autogen/models/register_app_node.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - - - - - - - - - - - - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct RegisterAppNode { - - /// gRPC server endpoint of the app node. - #[serde(default, rename = "endpoint")] - pub endpoint: String, - - /// Labels to be set on the app node. - #[serde(default, rename = "labels", skip_serializing_if = "Option::is_none")] - pub labels: Option<::std::collections::HashMap>, - -} - -impl RegisterAppNode { - /// RegisterAppNode using only the required fields - pub fn new(endpoint: impl Into) -> RegisterAppNode { - RegisterAppNode { - endpoint: endpoint.into(), - labels: None, - - } - } - /// RegisterAppNode using all fields - pub fn new_all(endpoint: impl Into, labels: impl Into>>) -> RegisterAppNode { - RegisterAppNode { - endpoint: endpoint.into(), - labels: labels.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/replica.rs b/testgen/src/autogen/models/replica.rs deleted file mode 100644 index 05e2fd29c..000000000 --- a/testgen/src/autogen/models/replica.rs +++ /dev/null @@ -1,140 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Replica : Replica information - - - - - - - - -/// Replica information - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct Replica { - - /// storage node identifier - #[serde(default, rename = "node")] - pub node: String, - - /// storage pool identifier - #[serde(default, rename = "pool")] - pub pool: String, - - /// storage pool unique identifier - #[serde(default, rename = "poolUuid", skip_serializing_if = "Option::is_none")] - pub pool_uuid: Option, - - /// Common Protocol - #[serde(default, rename = "share")] - pub share: crate::models::Protocol, - - /// size of the replica in bytes - #[serde(default, rename = "size")] - pub size: u64, - - /// Replica space usage information. Useful for capacity management, eg: figure out how much of a thin-provisioned replica is allocated. - #[serde(default, rename = "space", skip_serializing_if = "Option::is_none")] - pub space: Option, - - /// state of the replica - #[serde(default, rename = "state")] - pub state: crate::models::ReplicaState, - - /// thin provisioning - #[serde(default, rename = "thin")] - pub thin: bool, - - /// uri usable by nexus to access it - #[serde(default, rename = "uri")] - pub uri: String, - - /// uuid of the replica - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - - /// NQNs of hosts allowed to connect to this replica - #[serde(default, rename = "allowed-hosts", skip_serializing_if = "Option::is_none")] - pub allowed_hosts: Option>, - - /// Type of replica, example regular or snapshot. - #[serde(default, rename = "kind")] - pub kind: crate::models::ReplicaKind, - -} - -impl Replica { - /// Replica using only the required fields - pub fn new(node: impl Into, pool: impl Into, share: impl Into, size: impl Into, state: impl Into, thin: impl Into, uri: impl Into, uuid: impl Into, kind: impl Into) -> Replica { - Replica { - node: node.into(), - pool: pool.into(), - pool_uuid: None, - share: share.into(), - size: size.into(), - space: None, - state: state.into(), - thin: thin.into(), - uri: uri.into(), - uuid: uuid.into(), - allowed_hosts: None, - kind: kind.into(), - - } - } - /// Replica using all fields - pub fn new_all(node: impl Into, pool: impl Into, pool_uuid: impl Into>, share: impl Into, size: impl Into, space: impl Into>, state: impl Into, thin: impl Into, uri: impl Into, uuid: impl Into, allowed_hosts: impl IntoOptVec, kind: impl Into) -> Replica { - Replica { - node: node.into(), - pool: pool.into(), - pool_uuid: pool_uuid.into(), - share: share.into(), - size: size.into(), - space: space.into(), - state: state.into(), - thin: thin.into(), - uri: uri.into(), - uuid: uuid.into(), - allowed_hosts: allowed_hosts.into_opt_vec(), - kind: kind.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_kind.rs b/testgen/src/autogen/models/replica_kind.rs deleted file mode 100644 index 16da8128a..000000000 --- a/testgen/src/autogen/models/replica_kind.rs +++ /dev/null @@ -1,56 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaKind : Type of replica, example regular or snapshot. - - - -/// Type of replica, example regular or snapshot. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ReplicaKind { - - - #[serde(rename = "Regular")] - Regular, - - #[serde(rename = "Snapshot")] - Snapshot, - - #[serde(rename = "SnapshotClone")] - SnapshotClone, - -} - -impl ToString for ReplicaKind { - fn to_string(&self) -> String { - match self { - - - Self::Regular => String::from("Regular"), - - Self::Snapshot => String::from("Snapshot"), - - Self::SnapshotClone => String::from("SnapshotClone"), - - - } - } -} - -impl Default for ReplicaKind { - fn default() -> Self { - Self::Regular - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_share_protocol.rs b/testgen/src/autogen/models/replica_share_protocol.rs deleted file mode 100644 index 05e40de7e..000000000 --- a/testgen/src/autogen/models/replica_share_protocol.rs +++ /dev/null @@ -1,46 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaShareProtocol : Replica Share Protocol - - - -/// Replica Share Protocol -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ReplicaShareProtocol { - - - #[serde(rename = "nvmf")] - Nvmf, - -} - -impl ToString for ReplicaShareProtocol { - fn to_string(&self) -> String { - match self { - - - Self::Nvmf => String::from("nvmf"), - - - } - } -} - -impl Default for ReplicaShareProtocol { - fn default() -> Self { - Self::Nvmf - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_snapshot.rs b/testgen/src/autogen/models/replica_snapshot.rs deleted file mode 100644 index 8e2cc6094..000000000 --- a/testgen/src/autogen/models/replica_snapshot.rs +++ /dev/null @@ -1,68 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaSnapshot : Replica Snapshot information. - - - - - - - - -/// Replica Snapshot information. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct ReplicaSnapshot { - - - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - - - #[serde(default, rename = "source_id")] - pub source_id: uuid::Uuid, - - /// Common base state for a resource - #[serde(default, rename = "status")] - pub status: crate::models::SpecStatus, - -} - -impl ReplicaSnapshot { - /// ReplicaSnapshot using only the required fields - pub fn new(uuid: impl Into, source_id: impl Into, status: impl Into) -> ReplicaSnapshot { - ReplicaSnapshot { - uuid: uuid.into(), - source_id: source_id.into(), - status: status.into(), - - } - } - /// ReplicaSnapshot using all fields - pub fn new_all(uuid: impl Into, source_id: impl Into, status: impl Into) -> ReplicaSnapshot { - ReplicaSnapshot { - uuid: uuid.into(), - source_id: source_id.into(), - status: status.into(), - - } - } -} - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_snapshot_state.rs b/testgen/src/autogen/models/replica_snapshot_state.rs deleted file mode 100644 index f8f965b55..000000000 --- a/testgen/src/autogen/models/replica_snapshot_state.rs +++ /dev/null @@ -1,43 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaSnapshotState : Replica Snapshot state information. - - - - - - - - -/// Replica Snapshot state information. - - - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -pub enum ReplicaSnapshotState { - - /// Online ReplicaSnapshotState representation. - #[serde(rename = "online")] - online(crate::models::OnlineReplicaSnapshotState), - - /// Offline ReplicaSnapshotState representation. - #[serde(rename = "offline")] - offline(crate::models::OfflineReplicaSnapshotState), - -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_snapshot_status.rs b/testgen/src/autogen/models/replica_snapshot_status.rs deleted file mode 100644 index f1cdb8937..000000000 --- a/testgen/src/autogen/models/replica_snapshot_status.rs +++ /dev/null @@ -1,56 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaSnapshotStatus : Current ReplicaSnapshot status - - - -/// Current ReplicaSnapshot status -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ReplicaSnapshotStatus { - - - #[serde(rename = "Unknown")] - Unknown, - - #[serde(rename = "Online")] - Online, - - #[serde(rename = "Offline")] - Offline, - -} - -impl ToString for ReplicaSnapshotStatus { - fn to_string(&self) -> String { - match self { - - - Self::Unknown => String::from("Unknown"), - - Self::Online => String::from("Online"), - - Self::Offline => String::from("Offline"), - - - } - } -} - -impl Default for ReplicaSnapshotStatus { - fn default() -> Self { - Self::Unknown - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_space_usage.rs b/testgen/src/autogen/models/replica_space_usage.rs deleted file mode 100644 index 72e878572..000000000 --- a/testgen/src/autogen/models/replica_space_usage.rs +++ /dev/null @@ -1,100 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaSpaceUsage : Replica space usage information. Useful for capacity management, eg: figure out how much of a thin-provisioned replica is allocated. - - - - - - - - -/// Replica space usage information. Useful for capacity management, eg: figure out how much of a thin-provisioned replica is allocated. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct ReplicaSpaceUsage { - - /// Replica capacity in bytes. - #[serde(default, rename = "capacity_bytes")] - pub capacity_bytes: u64, - - /// Amount of actually allocated disk space for this replica in bytes. - #[serde(default, rename = "allocated_bytes")] - pub allocated_bytes: u64, - - /// Amount of actually allocated disk space for this replica\'s snapshots in bytes. - #[serde(default, rename = "allocated_bytes_snapshots")] - pub allocated_bytes_snapshots: u64, - - /// Amount of actually allocated disk space for this replica\'s snapshots and its predecessors in bytes. For a restored/cloned replica this includes snapshots from the parent source. - #[serde(default, rename = "allocated_bytes_all_snapshots", skip_serializing_if = "Option::is_none")] - pub allocated_bytes_all_snapshots: Option, - - /// Cluster size in bytes. - #[serde(default, rename = "cluster_size")] - pub cluster_size: u64, - - /// Total number of clusters. - #[serde(default, rename = "clusters")] - pub clusters: u64, - - /// Number of actually used clusters. - #[serde(default, rename = "allocated_clusters")] - pub allocated_clusters: u64, - -} - -impl ReplicaSpaceUsage { - /// ReplicaSpaceUsage using only the required fields - pub fn new(capacity_bytes: impl Into, allocated_bytes: impl Into, allocated_bytes_snapshots: impl Into, cluster_size: impl Into, clusters: impl Into, allocated_clusters: impl Into) -> ReplicaSpaceUsage { - ReplicaSpaceUsage { - capacity_bytes: capacity_bytes.into(), - allocated_bytes: allocated_bytes.into(), - allocated_bytes_snapshots: allocated_bytes_snapshots.into(), - allocated_bytes_all_snapshots: None, - cluster_size: cluster_size.into(), - clusters: clusters.into(), - allocated_clusters: allocated_clusters.into(), - - } - } - /// ReplicaSpaceUsage using all fields - pub fn new_all(capacity_bytes: impl Into, allocated_bytes: impl Into, allocated_bytes_snapshots: impl Into, allocated_bytes_all_snapshots: impl Into>, cluster_size: impl Into, clusters: impl Into, allocated_clusters: impl Into) -> ReplicaSpaceUsage { - ReplicaSpaceUsage { - capacity_bytes: capacity_bytes.into(), - allocated_bytes: allocated_bytes.into(), - allocated_bytes_snapshots: allocated_bytes_snapshots.into(), - allocated_bytes_all_snapshots: allocated_bytes_all_snapshots.into(), - cluster_size: cluster_size.into(), - clusters: clusters.into(), - allocated_clusters: allocated_clusters.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_spec.rs b/testgen/src/autogen/models/replica_spec.rs deleted file mode 100644 index 144a49123..000000000 --- a/testgen/src/autogen/models/replica_spec.rs +++ /dev/null @@ -1,132 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaSpec : User specification of a replica. - - - - - - - - -/// User specification of a replica. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct ReplicaSpec { - - /// Managed by our control plane - #[serde(default, rename = "managed")] - pub managed: bool, - - /// Record of the operation in progress - #[serde(default, rename = "operation", skip_serializing_if = "Option::is_none")] - pub operation: Option, - - /// Owner Resource - #[serde(default, rename = "owners")] - pub owners: crate::models::ReplicaSpecOwners, - - /// The pool that the replica should live on. - #[serde(default, rename = "pool")] - pub pool: String, - - /// storage pool unique identifier - #[serde(default, rename = "poolUuid", skip_serializing_if = "Option::is_none")] - pub pool_uuid: Option, - - /// Common Protocol - #[serde(default, rename = "share")] - pub share: crate::models::Protocol, - - /// The size that the replica should be. - #[serde(default, rename = "size")] - pub size: u64, - - /// Common base state for a resource - #[serde(default, rename = "status")] - pub status: crate::models::SpecStatus, - - /// Thin provisioning. - #[serde(default, rename = "thin")] - pub thin: bool, - - /// uuid of the replica - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - - /// Type of replica, example regular or snapshot. - #[serde(default, rename = "kind", skip_serializing_if = "Option::is_none")] - pub kind: Option, - -} - -impl ReplicaSpec { - /// ReplicaSpec using only the required fields - pub fn new(managed: impl Into, owners: impl Into, pool: impl Into, share: impl Into, size: impl Into, status: impl Into, thin: impl Into, uuid: impl Into) -> ReplicaSpec { - ReplicaSpec { - managed: managed.into(), - operation: None, - owners: owners.into(), - pool: pool.into(), - pool_uuid: None, - share: share.into(), - size: size.into(), - status: status.into(), - thin: thin.into(), - uuid: uuid.into(), - kind: None, - - } - } - /// ReplicaSpec using all fields - pub fn new_all(managed: impl Into, operation: impl Into>, owners: impl Into, pool: impl Into, pool_uuid: impl Into>, share: impl Into, size: impl Into, status: impl Into, thin: impl Into, uuid: impl Into, kind: impl Into>) -> ReplicaSpec { - ReplicaSpec { - managed: managed.into(), - operation: operation.into(), - owners: owners.into(), - pool: pool.into(), - pool_uuid: pool_uuid.into(), - share: share.into(), - size: size.into(), - status: status.into(), - thin: thin.into(), - uuid: uuid.into(), - kind: kind.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_spec_operation.rs b/testgen/src/autogen/models/replica_spec_operation.rs deleted file mode 100644 index 1879e5e7c..000000000 --- a/testgen/src/autogen/models/replica_spec_operation.rs +++ /dev/null @@ -1,87 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaSpecOperation : Record of the operation in progress - - - - - - - - -/// Record of the operation in progress - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct ReplicaSpecOperation { - - /// Record of the operation - #[serde(default, rename = "operation")] - pub operation: Operation, - - /// Result of the operation - #[serde(default, rename = "result", skip_serializing_if = "Option::is_none")] - pub result: Option, - -} - -impl ReplicaSpecOperation { - /// ReplicaSpecOperation using only the required fields - pub fn new(operation: impl Into) -> ReplicaSpecOperation { - ReplicaSpecOperation { - operation: operation.into(), - result: None, - - } - } - /// ReplicaSpecOperation using all fields - pub fn new_all(operation: impl Into, result: impl Into>) -> ReplicaSpecOperation { - ReplicaSpecOperation { - operation: operation.into(), - result: result.into(), - - } - } -} - - - - - - - - -/// Record of the operation -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Operation { - - - #[serde(rename = "Create")] - Create, - - #[serde(rename = "Destroy")] - Destroy, - - #[serde(rename = "Share")] - Share, - - #[serde(rename = "Unshare")] - Unshare, - - -} - -impl Default for Operation { - fn default() -> Self { - Self::Create - } -} - - - - - - diff --git a/testgen/src/autogen/models/replica_spec_owners.rs b/testgen/src/autogen/models/replica_spec_owners.rs deleted file mode 100644 index 0520a97f7..000000000 --- a/testgen/src/autogen/models/replica_spec_owners.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaSpecOwners : Owner Resource - - - - - - - - -/// Owner Resource - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct ReplicaSpecOwners { - - - #[serde(default, rename = "nexuses")] - pub nexuses: Vec, - - - #[serde(default, rename = "volume", skip_serializing_if = "Option::is_none")] - pub volume: Option, - -} - -impl ReplicaSpecOwners { - /// ReplicaSpecOwners using only the required fields - pub fn new(nexuses: impl IntoVec) -> ReplicaSpecOwners { - ReplicaSpecOwners { - nexuses: nexuses.into_vec(), - volume: None, - - } - } - /// ReplicaSpecOwners using all fields - pub fn new_all(nexuses: impl IntoVec, volume: impl Into>) -> ReplicaSpecOwners { - ReplicaSpecOwners { - nexuses: nexuses.into_vec(), - volume: volume.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_state.rs b/testgen/src/autogen/models/replica_state.rs deleted file mode 100644 index 26bbfcbef..000000000 --- a/testgen/src/autogen/models/replica_state.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaState : state of the replica - - - -/// state of the replica -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ReplicaState { - - - #[serde(rename = "Unknown")] - Unknown, - - #[serde(rename = "Online")] - Online, - - #[serde(rename = "Degraded")] - Degraded, - - #[serde(rename = "Faulted")] - Faulted, - -} - -impl ToString for ReplicaState { - fn to_string(&self) -> String { - match self { - - - Self::Unknown => String::from("Unknown"), - - Self::Online => String::from("Online"), - - Self::Degraded => String::from("Degraded"), - - Self::Faulted => String::from("Faulted"), - - - } - } -} - -impl Default for ReplicaState { - fn default() -> Self { - Self::Unknown - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_topology.rs b/testgen/src/autogen/models/replica_topology.rs deleted file mode 100644 index 18eab1dca..000000000 --- a/testgen/src/autogen/models/replica_topology.rs +++ /dev/null @@ -1,100 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaTopology : Volume Replica information. - - - - - - - - -/// Volume Replica information. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct ReplicaTopology { - - /// storage node identifier - #[serde(default, rename = "node", skip_serializing_if = "Option::is_none")] - pub node: Option, - - /// storage pool identifier - #[serde(default, rename = "pool", skip_serializing_if = "Option::is_none")] - pub pool: Option, - - /// state of the replica - #[serde(default, rename = "state")] - pub state: crate::models::ReplicaState, - - /// State of a Nexus Child - #[serde(default, rename = "child-status", skip_serializing_if = "Option::is_none")] - pub child_status: Option, - - /// Reason for the state of a Nexus Child - #[serde(default, rename = "child-status-reason", skip_serializing_if = "Option::is_none")] - pub child_status_reason: Option, - - /// Replica space usage information. Useful for capacity management, eg: figure out how much of a thin-provisioned replica is allocated. - #[serde(default, rename = "usage", skip_serializing_if = "Option::is_none")] - pub usage: Option, - - /// current rebuild progress (%) - #[serde(default, rename = "rebuild-progress", skip_serializing_if = "Option::is_none")] - pub rebuild_progress: Option, - -} - -impl ReplicaTopology { - /// ReplicaTopology using only the required fields - pub fn new(state: impl Into) -> ReplicaTopology { - ReplicaTopology { - node: None, - pool: None, - state: state.into(), - child_status: None, - child_status_reason: None, - usage: None, - rebuild_progress: None, - - } - } - /// ReplicaTopology using all fields - pub fn new_all(node: impl Into>, pool: impl Into>, state: impl Into, child_status: impl Into>, child_status_reason: impl Into>, usage: impl Into>, rebuild_progress: impl Into>) -> ReplicaTopology { - ReplicaTopology { - node: node.into(), - pool: pool.into(), - state: state.into(), - child_status: child_status.into(), - child_status_reason: child_status_reason.into(), - usage: usage.into(), - rebuild_progress: rebuild_progress.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/replica_usage.rs b/testgen/src/autogen/models/replica_usage.rs deleted file mode 100644 index 47fce787d..000000000 --- a/testgen/src/autogen/models/replica_usage.rs +++ /dev/null @@ -1,76 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ReplicaUsage : Replica space usage information. Useful for capacity management, eg: figure out how much of a thin-provisioned replica is allocated. - - - - - - - - -/// Replica space usage information. Useful for capacity management, eg: figure out how much of a thin-provisioned replica is allocated. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct ReplicaUsage { - - /// Replica capacity in bytes. - #[serde(default, rename = "capacity")] - pub capacity: u64, - - /// Amount of actually allocated disk space for this replica in bytes. - #[serde(default, rename = "allocated")] - pub allocated: u64, - - /// Amount of actually allocated disk space for this replica\'s snapshots in bytes. - #[serde(default, rename = "allocated_snapshots")] - pub allocated_snapshots: u64, - - /// Amount of actually allocated disk space for this replica\'s snapshots and its predecessors in bytes. For a restored/cloned replica this includes snapshots from the parent source. - #[serde(default, rename = "allocated_all_snapshots")] - pub allocated_all_snapshots: u64, - -} - -impl ReplicaUsage { - /// ReplicaUsage using only the required fields - pub fn new(capacity: impl Into, allocated: impl Into, allocated_snapshots: impl Into, allocated_all_snapshots: impl Into) -> ReplicaUsage { - ReplicaUsage { - capacity: capacity.into(), - allocated: allocated.into(), - allocated_snapshots: allocated_snapshots.into(), - allocated_all_snapshots: allocated_all_snapshots.into(), - - } - } - /// ReplicaUsage using all fields - pub fn new_all(capacity: impl Into, allocated: impl Into, allocated_snapshots: impl Into, allocated_all_snapshots: impl Into) -> ReplicaUsage { - ReplicaUsage { - capacity: capacity.into(), - allocated: allocated.into(), - allocated_snapshots: allocated_snapshots.into(), - allocated_all_snapshots: allocated_all_snapshots.into(), - - } - } -} - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/resize_volume_body.rs b/testgen/src/autogen/models/resize_volume_body.rs deleted file mode 100644 index 6e0a8955a..000000000 --- a/testgen/src/autogen/models/resize_volume_body.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// ResizeVolumeBody : Resize Volume Body - - - - - - - - -/// Resize Volume Body - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct ResizeVolumeBody { - - /// New required size of the volume in bytes - #[serde(default, rename = "size")] - pub size: u64, - -} - -impl ResizeVolumeBody { - /// ResizeVolumeBody using only the required fields - pub fn new(size: impl Into) -> ResizeVolumeBody { - ResizeVolumeBody { - size: size.into(), - - } - } - /// ResizeVolumeBody using all fields - pub fn new_all(size: impl Into) -> ResizeVolumeBody { - ResizeVolumeBody { - size: size.into(), - - } - } -} - - - - - - - - - - diff --git a/testgen/src/autogen/models/rest_json_error.rs b/testgen/src/autogen/models/rest_json_error.rs deleted file mode 100644 index 27c0ca064..000000000 --- a/testgen/src/autogen/models/rest_json_error.rs +++ /dev/null @@ -1,161 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// RestJsonError : Rest Json Error format - - - - - - - - -/// Rest Json Error format - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct RestJsonError { - - /// detailed error information - #[serde(default, rename = "details")] - pub details: String, - - /// last reported error information - #[serde(default, rename = "message")] - pub message: String, - - /// error kind - #[serde(default, rename = "kind")] - pub kind: Kind, - -} - -impl RestJsonError { - /// RestJsonError using only the required fields - pub fn new(details: impl Into, message: impl Into, kind: impl Into) -> RestJsonError { - RestJsonError { - details: details.into(), - message: message.into(), - kind: kind.into(), - - } - } - /// RestJsonError using all fields - pub fn new_all(details: impl Into, message: impl Into, kind: impl Into) -> RestJsonError { - RestJsonError { - details: details.into(), - message: message.into(), - kind: kind.into(), - - } - } -} - - - - - - - - - - - - -/// error kind -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Kind { - - - #[serde(rename = "Timeout")] - Timeout, - - #[serde(rename = "Deserialize")] - Deserialize, - - #[serde(rename = "Internal")] - Internal, - - #[serde(rename = "InvalidArgument")] - InvalidArgument, - - #[serde(rename = "DeadlineExceeded")] - DeadlineExceeded, - - #[serde(rename = "NotFound")] - NotFound, - - #[serde(rename = "AlreadyExists")] - AlreadyExists, - - #[serde(rename = "PermissionDenied")] - PermissionDenied, - - #[serde(rename = "ResourceExhausted")] - ResourceExhausted, - - #[serde(rename = "FailedPrecondition")] - FailedPrecondition, - - #[serde(rename = "NotShared")] - NotShared, - - #[serde(rename = "NotPublished")] - NotPublished, - - #[serde(rename = "AlreadyPublished")] - AlreadyPublished, - - #[serde(rename = "AlreadyShared")] - AlreadyShared, - - #[serde(rename = "Aborted")] - Aborted, - - #[serde(rename = "OutOfRange")] - OutOfRange, - - #[serde(rename = "Unimplemented")] - Unimplemented, - - #[serde(rename = "Unavailable")] - Unavailable, - - #[serde(rename = "Unauthenticated")] - Unauthenticated, - - #[serde(rename = "Unauthorized")] - Unauthorized, - - #[serde(rename = "Conflict")] - Conflict, - - #[serde(rename = "FailedPersist")] - FailedPersist, - - #[serde(rename = "Deleting")] - Deleting, - - #[serde(rename = "InUse")] - InUse, - - #[serde(rename = "CapacityLimitExceeded")] - CapacityLimitExceeded, - - #[serde(rename = "NotAcceptable")] - NotAcceptable, - - -} - -impl Default for Kind { - fn default() -> Self { - Self::Timeout - } -} - - - - diff --git a/testgen/src/autogen/models/rest_watch.rs b/testgen/src/autogen/models/rest_watch.rs deleted file mode 100644 index 9ac0b07b3..000000000 --- a/testgen/src/autogen/models/rest_watch.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// RestWatch : Watch Resource in the store - - - - - - - - -/// Watch Resource in the store - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct RestWatch { - - /// callback used to notify the watch of a change - #[serde(default, rename = "callback")] - pub callback: String, - - /// id of the resource to watch on - #[serde(default, rename = "resource")] - pub resource: String, - -} - -impl RestWatch { - /// RestWatch using only the required fields - pub fn new(callback: impl Into, resource: impl Into) -> RestWatch { - RestWatch { - callback: callback.into(), - resource: resource.into(), - - } - } - /// RestWatch using all fields - pub fn new_all(callback: impl Into, resource: impl Into) -> RestWatch { - RestWatch { - callback: callback.into(), - resource: resource.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/set_volume_property_body.rs b/testgen/src/autogen/models/set_volume_property_body.rs deleted file mode 100644 index 0a93321ae..000000000 --- a/testgen/src/autogen/models/set_volume_property_body.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// SetVolumePropertyBody : Set Volume Properties Body - - - - - - - - -/// Set Volume Properties Body - - - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -pub enum SetVolumePropertyBody { - - /// Max Snapshots limit per volume. - #[serde(rename = "max_snapshots")] - max_snapshots(u32), - -} - - - - - - - - - - diff --git a/testgen/src/autogen/models/snapshot_as_source.rs b/testgen/src/autogen/models/snapshot_as_source.rs deleted file mode 100644 index b6e955da1..000000000 --- a/testgen/src/autogen/models/snapshot_as_source.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// SnapshotAsSource : The snapshot source for the volume content. - - - - - - - - -/// The snapshot source for the volume content. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct SnapshotAsSource { - - - #[serde(default, rename = "snapshot")] - pub snapshot: uuid::Uuid, - - - #[serde(default, rename = "volume")] - pub volume: uuid::Uuid, - -} - -impl SnapshotAsSource { - /// SnapshotAsSource using only the required fields - pub fn new(snapshot: impl Into, volume: impl Into) -> SnapshotAsSource { - SnapshotAsSource { - snapshot: snapshot.into(), - volume: volume.into(), - - } - } - /// SnapshotAsSource using all fields - pub fn new_all(snapshot: impl Into, volume: impl Into) -> SnapshotAsSource { - SnapshotAsSource { - snapshot: snapshot.into(), - volume: volume.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/spec_status.rs b/testgen/src/autogen/models/spec_status.rs deleted file mode 100644 index 9e08b183f..000000000 --- a/testgen/src/autogen/models/spec_status.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// SpecStatus : Common base state for a resource - - - -/// Common base state for a resource -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum SpecStatus { - - - #[serde(rename = "Creating")] - Creating, - - #[serde(rename = "Created")] - Created, - - #[serde(rename = "Deleting")] - Deleting, - - #[serde(rename = "Deleted")] - Deleted, - -} - -impl ToString for SpecStatus { - fn to_string(&self) -> String { - match self { - - - Self::Creating => String::from("Creating"), - - Self::Created => String::from("Created"), - - Self::Deleting => String::from("Deleting"), - - Self::Deleted => String::from("Deleted"), - - - } - } -} - -impl Default for SpecStatus { - fn default() -> Self { - Self::Creating - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/specs.rs b/testgen/src/autogen/models/specs.rs deleted file mode 100644 index 67b7bbe17..000000000 --- a/testgen/src/autogen/models/specs.rs +++ /dev/null @@ -1,76 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Specs : Specs detailing the requested configuration of the objects. - - - - - - - - -/// Specs detailing the requested configuration of the objects. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct Specs { - - /// Nexus Specs - #[serde(default, rename = "nexuses")] - pub nexuses: Vec, - - /// Pool Specs - #[serde(default, rename = "pools")] - pub pools: Vec, - - /// Replica Specs - #[serde(default, rename = "replicas")] - pub replicas: Vec, - - /// Volume Specs - #[serde(default, rename = "volumes")] - pub volumes: Vec, - -} - -impl Specs { - /// Specs using only the required fields - pub fn new(nexuses: impl IntoVec, pools: impl IntoVec, replicas: impl IntoVec, volumes: impl IntoVec) -> Specs { - Specs { - nexuses: nexuses.into_vec(), - pools: pools.into_vec(), - replicas: replicas.into_vec(), - volumes: volumes.into_vec(), - - } - } - /// Specs using all fields - pub fn new_all(nexuses: impl IntoVec, pools: impl IntoVec, replicas: impl IntoVec, volumes: impl IntoVec) -> Specs { - Specs { - nexuses: nexuses.into_vec(), - pools: pools.into_vec(), - replicas: replicas.into_vec(), - volumes: volumes.into_vec(), - - } - } -} - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/topology.rs b/testgen/src/autogen/models/topology.rs deleted file mode 100644 index c4350fa3f..000000000 --- a/testgen/src/autogen/models/topology.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Topology : node and pool topology for volumes - - - - - - - - -/// node and pool topology for volumes - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct Topology { - - /// Used to determine how to place/distribute the data during volume creation and replica replacement. If left empty then the control plane will select from all available resources. - #[serde(default, rename = "node_topology", skip_serializing_if = "Option::is_none")] - pub node_topology: Option, - - /// Used to determine how to place/distribute the data during volume creation and replica replacement. If left empty then the control plane will select from all available resources. - #[serde(default, rename = "pool_topology", skip_serializing_if = "Option::is_none")] - pub pool_topology: Option, - -} - -impl Topology { - /// Topology using only the required fields - pub fn new() -> Topology { - Topology { - node_topology: None, - pool_topology: None, - - } - } - /// Topology using all fields - pub fn new_all(node_topology: impl Into>, pool_topology: impl Into>) -> Topology { - Topology { - node_topology: node_topology.into(), - pool_topology: pool_topology.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume.rs b/testgen/src/autogen/models/volume.rs deleted file mode 100644 index 5e3dd68c1..000000000 --- a/testgen/src/autogen/models/volume.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Volume : Volumes Volume information - - - - - - - - -/// Volumes Volume information - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct Volume { - - /// User specification of a volume. - #[serde(default, rename = "spec")] - pub spec: crate::models::VolumeSpec, - - /// Runtime state of the volume - #[serde(default, rename = "state")] - pub state: crate::models::VolumeState, - -} - -impl Volume { - /// Volume using only the required fields - pub fn new(spec: impl Into, state: impl Into) -> Volume { - Volume { - spec: spec.into(), - state: state.into(), - - } - } - /// Volume using all fields - pub fn new_all(spec: impl Into, state: impl Into) -> Volume { - Volume { - spec: spec.into(), - state: state.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_content_source.rs b/testgen/src/autogen/models/volume_content_source.rs deleted file mode 100644 index 834e1779f..000000000 --- a/testgen/src/autogen/models/volume_content_source.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeContentSource : Volume Content Source i.e the snapshot or the volume. - - - - - - - - -/// Volume Content Source i.e the snapshot or the volume. - - - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -pub enum VolumeContentSource { - - /// The snapshot source for the volume content. - #[serde(rename = "snapshot")] - snapshot(crate::models::SnapshotAsSource), - -} - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_policy.rs b/testgen/src/autogen/models/volume_policy.rs deleted file mode 100644 index abcaec7cb..000000000 --- a/testgen/src/autogen/models/volume_policy.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumePolicy : Volume policy used to determine if and how to replace a replica - - - - - - - - -/// Volume policy used to determine if and how to replace a replica - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumePolicy { - - /// If true the control plane will attempt to heal the volume by itself - #[serde(default, rename = "self_heal")] - pub self_heal: bool, - -} - -impl VolumePolicy { - /// VolumePolicy using only the required fields - pub fn new(self_heal: impl Into) -> VolumePolicy { - VolumePolicy { - self_heal: self_heal.into(), - - } - } - /// VolumePolicy using all fields - pub fn new_all(self_heal: impl Into) -> VolumePolicy { - VolumePolicy { - self_heal: self_heal.into(), - - } - } -} - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_share_protocol.rs b/testgen/src/autogen/models/volume_share_protocol.rs deleted file mode 100644 index 11ac1dbbc..000000000 --- a/testgen/src/autogen/models/volume_share_protocol.rs +++ /dev/null @@ -1,51 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeShareProtocol : Volume Share Protocol - - - -/// Volume Share Protocol -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum VolumeShareProtocol { - - - #[serde(rename = "nvmf")] - Nvmf, - - #[serde(rename = "iscsi")] - Iscsi, - -} - -impl ToString for VolumeShareProtocol { - fn to_string(&self) -> String { - match self { - - - Self::Nvmf => String::from("nvmf"), - - Self::Iscsi => String::from("iscsi"), - - - } - } -} - -impl Default for VolumeShareProtocol { - fn default() -> Self { - Self::Nvmf - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_snapshot.rs b/testgen/src/autogen/models/volume_snapshot.rs deleted file mode 100644 index 314b78a4b..000000000 --- a/testgen/src/autogen/models/volume_snapshot.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeSnapshot : Volume Snapshot Information. - - - - - - - - -/// Volume Snapshot Information. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeSnapshot { - - /// Volume Snapshot Metadata and Spec information. - #[serde(default, rename = "definition")] - pub definition: crate::models::VolumeSnapshotDefinition, - - /// Volume Snapshot State information. - #[serde(default, rename = "state")] - pub state: crate::models::VolumeSnapshotState, - -} - -impl VolumeSnapshot { - /// VolumeSnapshot using only the required fields - pub fn new(definition: impl Into, state: impl Into) -> VolumeSnapshot { - VolumeSnapshot { - definition: definition.into(), - state: state.into(), - - } - } - /// VolumeSnapshot using all fields - pub fn new_all(definition: impl Into, state: impl Into) -> VolumeSnapshot { - VolumeSnapshot { - definition: definition.into(), - state: state.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_snapshot_definition.rs b/testgen/src/autogen/models/volume_snapshot_definition.rs deleted file mode 100644 index 235aaae37..000000000 --- a/testgen/src/autogen/models/volume_snapshot_definition.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeSnapshotDefinition : Volume Snapshot Metadata and Spec information. - - - - - - - - -/// Volume Snapshot Metadata and Spec information. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeSnapshotDefinition { - - /// Volume Snapshot Metadata information. - #[serde(default, rename = "metadata")] - pub metadata: crate::models::VolumeSnapshotMetadata, - - /// Volume Snapshot Spec information. - #[serde(default, rename = "spec")] - pub spec: crate::models::VolumeSnapshotSpec, - -} - -impl VolumeSnapshotDefinition { - /// VolumeSnapshotDefinition using only the required fields - pub fn new(metadata: impl Into, spec: impl Into) -> VolumeSnapshotDefinition { - VolumeSnapshotDefinition { - metadata: metadata.into(), - spec: spec.into(), - - } - } - /// VolumeSnapshotDefinition using all fields - pub fn new_all(metadata: impl Into, spec: impl Into) -> VolumeSnapshotDefinition { - VolumeSnapshotDefinition { - metadata: metadata.into(), - spec: spec.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_snapshot_metadata.rs b/testgen/src/autogen/models/volume_snapshot_metadata.rs deleted file mode 100644 index ac49dfb34..000000000 --- a/testgen/src/autogen/models/volume_snapshot_metadata.rs +++ /dev/null @@ -1,116 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeSnapshotMetadata : Volume Snapshot Metadata information. - - - - - - - - -/// Volume Snapshot Metadata information. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeSnapshotMetadata { - - /// Common base state for a resource - #[serde(default, rename = "status")] - pub status: crate::models::SpecStatus, - - /// Timestamp when snapshot is taken on the storage system. - #[serde(default, rename = "timestamp", skip_serializing_if = "Option::is_none")] - pub timestamp: Option, - - /// Size in bytes of the snapshot (which is equivalent to its source size). - #[serde(default, rename = "size")] - pub size: u64, - - /// Spec size in bytes of the snapshot (which is equivalent to its source spec size). - #[serde(default, rename = "spec_size")] - pub spec_size: u64, - - /// Size in bytes taken by the snapshot and its predecessors. - #[serde(default, rename = "total_allocated_size")] - pub total_allocated_size: u64, - - - #[serde(default, rename = "txn_id")] - pub txn_id: String, - - - #[serde(default, rename = "transactions")] - pub transactions: ::std::collections::HashMap>, - - /// Number of restores done from this snapshot. - #[serde(default, rename = "num_restores")] - pub num_restores: u32, - - /// Number of snapshot replicas for a volumesnapshot. - #[serde(default, rename = "num_snapshot_replicas")] - pub num_snapshot_replicas: u32, - -} - -impl VolumeSnapshotMetadata { - /// VolumeSnapshotMetadata using only the required fields - pub fn new(status: impl Into, size: impl Into, spec_size: impl Into, total_allocated_size: impl Into, txn_id: impl Into, transactions: impl Into<::std::collections::HashMap>>, num_restores: impl Into, num_snapshot_replicas: impl Into) -> VolumeSnapshotMetadata { - VolumeSnapshotMetadata { - status: status.into(), - timestamp: None, - size: size.into(), - spec_size: spec_size.into(), - total_allocated_size: total_allocated_size.into(), - txn_id: txn_id.into(), - transactions: transactions.into(), - num_restores: num_restores.into(), - num_snapshot_replicas: num_snapshot_replicas.into(), - - } - } - /// VolumeSnapshotMetadata using all fields - pub fn new_all(status: impl Into, timestamp: impl Into>, size: impl Into, spec_size: impl Into, total_allocated_size: impl Into, txn_id: impl Into, transactions: impl Into<::std::collections::HashMap>>, num_restores: impl Into, num_snapshot_replicas: impl Into) -> VolumeSnapshotMetadata { - VolumeSnapshotMetadata { - status: status.into(), - timestamp: timestamp.into(), - size: size.into(), - spec_size: spec_size.into(), - total_allocated_size: total_allocated_size.into(), - txn_id: txn_id.into(), - transactions: transactions.into(), - num_restores: num_restores.into(), - num_snapshot_replicas: num_snapshot_replicas.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_snapshot_spec.rs b/testgen/src/autogen/models/volume_snapshot_spec.rs deleted file mode 100644 index a9c8f324a..000000000 --- a/testgen/src/autogen/models/volume_snapshot_spec.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeSnapshotSpec : Volume Snapshot Spec information. - - - - - - - - -/// Volume Snapshot Spec information. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeSnapshotSpec { - - - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - - - #[serde(default, rename = "source_volume")] - pub source_volume: uuid::Uuid, - -} - -impl VolumeSnapshotSpec { - /// VolumeSnapshotSpec using only the required fields - pub fn new(uuid: impl Into, source_volume: impl Into) -> VolumeSnapshotSpec { - VolumeSnapshotSpec { - uuid: uuid.into(), - source_volume: source_volume.into(), - - } - } - /// VolumeSnapshotSpec using all fields - pub fn new_all(uuid: impl Into, source_volume: impl Into) -> VolumeSnapshotSpec { - VolumeSnapshotSpec { - uuid: uuid.into(), - source_volume: source_volume.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_snapshot_state.rs b/testgen/src/autogen/models/volume_snapshot_state.rs deleted file mode 100644 index 85971b4fd..000000000 --- a/testgen/src/autogen/models/volume_snapshot_state.rs +++ /dev/null @@ -1,92 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeSnapshotState : Volume Snapshot State information. - - - - - - - - -/// Volume Snapshot State information. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeSnapshotState { - - - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - - /// Runtime size in bytes of the snapshot. Equal to the volume allocation at the time of the snapshot creation. It may grow larger if any of its predecessors are deleted. - #[serde(default, rename = "allocated_size")] - pub allocated_size: u64, - - - #[serde(default, rename = "source_volume")] - pub source_volume: uuid::Uuid, - - /// Timestamp when snapshot is taken on the storage system. - #[serde(default, rename = "timestamp", skip_serializing_if = "Option::is_none")] - pub timestamp: Option, - - /// Indicates if a snapshot is ready to be used as a new volume source. - #[serde(default, rename = "ready_as_source")] - pub ready_as_source: bool, - - /// List of individual ReplicaSnapshotStates. - #[serde(default, rename = "replica_snapshots")] - pub replica_snapshots: Vec, - -} - -impl VolumeSnapshotState { - /// VolumeSnapshotState using only the required fields - pub fn new(uuid: impl Into, allocated_size: impl Into, source_volume: impl Into, ready_as_source: impl Into, replica_snapshots: impl IntoVec) -> VolumeSnapshotState { - VolumeSnapshotState { - uuid: uuid.into(), - allocated_size: allocated_size.into(), - source_volume: source_volume.into(), - timestamp: None, - ready_as_source: ready_as_source.into(), - replica_snapshots: replica_snapshots.into_vec(), - - } - } - /// VolumeSnapshotState using all fields - pub fn new_all(uuid: impl Into, allocated_size: impl Into, source_volume: impl Into, timestamp: impl Into>, ready_as_source: impl Into, replica_snapshots: impl IntoVec) -> VolumeSnapshotState { - VolumeSnapshotState { - uuid: uuid.into(), - allocated_size: allocated_size.into(), - source_volume: source_volume.into(), - timestamp: timestamp.into(), - ready_as_source: ready_as_source.into(), - replica_snapshots: replica_snapshots.into_vec(), - - } - } -} - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_snapshots.rs b/testgen/src/autogen/models/volume_snapshots.rs deleted file mode 100644 index 0e766fec7..000000000 --- a/testgen/src/autogen/models/volume_snapshots.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeSnapshots : Array of volume snapshots plus the next token for subsequent get requests when using pagination. - - - - - - - - -/// Array of volume snapshots plus the next token for subsequent get requests when using pagination. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeSnapshots { - - - #[serde(default, rename = "entries")] - pub entries: Vec, - - - #[serde(default, rename = "next_token", skip_serializing_if = "Option::is_none")] - pub next_token: Option, - -} - -impl VolumeSnapshots { - /// VolumeSnapshots using only the required fields - pub fn new(entries: impl IntoVec) -> VolumeSnapshots { - VolumeSnapshots { - entries: entries.into_vec(), - next_token: None, - - } - } - /// VolumeSnapshots using all fields - pub fn new_all(entries: impl IntoVec, next_token: impl Into>) -> VolumeSnapshots { - VolumeSnapshots { - entries: entries.into_vec(), - next_token: next_token.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_spec.rs b/testgen/src/autogen/models/volume_spec.rs deleted file mode 100644 index e966b68b7..000000000 --- a/testgen/src/autogen/models/volume_spec.rs +++ /dev/null @@ -1,164 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeSpec : User specification of a volume. - - - - - - - - -/// User specification of a volume. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeSpec { - - /// Optionally used to store custom volume information - #[serde(default, rename = "labels", skip_serializing_if = "Option::is_none")] - pub labels: Option<::std::collections::HashMap>, - - /// Number of children the volume should have. - #[serde(default, rename = "num_replicas")] - pub num_replicas: u8, - - /// Record of the operation in progress - #[serde(default, rename = "operation", skip_serializing_if = "Option::is_none")] - pub operation: Option, - - /// Size that the volume should be. - #[serde(default, rename = "size")] - pub size: u64, - - /// Common base state for a resource - #[serde(default, rename = "status")] - pub status: crate::models::SpecStatus, - - /// Specification of a volume target - #[serde(default, rename = "target", skip_serializing_if = "Option::is_none")] - pub target: Option, - - /// Volume Id - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - - /// node and pool topology for volumes - #[serde(default, rename = "topology", skip_serializing_if = "Option::is_none")] - pub topology: Option, - - /// Volume policy used to determine if and how to replace a replica - #[serde(default, rename = "policy")] - pub policy: crate::models::VolumePolicy, - - /// Thin provisioning flag. - #[serde(default, rename = "thin")] - pub thin: bool, - - /// Volume converted to thin provisioned. - #[serde(default, rename = "as_thin", skip_serializing_if = "Option::is_none")] - pub as_thin: Option, - - /// Affinity Group related information. - #[serde(default, rename = "affinity_group", skip_serializing_if = "Option::is_none")] - pub affinity_group: Option, - - /// Volume Content Source i.e the snapshot or the volume. - #[serde(default, rename = "content_source", skip_serializing_if = "Option::is_none")] - pub content_source: Option, - - /// Number of snapshots taken on this volume. - #[serde(default, rename = "num_snapshots")] - pub num_snapshots: u32, - - /// Max snapshots to limit per volume. - #[serde(default, rename = "max_snapshots", skip_serializing_if = "Option::is_none")] - pub max_snapshots: Option, - -} - -impl VolumeSpec { - /// VolumeSpec using only the required fields - pub fn new(num_replicas: impl Into, size: impl Into, status: impl Into, uuid: impl Into, policy: impl Into, thin: impl Into, num_snapshots: impl Into) -> VolumeSpec { - VolumeSpec { - labels: None, - num_replicas: num_replicas.into(), - operation: None, - size: size.into(), - status: status.into(), - target: None, - uuid: uuid.into(), - topology: None, - policy: policy.into(), - thin: thin.into(), - as_thin: None, - affinity_group: None, - content_source: None, - num_snapshots: num_snapshots.into(), - max_snapshots: None, - - } - } - /// VolumeSpec using all fields - pub fn new_all(labels: impl Into>>, num_replicas: impl Into, operation: impl Into>, size: impl Into, status: impl Into, target: impl Into>, uuid: impl Into, topology: impl Into>, policy: impl Into, thin: impl Into, as_thin: impl Into>, affinity_group: impl Into>, content_source: impl Into>, num_snapshots: impl Into, max_snapshots: impl Into>) -> VolumeSpec { - VolumeSpec { - labels: labels.into(), - num_replicas: num_replicas.into(), - operation: operation.into(), - size: size.into(), - status: status.into(), - target: target.into(), - uuid: uuid.into(), - topology: topology.into(), - policy: policy.into(), - thin: thin.into(), - as_thin: as_thin.into(), - affinity_group: affinity_group.into(), - content_source: content_source.into(), - num_snapshots: num_snapshots.into(), - max_snapshots: max_snapshots.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_spec_operation.rs b/testgen/src/autogen/models/volume_spec_operation.rs deleted file mode 100644 index 426c20069..000000000 --- a/testgen/src/autogen/models/volume_spec_operation.rs +++ /dev/null @@ -1,114 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeSpecOperation : Record of the operation in progress - - - - - - - - -/// Record of the operation in progress - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeSpecOperation { - - /// Record of the operation - #[serde(default, rename = "operation")] - pub operation: Operation, - - /// Result of the operation - #[serde(default, rename = "result", skip_serializing_if = "Option::is_none")] - pub result: Option, - -} - -impl VolumeSpecOperation { - /// VolumeSpecOperation using only the required fields - pub fn new(operation: impl Into) -> VolumeSpecOperation { - VolumeSpecOperation { - operation: operation.into(), - result: None, - - } - } - /// VolumeSpecOperation using all fields - pub fn new_all(operation: impl Into, result: impl Into>) -> VolumeSpecOperation { - VolumeSpecOperation { - operation: operation.into(), - result: result.into(), - - } - } -} - - - - - - - - -/// Record of the operation -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Operation { - - - #[serde(rename = "Create")] - Create, - - #[serde(rename = "Destroy")] - Destroy, - - #[serde(rename = "Share")] - Share, - - #[serde(rename = "Unshare")] - Unshare, - - #[serde(rename = "SetReplica")] - SetReplica, - - #[serde(rename = "RemoveUnusedReplica")] - RemoveUnusedReplica, - - #[serde(rename = "Publish")] - Publish, - - #[serde(rename = "Republish")] - Republish, - - #[serde(rename = "Unpublish")] - Unpublish, - - #[serde(rename = "CreateSnapshot")] - CreateSnapshot, - - #[serde(rename = "DestroySnapshot")] - DestroySnapshot, - - #[serde(rename = "Resize")] - Resize, - - #[serde(rename = "SetVolumeProperty")] - SetVolumeProperty, - - -} - -impl Default for Operation { - fn default() -> Self { - Self::Create - } -} - - - - - - diff --git a/testgen/src/autogen/models/volume_state.rs b/testgen/src/autogen/models/volume_state.rs deleted file mode 100644 index f3cb92650..000000000 --- a/testgen/src/autogen/models/volume_state.rs +++ /dev/null @@ -1,92 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeState : Runtime state of the volume - - - - - - - - -/// Runtime state of the volume - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeState { - - /// target exposed via a Nexus - #[serde(default, rename = "target", skip_serializing_if = "Option::is_none")] - pub target: Option, - - /// size of the volume in bytes - #[serde(default, rename = "size")] - pub size: u64, - - /// current volume status - #[serde(default, rename = "status")] - pub status: crate::models::VolumeStatus, - - /// name of the volume - #[serde(default, rename = "uuid")] - pub uuid: uuid::Uuid, - - /// replica topology information - #[serde(default, rename = "replica_topology")] - pub replica_topology: ::std::collections::HashMap, - - /// Volume space usage - #[serde(default, rename = "usage", skip_serializing_if = "Option::is_none")] - pub usage: Option, - -} - -impl VolumeState { - /// VolumeState using only the required fields - pub fn new(size: impl Into, status: impl Into, uuid: impl Into, replica_topology: impl Into<::std::collections::HashMap>) -> VolumeState { - VolumeState { - target: None, - size: size.into(), - status: status.into(), - uuid: uuid.into(), - replica_topology: replica_topology.into(), - usage: None, - - } - } - /// VolumeState using all fields - pub fn new_all(target: impl Into>, size: impl Into, status: impl Into, uuid: impl Into, replica_topology: impl Into<::std::collections::HashMap>, usage: impl Into>) -> VolumeState { - VolumeState { - target: target.into(), - size: size.into(), - status: status.into(), - uuid: uuid.into(), - replica_topology: replica_topology.into(), - usage: usage.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_status.rs b/testgen/src/autogen/models/volume_status.rs deleted file mode 100644 index f045fb712..000000000 --- a/testgen/src/autogen/models/volume_status.rs +++ /dev/null @@ -1,66 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeStatus : current volume status - - - -/// current volume status -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum VolumeStatus { - - - #[serde(rename = "Unknown")] - Unknown, - - #[serde(rename = "Online")] - Online, - - #[serde(rename = "Degraded")] - Degraded, - - #[serde(rename = "Faulted")] - Faulted, - - #[serde(rename = "Shutdown")] - Shutdown, - -} - -impl ToString for VolumeStatus { - fn to_string(&self) -> String { - match self { - - - Self::Unknown => String::from("Unknown"), - - Self::Online => String::from("Online"), - - Self::Degraded => String::from("Degraded"), - - Self::Faulted => String::from("Faulted"), - - Self::Shutdown => String::from("Shutdown"), - - - } - } -} - -impl Default for VolumeStatus { - fn default() -> Self { - Self::Unknown - } -} - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_target.rs b/testgen/src/autogen/models/volume_target.rs deleted file mode 100644 index 57ae5526f..000000000 --- a/testgen/src/autogen/models/volume_target.rs +++ /dev/null @@ -1,68 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeTarget : Specification of a volume target - - - - - - - - -/// Specification of a volume target - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeTarget { - - /// The node where front-end IO will be sent to - #[serde(default, rename = "node")] - pub node: String, - - /// Volume Share Protocol - #[serde(default, rename = "protocol", skip_serializing_if = "Option::is_none")] - pub protocol: Option, - - /// The nodes where the front-end workload resides. If the workload moves then the volume must be republished. - #[serde(default, rename = "frontend_nodes", skip_serializing_if = "Option::is_none")] - pub frontend_nodes: Option>, - -} - -impl VolumeTarget { - /// VolumeTarget using only the required fields - pub fn new(node: impl Into) -> VolumeTarget { - VolumeTarget { - node: node.into(), - protocol: None, - frontend_nodes: None, - - } - } - /// VolumeTarget using all fields - pub fn new_all(node: impl Into, protocol: impl Into>, frontend_nodes: impl IntoOptVec) -> VolumeTarget { - VolumeTarget { - node: node.into(), - protocol: protocol.into(), - frontend_nodes: frontend_nodes.into_opt_vec(), - - } - } -} - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volume_usage.rs b/testgen/src/autogen/models/volume_usage.rs deleted file mode 100644 index 7bebe2612..000000000 --- a/testgen/src/autogen/models/volume_usage.rs +++ /dev/null @@ -1,108 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// VolumeUsage : Volume space usage - - - - - - - - -/// Volume space usage - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct VolumeUsage { - - /// Capacity of the volume in bytes. - #[serde(default, rename = "capacity")] - pub capacity: u64, - - /// -| Allocated size in bytes, related the largest healthy replica, including snapshots. For example, if a volume has 2 replicas, each with 1MiB allocated space, then this field will be 1MiB. - #[serde(default, rename = "allocated")] - pub allocated: u64, - - /// -| Allocated size in bytes, related to the largest healthy replica, excluding snapshots. - #[serde(default, rename = "allocated_replica")] - pub allocated_replica: u64, - - /// -| Allocated size in bytes, related the healthy replica with the highest snapshot usage. - #[serde(default, rename = "allocated_snapshots")] - pub allocated_snapshots: u64, - - /// -| For a restored/cloned volume, allocated size in bytes, related to the healthy replica with largest parent snapshot allocation. - #[serde(default, rename = "allocated_all_snapshots")] - pub allocated_all_snapshots: u64, - - /// -| Allocated size in bytes, accrued from all the replicas, including snapshots. For example, if a volume has 2 replicas, each with 1MiB allocated space, then this field will be 2MiB. - #[serde(default, rename = "total_allocated")] - pub total_allocated: u64, - - /// -| Allocated size in bytes, accrued from all the replicas, excluding snapshots. - #[serde(default, rename = "total_allocated_replicas")] - pub total_allocated_replicas: serde_json::Value, - - /// -| Allocated size in bytes, accrued from all the replica\'s snapshots. - #[serde(default, rename = "total_allocated_snapshots")] - pub total_allocated_snapshots: u64, - -} - -impl VolumeUsage { - /// VolumeUsage using only the required fields - pub fn new(capacity: impl Into, allocated: impl Into, allocated_replica: impl Into, allocated_snapshots: impl Into, allocated_all_snapshots: impl Into, total_allocated: impl Into, total_allocated_replicas: impl Into, total_allocated_snapshots: impl Into) -> VolumeUsage { - VolumeUsage { - capacity: capacity.into(), - allocated: allocated.into(), - allocated_replica: allocated_replica.into(), - allocated_snapshots: allocated_snapshots.into(), - allocated_all_snapshots: allocated_all_snapshots.into(), - total_allocated: total_allocated.into(), - total_allocated_replicas: total_allocated_replicas.into(), - total_allocated_snapshots: total_allocated_snapshots.into(), - - } - } - /// VolumeUsage using all fields - pub fn new_all(capacity: impl Into, allocated: impl Into, allocated_replica: impl Into, allocated_snapshots: impl Into, allocated_all_snapshots: impl Into, total_allocated: impl Into, total_allocated_replicas: impl Into, total_allocated_snapshots: impl Into) -> VolumeUsage { - VolumeUsage { - capacity: capacity.into(), - allocated: allocated.into(), - allocated_replica: allocated_replica.into(), - allocated_snapshots: allocated_snapshots.into(), - allocated_all_snapshots: allocated_all_snapshots.into(), - total_allocated: total_allocated.into(), - total_allocated_replicas: total_allocated_replicas.into(), - total_allocated_snapshots: total_allocated_snapshots.into(), - - } - } -} - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/volumes.rs b/testgen/src/autogen/models/volumes.rs deleted file mode 100644 index f65210268..000000000 --- a/testgen/src/autogen/models/volumes.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// Volumes : Array of volumes plus the next token for subsequent get requests when using pagination. - - - - - - - - -/// Array of volumes plus the next token for subsequent get requests when using pagination. - -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] -pub struct Volumes { - - - #[serde(default, rename = "entries")] - pub entries: Vec, - - - #[serde(default, rename = "next_token", skip_serializing_if = "Option::is_none")] - pub next_token: Option, - -} - -impl Volumes { - /// Volumes using only the required fields - pub fn new(entries: impl IntoVec) -> Volumes { - Volumes { - entries: entries.into_vec(), - next_token: None, - - } - } - /// Volumes using all fields - pub fn new_all(entries: impl IntoVec, next_token: impl Into>) -> Volumes { - Volumes { - entries: entries.into_vec(), - next_token: next_token.into(), - - } - } -} - - - - - - - - - - - - diff --git a/testgen/src/autogen/models/watch_callback.rs b/testgen/src/autogen/models/watch_callback.rs deleted file mode 100644 index afb910e44..000000000 --- a/testgen/src/autogen/models/watch_callback.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![allow(clippy::too_many_arguments, clippy::new_without_default, non_camel_case_types, unused_imports)] - -use crate::apis::{IntoOptVec, IntoVec}; - - - -/// WatchCallback : Watch Callbacks - - - - - - - - -/// Watch Callbacks - - - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -pub enum WatchCallback { - - - #[serde(rename = "uri")] - uri(String), - -} - - - - - - - - - -